Compare commits

...

4 Commits

Author SHA1 Message Date
f934c7d7f4 Update instructions order when registering listeners
All checks were successful
continuous-integration/drone/push Build is passing
2022-12-28 05:36:58 +01:00
61985ff193 Update a small comment 2022-12-28 05:36:54 +01:00
d07664ea04 Update 'README.MD' 2022-12-28 05:36:50 +01:00
26f071aaf5 Update 'README.MD' 2022-12-28 05:36:38 +01:00
3 changed files with 11 additions and 6 deletions

View File

@ -12,7 +12,7 @@ make the bot change its behavior.
Additionally available parameters are:
- **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.*
@ -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
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.

View File

@ -133,8 +133,6 @@ public class HidekoBot
slashCommandListener.registerCommand(new TimeoutCommand());
slashCommandListener.registerCommand(new TriviaCommand());
slashCommandListener.registerCommand(new UrbanDictionaryCommand());
Cache.setSlashCommandListener(slashCommandListener);
Cache.setSlashCommandCompletionListener(slashCommandCompletionListener);
// register message commands
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.TriviaCommand());
messageCommandListener.registerCommand(new wtf.beatrice.hidekobot.commands.message.UrbanDictionaryCommand());
Cache.setMessageCommandListener(messageCommandListener);
// register listeners
Cache.setSlashCommandListener(slashCommandListener);
Cache.setSlashCommandCompletionListener(slashCommandCompletionListener);
Cache.setMessageCommandListener(messageCommandListener);
jda.addEventListener(messageCommandListener);
jda.addEventListener(slashCommandListener);
jda.addEventListener(slashCommandCompletionListener);

View File

@ -34,7 +34,7 @@ public class SlashCommandListener extends ListenerAdapter
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();
}
}