diff --git a/bots/config.example.json b/bots/config.example.json index e9de5ff..055c2ef 100644 --- a/bots/config.example.json +++ b/bots/config.example.json @@ -2,7 +2,8 @@ "discord": { "token": "YOUR-BOT-TOKEN-HERE", "id": "1038762591805247518", - "trainRole": "965267139902705744" + "trainRole": "965267139902705744", + "trainingRole": "952987191401926697" }, "telegram": { diff --git a/bots/discord/commands/trainAI.js b/bots/discord/commands/trainAI.js new file mode 100644 index 0000000..ea3fc72 --- /dev/null +++ b/bots/discord/commands/trainAI.js @@ -0,0 +1,21 @@ +import { SlashCommandBuilder } from 'discord.js'; + +export default { + data: new SlashCommandBuilder() + .setName('train') + .setDescription('Train the AI.'), + async execute(interaction) { + if (!interaction.member.roles.cache.get(global.config.discord.trainingRole)) + return interaction.reply({ + content: 'You don\'t have the permission to do this.', + ephemeral: true + }); + + interaction.client.helper.trainAI(); + + interaction.reply({ + content: 'Sent the trainAI command to the server.', + ephemeral: true + }); + } +};