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'); |
42 |
new SlashCommandBuilder().setName('help').setDescription('A short documentation about the commands') |
new SlashCommandBuilder().setName('help').setDescription('A short documentation about the commands') |
43 |
.addStringOption(option => option.setName('command').setDescription("The command")), |
.addStringOption(option => option.setName('command').setDescription("The command")), |
44 |
new SlashCommandBuilder().setName('about').setDescription('Show information about the bot'), |
new SlashCommandBuilder().setName('about').setDescription('Show information about the bot'), |
45 |
|
new SlashCommandBuilder().setName('eval').setDescription('Execute raw code in the runtime environment') |
46 |
|
.addStringOption(option => option.setName('code').setDescription('The code to be executed').setRequired(true)), |
47 |
new SlashCommandBuilder().setName('system').setDescription('Show the system status'), |
new SlashCommandBuilder().setName('system').setDescription('Show the system status'), |
48 |
new SlashCommandBuilder().setName('restart').setDescription('Restart the system'), |
new SlashCommandBuilder().setName('restart').setDescription('Restart the system'), |
49 |
new SlashCommandBuilder().setName('setstatus').setDescription('Set status for the bot system') |
new SlashCommandBuilder().setName('setstatus').setDescription('Set status for the bot system') |
81 |
} |
} |
82 |
])), |
])), |
83 |
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') |
84 |
.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)) |
85 |
.addStringOption(option => option.setName('value').setDescription('New value for the setting')), |
.addStringOption(option => option.setName('value').setDescription('New value for the setting')), |
86 |
|
|
87 |
// INFORMATION |
// INFORMATION |
88 |
new SlashCommandBuilder().setName('stats').setDescription('Show the server statistics'), |
new SlashCommandBuilder().setName('stats').setDescription('Show the server statistics'), |
89 |
|
new SlashCommandBuilder().setName('lookup').setDescription('Lookup something') |
90 |
|
.addSubcommand(subcommand => subcommand.setName("user").setDescription("User lookup") |
91 |
|
.addUserOption(option => option.setName("user").setDescription("The user to search").setRequired(true)) |
92 |
|
) |
93 |
|
.addSubcommand(subcommand => subcommand.setName("guild").setDescription("Server/Guild lookup") |
94 |
|
.addStringOption(option => option.setName("guild_id").setDescription("The ID of the server/guild to lookup").setRequired(true)) |
95 |
|
) |
96 |
|
.addSubcommand(subcommand => subcommand.setName("avatar").setDescription("Avatar lookup using Google Image Search") |
97 |
|
.addUserOption(option => option.setName("user").setDescription("The user to lookup").setRequired(true)) |
98 |
|
), |
99 |
|
|
100 |
new SlashCommandBuilder().setName('profile').setDescription('Show someone\'s profile') |
new SlashCommandBuilder().setName('profile').setDescription('Show someone\'s profile') |
101 |
.addUserOption(option => option.setName('user').setDescription('The user')), |
.addUserOption(option => option.setName('user').setDescription('The user')), |
102 |
new SlashCommandBuilder().setName('avatar').setDescription('Show someone\'s avatar') |
new SlashCommandBuilder().setName('avatar').setDescription('Show someone\'s avatar') |
118 |
subcommand |
subcommand |
119 |
.setName('view') |
.setName('view') |
120 |
.setDescription('Get information/stats about a ballot') |
.setDescription('Get information/stats about a ballot') |
121 |
.addIntegerOption(option => option.setName('id').setDescription('The ballot ID'))), |
.addStringOption(option => option.setName('id').setDescription('The ballot ID'))), |
122 |
|
|
123 |
new SlashCommandBuilder().setName('embed').setDescription('Make an embed') |
new SlashCommandBuilder().setName('embed').setDescription('Make an embed') |
124 |
.addSubcommand(subcmd => |
.addSubcommand(subcmd => |
318 |
|
|
319 |
new SlashCommandBuilder().setName('shot').setDescription('Give a shot to a member') |
new SlashCommandBuilder().setName('shot').setDescription('Give a shot to a member') |
320 |
.addUserOption(option => option.setName('member').setDescription("The member").setRequired(true)) |
.addUserOption(option => option.setName('member').setDescription("The member").setRequired(true)) |
321 |
.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")) |
322 |
|
.addBooleanOption(option => option.setName('anonymous').setDescription("Prevents sending your name as the 'Doctor' of the shot")), |
323 |
|
|
324 |
new SlashCommandBuilder().setName('warn').setDescription('Warn a member') |
new SlashCommandBuilder().setName('warn').setDescription('Warn a member') |
325 |
.addUserOption(option => option.setName('member').setDescription("The member").setRequired(true)) |
.addUserOption(option => option.setName('member').setDescription("The member").setRequired(true)) |
343 |
|
|
344 |
new SlashCommandBuilder().setName('warning').setDescription('Clear, remove or view warnings') |
new SlashCommandBuilder().setName('warning').setDescription('Clear, remove or view warnings') |
345 |
.addSubcommand(subcmd => { |
.addSubcommand(subcmd => { |
346 |
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)); |
347 |
}) |
}) |
348 |
.addSubcommand(subcmd => { |
.addSubcommand(subcmd => { |
349 |
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)); |
350 |
}) |
}) |
351 |
.addSubcommand(subcmd => { |
.addSubcommand(subcmd => { |
352 |
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)); |