/[sudobot]/trunk/deploy-commands.js
ViewVC logotype

Diff of /trunk/deploy-commands.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 328 by rakin, Mon Jul 29 17:29:34 2024 UTC revision 399 by rakin, Mon Jul 29 17:30:02 2024 UTC
# Line 1  Line 1 
1  #!/bin/node  #!/bin/node
2    
3    /**
4    * This file is part of SudoBot.
5    *
6    * Copyright (C) 2021-2022 OSN Inc.
7    *
8    * SudoBot is free software; you can redistribute it and/or modify it
9    * under the terms of the GNU Affero General Public License as published by
10    * the Free Software Foundation, either version 3 of the License, or
11    * (at your option) any later version.
12    *
13    * SudoBot is distributed in the hope that it will be useful, but
14    * WITHOUT ANY WARRANTY; without even the implied warranty of
15    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16    * GNU Affero General Public License for more details.
17    *
18    * You should have received a copy of the GNU Affero General Public License
19    * along with SudoBot. If not, see <https://www.gnu.org/licenses/>.
20    */
21    
22  const { SlashCommandBuilder, ContextMenuCommandBuilder } = require('@discordjs/builders');  const { SlashCommandBuilder, ContextMenuCommandBuilder } = require('@discordjs/builders');
23  const { REST } = require('@discordjs/rest');  const { REST } = require('@discordjs/rest');
24  const { Routes } = require('discord-api-types/v9');  const { Routes } = require('discord-api-types/v9');
25  const { config } = require('dotenv');  const { config } = require('dotenv');
26  const { existsSync } = require('fs');  const { existsSync } = require('fs');
 const { Permissions, ApplicationCommand } = require('discord.js');  
27  const path = require('path');  const path = require('path');
28  const { ActivityType, ApplicationCommandType } = require('discord-api-types/v10');  const { ApplicationCommandType } = require('discord-api-types/v10');
29    
30  if (existsSync(path.join(__dirname, '.env'))) {  if (existsSync(path.join(__dirname, '.env'))) {
31      config();      config();
# Line 62  let commands = [ Line 80  let commands = [
80              }              }
81          ])),          ])),
82      new SlashCommandBuilder().setName('config').setDescription('View/change the system settings for this server')      new SlashCommandBuilder().setName('config').setDescription('View/change the system settings for this server')
83          .addStringOption(option => option.setName('key').setDescription('The setting key (e.g. spam_filter.enabled)').setRequired(true))          .addStringOption(option => option.setName('key').setDescription('The setting key (e.g. spam_filter.enabled)').setRequired(true).setAutocomplete(true))
84          .addStringOption(option => option.setName('value').setDescription('New value for the setting')),          .addStringOption(option => option.setName('value').setDescription('New value for the setting')),
85    
86      // INFORMATION      // INFORMATION
# Line 299  let commands = [ Line 317  let commands = [
317    
318      new SlashCommandBuilder().setName('shot').setDescription('Give a shot to a member')      new SlashCommandBuilder().setName('shot').setDescription('Give a shot to a member')
319          .addUserOption(option => option.setName('member').setDescription("The member").setRequired(true))          .addUserOption(option => option.setName('member').setDescription("The member").setRequired(true))
320          .addStringOption(option => option.setName('reason').setDescription("The reason for giving shot to this user")),          .addStringOption(option => option.setName('reason').setDescription("The reason for giving shot to this user"))
321            .addBooleanOption(option => option.setName('anonymous').setDescription("Prevents sending your name as the 'Doctor' of the shot")),
322    
323      new SlashCommandBuilder().setName('warn').setDescription('Warn a member')      new SlashCommandBuilder().setName('warn').setDescription('Warn a member')
324          .addUserOption(option => option.setName('member').setDescription("The member").setRequired(true))          .addUserOption(option => option.setName('member').setDescription("The member").setRequired(true))
# Line 323  let commands = [ Line 342  let commands = [
342    
343      new SlashCommandBuilder().setName('warning').setDescription('Clear, remove or view warnings')      new SlashCommandBuilder().setName('warning').setDescription('Clear, remove or view warnings')
344          .addSubcommand(subcmd => {          .addSubcommand(subcmd => {
345              return subcmd.setName('view').setDescription('View information about a warning').addNumberOption(option => option.setName('id').setDescription("The warning ID").setRequired(true));              return subcmd.setName('view').setDescription('View information about a warning').addStringOption(option => option.setName('id').setDescription("The warning ID").setRequired(true));
346          })          })
347          .addSubcommand(subcmd => {          .addSubcommand(subcmd => {
348              return subcmd.setName('remove').setDescription('Remove a warning').addNumberOption(option => option.setName('id').setDescription("The warning ID").setRequired(true));              return subcmd.setName('remove').setDescription('Remove a warning').addStringOption(option => option.setName('id').setDescription("The warning ID").setRequired(true));
349          })          })
350          .addSubcommand(subcmd => {          .addSubcommand(subcmd => {
351              return subcmd.setName('list').setDescription('List warnings for a user').addUserOption(option => option.setName('user').setDescription("The user").setRequired(true));              return subcmd.setName('list').setDescription('List warnings for a user').addUserOption(option => option.setName('user').setDescription("The user").setRequired(true));

Legend:
Removed from v.328  
changed lines
  Added in v.399

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26