Compare commits
4 Commits
f934c7d7f4
...
57a43703f2
Author | SHA1 | Date | |
---|---|---|---|
57a43703f2 | |||
de356a0163 | |||
5440df2bb6 | |||
5710a5d7fe |
@ -12,7 +12,7 @@ make the bot change its behavior.
|
|||||||
|
|
||||||
Additionally available parameters are:
|
Additionally available parameters are:
|
||||||
- **verbose**: log every message that the bot receives, plus additional debugging messages. Very spammy and performance heavy.
|
- **verbose**: log every message that the bot receives, plus additional debugging messages. Very spammy and performance heavy.
|
||||||
- **refresh**: force refresh the bot's commands.
|
- **refresh**: force refresh the slash commands. This is useful in case there was a simple update to a command that did not drastically change it, so no changes are found at bootup (eg: fixing a typo in the command description).
|
||||||
|
|
||||||
*Note: Java 16 or later is required.*
|
*Note: Java 16 or later is required.*
|
||||||
|
|
||||||
@ -24,4 +24,9 @@ Edit the configuration file and set all values according to your needs.
|
|||||||
|
|
||||||
Save the file and start the bot again. If there are no issues, everything will load and it will print an
|
Save the file and start the bot again. If there are no issues, everything will load and it will print an
|
||||||
invite-link in your console. Click on the link to add your bot to any server with the correct permissions
|
invite-link in your console. Click on the link to add your bot to any server with the correct permissions
|
||||||
already set-up.
|
already set-up. The bot supports both slash commands and message commands, with prefix `hideko`. Most
|
||||||
|
commands support both systems, but some of them are limited in one way or another.
|
||||||
|
|
||||||
|
The bot currently supports SQLite as a database backend. A database file will be created after the first boot
|
||||||
|
in the same directory that you ran it. Do not delete the database file to avoid corruption and unpredictable
|
||||||
|
behavior.
|
@ -133,8 +133,6 @@ public class HidekoBot
|
|||||||
slashCommandListener.registerCommand(new TimeoutCommand());
|
slashCommandListener.registerCommand(new TimeoutCommand());
|
||||||
slashCommandListener.registerCommand(new TriviaCommand());
|
slashCommandListener.registerCommand(new TriviaCommand());
|
||||||
slashCommandListener.registerCommand(new UrbanDictionaryCommand());
|
slashCommandListener.registerCommand(new UrbanDictionaryCommand());
|
||||||
Cache.setSlashCommandListener(slashCommandListener);
|
|
||||||
Cache.setSlashCommandCompletionListener(slashCommandCompletionListener);
|
|
||||||
|
|
||||||
// register message commands
|
// register message commands
|
||||||
MessageCommandListener messageCommandListener = new MessageCommandListener();
|
MessageCommandListener messageCommandListener = new MessageCommandListener();
|
||||||
@ -156,9 +154,11 @@ public class HidekoBot
|
|||||||
messageCommandListener.registerCommand(new wtf.beatrice.hidekobot.commands.message.TimeoutCommand());
|
messageCommandListener.registerCommand(new wtf.beatrice.hidekobot.commands.message.TimeoutCommand());
|
||||||
messageCommandListener.registerCommand(new wtf.beatrice.hidekobot.commands.message.TriviaCommand());
|
messageCommandListener.registerCommand(new wtf.beatrice.hidekobot.commands.message.TriviaCommand());
|
||||||
messageCommandListener.registerCommand(new wtf.beatrice.hidekobot.commands.message.UrbanDictionaryCommand());
|
messageCommandListener.registerCommand(new wtf.beatrice.hidekobot.commands.message.UrbanDictionaryCommand());
|
||||||
Cache.setMessageCommandListener(messageCommandListener);
|
|
||||||
|
|
||||||
// register listeners
|
// register listeners
|
||||||
|
Cache.setSlashCommandListener(slashCommandListener);
|
||||||
|
Cache.setSlashCommandCompletionListener(slashCommandCompletionListener);
|
||||||
|
Cache.setMessageCommandListener(messageCommandListener);
|
||||||
jda.addEventListener(messageCommandListener);
|
jda.addEventListener(messageCommandListener);
|
||||||
jda.addEventListener(slashCommandListener);
|
jda.addEventListener(slashCommandListener);
|
||||||
jda.addEventListener(slashCommandCompletionListener);
|
jda.addEventListener(slashCommandCompletionListener);
|
||||||
|
@ -34,7 +34,7 @@ public class SlashCommandListener extends ListenerAdapter
|
|||||||
if(command == null) return;
|
if(command == null) return;
|
||||||
|
|
||||||
|
|
||||||
// finally run the command, in a new thread to avoid locking.
|
// finally run the command, in a new thread to avoid locking the main one.
|
||||||
new Thread(() -> command.runSlashCommand(event)).start();
|
new Thread(() -> command.runSlashCommand(event)).start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user