/[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 290 by rakin, Mon Jul 29 17:29:23 2024 UTC revision 466 by rakin, Mon Jul 29 17:30:22 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 70  let commands = [ Line 88  let commands = [
88      new SlashCommandBuilder().setName('lookup').setDescription('Lookup something')      new SlashCommandBuilder().setName('lookup').setDescription('Lookup something')
89          .addSubcommand(subcommand => subcommand.setName("user").setDescription("User lookup")          .addSubcommand(subcommand => subcommand.setName("user").setDescription("User lookup")
90              .addUserOption(option => option.setName("user").setDescription("The user to search").setRequired(true))              .addUserOption(option => option.setName("user").setDescription("The user to search").setRequired(true))
91          )              )
92          .addSubcommand(subcommand => subcommand.setName("guild").setDescription("Server/Guild lookup")              .addSubcommand(subcommand => subcommand.setName("guild").setDescription("Server/Guild lookup")
93              .addStringOption(option => option.setName("server").setDescription("The ID of the server/guild to lookup").setRequired(true))                    .addStringOption(option => option.setName("guild_id").setDescription("The ID of the server/guild to lookup").setRequired(true))
94          ),              )
95                .addSubcommand(subcommand => subcommand.setName("avatar").setDescription("Avatar lookup using Google Image Search")
96                    .addUserOption(option => option.setName("user").setDescription("The user to lookup").setRequired(true))
97                ),
98    
99      new SlashCommandBuilder().setName('profile').setDescription('Show someone\'s profile')      new SlashCommandBuilder().setName('profile').setDescription('Show someone\'s profile')
100          .addUserOption(option => option.setName('user').setDescription('The user')),          .addUserOption(option => option.setName('user').setDescription('The user')),
# Line 81  let commands = [ Line 102  let commands = [
102          .addUserOption(option => option.setName('user').setDescription('The user')),          .addUserOption(option => option.setName('user').setDescription('The user')),
103      new SlashCommandBuilder().setName('rolelist').setDescription('List all roles or show info about a role')      new SlashCommandBuilder().setName('rolelist').setDescription('List all roles or show info about a role')
104          .addRoleOption(option => option.setName('role').setDescription('The role'))          .addRoleOption(option => option.setName('role').setDescription('The role'))
105          .addIntegerOption(option => option.setName('page').setDescription('The page number')),          .addStringOption(option =>
106                option
107                .setName('order')
108                .setDescription('Order style of the list (according to the role positions)')
109                .setChoices({
110                    name: "Ascending",
111                    value: "a"
112                }, {
113                    name: "Descending",
114                    value: "d"
115                })
116            ),
117    
118      // AUTOMATION      // AUTOMATION
119      new SlashCommandBuilder().setName('ballot').setDescription('Ballot engine')      new SlashCommandBuilder().setName('ballot').setDescription('Ballot engine')
# Line 96  let commands = [ Line 128  let commands = [
128              subcommand              subcommand
129                  .setName('view')                  .setName('view')
130                  .setDescription('Get information/stats about a ballot')                  .setDescription('Get information/stats about a ballot')
131                  .addIntegerOption(option => option.setName('id').setDescription('The ballot ID'))),                  .addStringOption(option => option.setName('id').setDescription('The ballot ID'))),
132                    
133      new SlashCommandBuilder().setName('embed').setDescription('Make an embed')      new SlashCommandBuilder().setName('embed').setDescription('Make an embed')
134          .addSubcommand(subcmd =>          .addSubcommand(subcmd =>
# Line 296  let commands = [ Line 328  let commands = [
328    
329      new SlashCommandBuilder().setName('shot').setDescription('Give a shot to a member')      new SlashCommandBuilder().setName('shot').setDescription('Give a shot to a member')
330          .addUserOption(option => option.setName('member').setDescription("The member").setRequired(true))          .addUserOption(option => option.setName('member').setDescription("The member").setRequired(true))
331          .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"))
332            .addBooleanOption(option => option.setName('anonymous').setDescription("Prevents sending your name as the 'Doctor' of the shot")),
333    
334      new SlashCommandBuilder().setName('warn').setDescription('Warn a member')      new SlashCommandBuilder().setName('warn').setDescription('Warn a member')
335          .addUserOption(option => option.setName('member').setDescription("The member").setRequired(true))          .addUserOption(option => option.setName('member').setDescription("The member").setRequired(true))
# Line 320  let commands = [ Line 353  let commands = [
353    
354      new SlashCommandBuilder().setName('warning').setDescription('Clear, remove or view warnings')      new SlashCommandBuilder().setName('warning').setDescription('Clear, remove or view warnings')
355          .addSubcommand(subcmd => {          .addSubcommand(subcmd => {
356              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));
357          })          })
358          .addSubcommand(subcmd => {          .addSubcommand(subcmd => {
359              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));
360          })          })
361          .addSubcommand(subcmd => {          .addSubcommand(subcmd => {
362              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.290  
changed lines
  Added in v.466

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26