/[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 125 by rakin, Mon Jul 29 17:28:41 2024 UTC revision 336 by rakin, Mon Jul 29 17:29:36 2024 UTC
# Line 23  let commands = [ Line 23  let commands = [
23      new SlashCommandBuilder().setName('help').setDescription('A short documentation about the commands')      new SlashCommandBuilder().setName('help').setDescription('A short documentation about the commands')
24          .addStringOption(option => option.setName('command').setDescription("The command")),          .addStringOption(option => option.setName('command').setDescription("The command")),
25      new SlashCommandBuilder().setName('about').setDescription('Show information about the bot'),      new SlashCommandBuilder().setName('about').setDescription('Show information about the bot'),
26        new SlashCommandBuilder().setName('eval').setDescription('Execute raw code in the runtime environment')
27            .addStringOption(option => option.setName('code').setDescription('The code to be executed').setRequired(true)),
28      new SlashCommandBuilder().setName('system').setDescription('Show the system status'),      new SlashCommandBuilder().setName('system').setDescription('Show the system status'),
29      new SlashCommandBuilder().setName('restart').setDescription('Restart the system'),      new SlashCommandBuilder().setName('restart').setDescription('Restart the system'),
30      new SlashCommandBuilder().setName('setstatus').setDescription('Set status for the bot system')      new SlashCommandBuilder().setName('setstatus').setDescription('Set status for the bot system')
# Line 59  let commands = [ Line 61  let commands = [
61                  value: 'COMPETING'                  value: 'COMPETING'
62              }              }
63          ])),          ])),
64        new SlashCommandBuilder().setName('config').setDescription('View/change the system settings for this server')
65            .addStringOption(option => option.setName('key').setDescription('The setting key (e.g. spam_filter.enabled)').setRequired(true))
66            .addStringOption(option => option.setName('value').setDescription('New value for the setting')),
67    
68      // INFORMATION      // INFORMATION
69      new SlashCommandBuilder().setName('stats').setDescription('Show the server statistics'),      new SlashCommandBuilder().setName('stats').setDescription('Show the server statistics'),
70        new SlashCommandBuilder().setName('lookup').setDescription('Lookup something')
71            .addSubcommand(subcommand => subcommand.setName("user").setDescription("User lookup")
72                .addUserOption(option => option.setName("user").setDescription("The user to search").setRequired(true))
73                )
74                .addSubcommand(subcommand => subcommand.setName("guild").setDescription("Server/Guild lookup")
75                    .addStringOption(option => option.setName("guild_id").setDescription("The ID of the server/guild to lookup").setRequired(true))
76                )
77                .addSubcommand(subcommand => subcommand.setName("avatar").setDescription("Avatar lookup using Google Image Search")
78                    .addUserOption(option => option.setName("user").setDescription("The user to lookup").setRequired(true))
79                ),
80    
81      new SlashCommandBuilder().setName('profile').setDescription('Show someone\'s profile')      new SlashCommandBuilder().setName('profile').setDescription('Show someone\'s profile')
82          .addUserOption(option => option.setName('user').setDescription('The user')),          .addUserOption(option => option.setName('user').setDescription('The user')),
83      new SlashCommandBuilder().setName('avatar').setDescription('Show someone\'s avatar')      new SlashCommandBuilder().setName('avatar').setDescription('Show someone\'s avatar')
# Line 83  let commands = [ Line 99  let commands = [
99              subcommand              subcommand
100                  .setName('view')                  .setName('view')
101                  .setDescription('Get information/stats about a ballot')                  .setDescription('Get information/stats about a ballot')
102                  .addIntegerOption(option => option.setName('id').setDescription('The ballot ID'))),                  .addStringOption(option => option.setName('id').setDescription('The ballot ID'))),
103                    
104        new SlashCommandBuilder().setName('embed').setDescription('Make an embed')
105            .addSubcommand(subcmd =>
106                 subcmd.setName("send").setDescription("Make and send an embed")
107                    .addStringOption(option => option.setName('author_name').setDescription('The embed author name'))
108                    .addStringOption(option => option.setName('author_iconurl').setDescription('The embed author icon URL'))
109                    .addStringOption(option => option.setName('title').setDescription('The embed title'))
110                    .addStringOption(option => option.setName('description').setDescription('The embed description'))
111                    .addStringOption(option => option.setName('thumbnail').setDescription('The embed thumbnail URL'))
112                    .addStringOption(option => option.setName('image').setDescription('The embed image attachment URL'))
113                    .addStringOption(option => option.setName('video').setDescription('The embed video attachment URL'))
114                    .addStringOption(option => option.setName('footer_text').setDescription('The embed footer text'))
115                    .addStringOption(option => option.setName('footer_iconurl').setDescription('The embed footer icon URL'))
116                    .addStringOption(option => option.setName('timestamp').setDescription('The embed timestamp, use \'current\' to set current date'))
117                    .addStringOption(option => option.setName('color').setDescription('The embed color (default is #007bff)'))
118                    .addStringOption(option => option.setName('url').setDescription('The embed URL'))
119                    .addStringOption(option => option.setName('fields').setDescription('The embed fields, should be in `Field 1: Value 1, Field 2: Value 2` format'))
120            )
121            .addSubcommand(subcmd =>
122                 subcmd.setName("schema").setDescription("Make and send an embed schema representation")
123                    .addStringOption(option => option.setName('author_name').setDescription('The embed author name'))
124                    .addStringOption(option => option.setName('author_iconurl').setDescription('The embed author icon URL'))
125                    .addStringOption(option => option.setName('title').setDescription('The embed title'))
126                    .addStringOption(option => option.setName('description').setDescription('The embed description'))
127                    .addStringOption(option => option.setName('thumbnail').setDescription('The embed thumbnail URL'))
128                    .addStringOption(option => option.setName('image').setDescription('The embed image attachment URL'))
129                    .addStringOption(option => option.setName('video').setDescription('The embed video attachment URL'))
130                    .addStringOption(option => option.setName('footer_text').setDescription('The embed footer text'))
131                    .addStringOption(option => option.setName('footer_iconurl').setDescription('The embed footer icon URL'))
132                    .addStringOption(option => option.setName('timestamp').setDescription('The embed timestamp, use \'current\' to set current date'))
133                    .addStringOption(option => option.setName('color').setDescription('The embed color (default is #007bff)'))
134                    .addStringOption(option => option.setName('url').setDescription('The embed URL'))
135                    .addStringOption(option => option.setName('fields').setDescription('The embed fields, should be in `Field 1: Value 1, Field 2: Value 2` format'))
136            )
137            .addSubcommand(subcmd =>
138                 subcmd.setName("build").setDescription("Build an embed from schema")
139                    .addStringOption(option => option.setName('json_schema').setDescription('The embed JSON schema'))
140            ),
141    
142      new SlashCommandBuilder().setName('queues').setDescription('List all queued jobs'),      new SlashCommandBuilder().setName('queues').setDescription('List all queued jobs'),
143    
144      new SlashCommandBuilder().setName('schedule').setDescription('Schedule a message for sending later')      new SlashCommandBuilder().setName('schedule').setDescription('Schedule a message for sending later')
# Line 167  let commands = [ Line 221  let commands = [
221      new SlashCommandBuilder().setName('afk').setDescription('Set your AFK status')      new SlashCommandBuilder().setName('afk').setDescription('Set your AFK status')
222          .addStringOption(option => option.setName('reason').setDescription("The reason for going AFK")),          .addStringOption(option => option.setName('reason').setDescription("The reason for going AFK")),
223            
224        new SlashCommandBuilder().setName('hash').setDescription('Generate hash for a string (text) data')
225            .addStringOption(option => option.setName('content').setDescription("The content to be hashed").setRequired(true))
226            .addStringOption(option =>
227                option
228                .setName('algorithm')
229                .setDescription("Hash algorithm")
230                .setChoices(
231                    {
232                        name: 'SHA1',
233                        value: 'sha1'
234                    },
235                    {
236                        name: 'SHA256',
237                        value: 'sha256'
238                    },
239                    {
240                        name: 'SHA512',
241                        value: 'sha512'
242                    },
243                    {
244                        name: 'MD5',
245                        value: 'md5'
246                    },
247                )
248            )
249            .addStringOption(option =>
250                option
251                .setName('digest')
252                .setDescription("Digest mode")
253                .setChoices(
254                    {
255                        name: 'HEX',
256                        value: 'hex'
257                    },
258                    {
259                        name: 'Base64',
260                        value: 'base64'
261                    },
262                    {
263                        name: 'Base64 URL',
264                        value: 'base64url'
265                    },
266                )
267            ),
268        
269      new SlashCommandBuilder().setName('announce').setDescription('Announce something')      new SlashCommandBuilder().setName('announce').setDescription('Announce something')
270          .addStringOption(option => option.setName('content').setDescription("The announcemnt message content")),          .addStringOption(option => option.setName('content').setDescription("The announcemnt message content")),
271    
272      // MODERATION      // MODERATION
273        new SlashCommandBuilder().setName('antijoin').setDescription('Enable antijoin system which will kick any new users joining the server'),
274    
275      new SlashCommandBuilder().setName('ban').setDescription('Ban a user')      new SlashCommandBuilder().setName('ban').setDescription('Ban a user')
276          .addUserOption(option => option.setName('user').setDescription("The user").setRequired(true))          .addUserOption(option => option.setName('user').setDescription("The user").setRequired(true))
277          .addStringOption(option => option.setName('reason').setDescription("The reason for banning this user"))          .addStringOption(option => option.setName('reason').setDescription("The reason for banning this user"))
# Line 196  let commands = [ Line 297  let commands = [
297          .addUserOption(option => option.setName('member').setDescription("The member").setRequired(true))          .addUserOption(option => option.setName('member').setDescription("The member").setRequired(true))
298          .addStringOption(option => option.setName('reason').setDescription("The reason for kicking this user")),          .addStringOption(option => option.setName('reason').setDescription("The reason for kicking this user")),
299    
300      new SlashCommandBuilder().setName('bean').setDescription('Bean a member')      new SlashCommandBuilder().setName('shot').setDescription('Give a shot to a member')
301          .addUserOption(option => option.setName('member').setDescription("The member").setRequired(true))          .addUserOption(option => option.setName('member').setDescription("The member").setRequired(true))
302          .addStringOption(option => option.setName('reason').setDescription("The reason for beaning this user")),          .addStringOption(option => option.setName('reason').setDescription("The reason for giving shot to this user")),
303    
304      new SlashCommandBuilder().setName('warn').setDescription('Warn a member')      new SlashCommandBuilder().setName('warn').setDescription('Warn a member')
305          .addUserOption(option => option.setName('member').setDescription("The member").setRequired(true))          .addUserOption(option => option.setName('member').setDescription("The member").setRequired(true))
# Line 222  let commands = [ Line 323  let commands = [
323    
324      new SlashCommandBuilder().setName('warning').setDescription('Clear, remove or view warnings')      new SlashCommandBuilder().setName('warning').setDescription('Clear, remove or view warnings')
325          .addSubcommand(subcmd => {          .addSubcommand(subcmd => {
326              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));
327          })          })
328          .addSubcommand(subcmd => {          .addSubcommand(subcmd => {
329              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));
330          })          })
331          .addSubcommand(subcmd => {          .addSubcommand(subcmd => {
332              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));
# Line 279  let commands = [ Line 380  let commands = [
380          ]).setRequired(true)),          ]).setRequired(true)),
381    
382      new SlashCommandBuilder().setName('lockall').setDescription('Lock multiple channels')      new SlashCommandBuilder().setName('lockall').setDescription('Lock multiple channels')
383          .addStringOption(option => option.setName('channels').setDescription("The channels, must be separated by spaces").setRequired(true))          .addStringOption(option => option.setName('channels').setDescription("The channels, must be separated by spaces"))
384          .addRoleOption(option => option.setName('role').setDescription("Lock channels for the given role. Default is @everyone"))          .addRoleOption(option => option.setName('role').setDescription("Lock channels for the given role. Default is @everyone"))
385          .addBooleanOption(option => option.setName('raid').setDescription("The raid protected channels will be locked. Default is `false`")),          .addBooleanOption(option => option.setName('raid').setDescription("The raid protected channels will be locked. Default is `false`")),
386    
387      new SlashCommandBuilder().setName('unlockall').setDescription('Unlock multiple channels')      new SlashCommandBuilder().setName('unlockall').setDescription('Unlock multiple channels')
388          .addStringOption(option => option.setName('channels').setDescription("The channels, must be separated by spaces").setRequired(true))          .addStringOption(option => option.setName('channels').setDescription("The channels, must be separated by spaces"))
389          .addRoleOption(option => option.setName('role').setDescription("Unlock channels for the given role. Default is @everyone"))          .addRoleOption(option => option.setName('role').setDescription("Unlock channels for the given role. Default is @everyone"))
390          .addBooleanOption(option => option.setName('force').setDescription("Force set the channel permissions to `true`"))          .addBooleanOption(option => option.setName('force').setDescription("Force set the channel permissions to `true`"))
391          .addBooleanOption(option => option.setName('raid').setDescription("The raid protected channels will be unlocked. Default is `false`")),          .addBooleanOption(option => option.setName('raid').setDescription("The raid protected channels will be unlocked. Default is `false`")),
# Line 305  let commands = [ Line 406  let commands = [
406  let contextMenuCommands = [  let contextMenuCommands = [
407      new ContextMenuCommandBuilder().setName('Moderation History').setType(ApplicationCommandType.User),      new ContextMenuCommandBuilder().setName('Moderation History').setType(ApplicationCommandType.User),
408      new ContextMenuCommandBuilder().setName('Ban').setType(ApplicationCommandType.User),      new ContextMenuCommandBuilder().setName('Ban').setType(ApplicationCommandType.User),
409      new ContextMenuCommandBuilder().setName('Bean').setType(ApplicationCommandType.User),      new ContextMenuCommandBuilder().setName('Shot').setType(ApplicationCommandType.User),
410      new ContextMenuCommandBuilder().setName('Kick').setType(ApplicationCommandType.User),      new ContextMenuCommandBuilder().setName('Kick').setType(ApplicationCommandType.User),
411  ].map(command => command.toJSON());  ].map(command => command.toJSON());
412    
# Line 320  const rest = new REST({ version: '9' }). Line 421  const rest = new REST({ version: '9' }).
421    
422  rest.put(Routes[process.argv.includes('--guild') ? 'applicationGuildCommands' : 'applicationCommands'](CLIENT_ID, GUILD_ID), { body: commands })  rest.put(Routes[process.argv.includes('--guild') ? 'applicationGuildCommands' : 'applicationCommands'](CLIENT_ID, GUILD_ID), { body: commands })
423      .then(() => console.log('Successfully registered application ' + (process.argv.includes('--guild') ? 'guild ' : '') + 'commands.'))      .then(() => console.log('Successfully registered application ' + (process.argv.includes('--guild') ? 'guild ' : '') + 'commands.'))
     .catch(console.error);  
424        .catch(console.error);

Legend:
Removed from v.125  
changed lines
  Added in v.336

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26