mirror of
https://github.com/mii443/BungeeDiscordChat.git
synced 2025-08-22 15:05:29 +00:00
DiscordBotが起動しないバグ修正
This commit is contained in:
@ -26,19 +26,8 @@ class BungeeDiscordChat : Plugin(), Listener{
|
||||
var discord = DiscordBot()
|
||||
|
||||
override fun onEnable() {
|
||||
/**
|
||||
for (command in arrayOf(
|
||||
"tell", "msg", "message", "m", "w", "t")) {
|
||||
proxy.pluginManager.registerCommand(
|
||||
this, TellCommand(this, command))
|
||||
}
|
||||
for (command in arrayOf("reply", "r")) {
|
||||
proxy.pluginManager.registerCommand(
|
||||
this, ReplyCommand(this, command))
|
||||
}
|
||||
**/
|
||||
loadConfig()
|
||||
|
||||
logger.info("Config Loaded")
|
||||
proxy.pluginManager.registerListener(this, this)
|
||||
}
|
||||
|
||||
@ -53,9 +42,11 @@ class BungeeDiscordChat : Plugin(), Listener{
|
||||
discord.commandlogChannelID = config.getLong("Discord.CommandlogChannel")
|
||||
discord.systemChannelID = config.getLong("Discord.SystemChannel")
|
||||
|
||||
discord.plugin = this
|
||||
discord.setup()
|
||||
} catch (e: NullPointerException) {
|
||||
e.printStackTrace()
|
||||
discord.system("[Error]${e.localizedMessage}")
|
||||
logger.info("[Error]${e.localizedMessage}")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ class DiscordBot : ListenerAdapter() {
|
||||
lateinit var jda: JDA
|
||||
var token:String? = null
|
||||
|
||||
var guild: Guild? = null;
|
||||
var guild: Guild? = null
|
||||
|
||||
var guildID:Long = 0
|
||||
var chatChannelID:Long = 0
|
||||
@ -61,7 +61,7 @@ class DiscordBot : ListenerAdapter() {
|
||||
jda = JDABuilder(AccountType.BOT).setToken(token).addEventListeners(this).build()
|
||||
jda.awaitReady()
|
||||
|
||||
guild = jda.getGuildById(this.guildID);
|
||||
guild = jda.getGuildById(this.guildID)
|
||||
chatChannel = guild?.getTextChannelById(this.chatChannelID)
|
||||
systemChannel = guild?.getTextChannelById(this.systemChannelID)
|
||||
commandlogChannel = guild?.getTextChannelById(this.commandlogChannelID)
|
||||
|
Reference in New Issue
Block a user