aboutsummaryrefslogtreecommitdiff
path: root/bot.js
diff options
context:
space:
mode:
Diffstat (limited to 'bot.js')
-rw-r--r--bot.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/bot.js b/bot.js
index 6f993a7..2eee3da 100644
--- a/bot.js
+++ b/bot.js
@@ -33,6 +33,7 @@ const commandHandler = require('./handler/command');
const buttonHandler = require('./handler/button');
const menuHandler = require('./handler/menu');
const errorHandler = require('./handler/errors');
+const autocompleteHandler = require('./handler/autocomplete');
global.langs = JSON.parse(fs.readFileSync("./user/userdata.json").toString());
global.spoils = JSON.parse(fs.readFileSync("./user/spoilers.json").toString());
@@ -122,8 +123,10 @@ client.on('interactionCreate', async interaction => {
await buttonHandler(interaction);
} else if (interaction.isSelectMenu()) {
await menuHandler(interaction);
+ } else if (interaction.isAutocomplete()) {
+ await autocompleteHandler(interaction);
} else {
- throw new Error("Interaction type not supported")
+ errorHandler(interaction, new Error("Interaction type not supported"))
}
} catch (e) {
errorHandler(interaction, e)