diff options
Diffstat (limited to 'bot.js')
-rw-r--r-- | bot.js | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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) |