mirror of https://github.com/kry008/Bot-2.0.git
Undo some change
parent
74ca98e6dc
commit
192cd1d2c5
|
@ -2,14 +2,6 @@ module.exports = {
|
||||||
name: 'argumentstest',
|
name: 'argumentstest',
|
||||||
description: 'Test command for args',
|
description: 'Test command for args',
|
||||||
help: 'This command is used to test the arguments of a command',
|
help: 'This command is used to test the arguments of a command',
|
||||||
arguments: [
|
|
||||||
{
|
|
||||||
name: 'ANY',
|
|
||||||
type: 'ANY',
|
|
||||||
description: 'Any type of argument',
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
name: 'type3',
|
name: 'type3',
|
||||||
|
|
|
@ -2,14 +2,6 @@ module.exports = {
|
||||||
name: 'ban',
|
name: 'ban',
|
||||||
description: 'Bans a user from the server',
|
description: 'Bans a user from the server',
|
||||||
help: 'This command is used to ban a user from the server. Requires the user to have the "Ban Members" permission. Requires the bot to have the "Ban Members" permission.',
|
help: 'This command is used to ban a user from the server. Requires the user to have the "Ban Members" permission. Requires the bot to have the "Ban Members" permission.',
|
||||||
arguments: [
|
|
||||||
{
|
|
||||||
name: 'user',
|
|
||||||
type: 'USER',
|
|
||||||
description: 'The user to ban',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
name: 'user',
|
name: 'user',
|
||||||
|
|
|
@ -8,7 +8,6 @@ module.exports = {
|
||||||
name: 'cat',
|
name: 'cat',
|
||||||
description: 'Get a random cat picture',
|
description: 'Get a random cat picture',
|
||||||
help: 'Get a random cat picture',
|
help: 'Get a random cat picture',
|
||||||
arguments: [],
|
|
||||||
options: [],
|
options: [],
|
||||||
slash: true,
|
slash: true,
|
||||||
text: true,
|
text: true,
|
||||||
|
|
|
@ -8,7 +8,6 @@ module.exports = {
|
||||||
name: 'catfact',
|
name: 'catfact',
|
||||||
description: 'Get a random cat fact',
|
description: 'Get a random cat fact',
|
||||||
help: 'Get a random cat fact',
|
help: 'Get a random cat fact',
|
||||||
arguments: [],
|
|
||||||
options: [],
|
options: [],
|
||||||
slash: true,
|
slash: true,
|
||||||
text: true,
|
text: true,
|
||||||
|
|
|
@ -8,7 +8,6 @@ module.exports = {
|
||||||
name: 'chuck',
|
name: 'chuck',
|
||||||
description: 'Get a random Chuck Norris joke',
|
description: 'Get a random Chuck Norris joke',
|
||||||
help: 'Get a random Chuck Norris joke',
|
help: 'Get a random Chuck Norris joke',
|
||||||
arguments: [],
|
|
||||||
options: [],
|
options: [],
|
||||||
slash: true,
|
slash: true,
|
||||||
text: true,
|
text: true,
|
||||||
|
|
|
@ -49,26 +49,6 @@ module.exports = {
|
||||||
name: 'colorrgb',
|
name: 'colorrgb',
|
||||||
description: 'converts a RGB color to HEX, HSL, and CMYK',
|
description: 'converts a RGB color to HEX, HSL, and CMYK',
|
||||||
help: 'This command converts a RGB color to HEX, HSL, and CMYK',
|
help: 'This command converts a RGB color to HEX, HSL, and CMYK',
|
||||||
arguments: [
|
|
||||||
{
|
|
||||||
name: 'r',
|
|
||||||
type: 'INTEGER',
|
|
||||||
description: 'The red value (0-255)',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'g',
|
|
||||||
type: 'INTEGER',
|
|
||||||
description: 'The green value (0-255)',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'b',
|
|
||||||
type: 'INTEGER',
|
|
||||||
description: 'The blue value (0-255)',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
slash: true,
|
slash: true,
|
||||||
text: true,
|
text: true,
|
||||||
admin: false,
|
admin: false,
|
||||||
|
|
|
@ -4,14 +4,6 @@ module.exports = {
|
||||||
name: 'dns',
|
name: 'dns',
|
||||||
description: 'Look what is the IP of a domain. Requires a domain as argument.',
|
description: 'Look what is the IP of a domain. Requires a domain as argument.',
|
||||||
help: 'Look what is the IP of a domain. Requires a domain as argument.',
|
help: 'Look what is the IP of a domain. Requires a domain as argument.',
|
||||||
arguments: [
|
|
||||||
{
|
|
||||||
name: 'domain',
|
|
||||||
type: 'STRING',
|
|
||||||
description: 'The domain to look up',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
name: 'domain',
|
name: 'domain',
|
||||||
|
|
|
@ -8,7 +8,6 @@ module.exports = {
|
||||||
name: 'dog',
|
name: 'dog',
|
||||||
description: 'Get a random dog picture',
|
description: 'Get a random dog picture',
|
||||||
help: 'Get a random dog picture',
|
help: 'Get a random dog picture',
|
||||||
arguments: [],
|
|
||||||
options: [],
|
options: [],
|
||||||
slash: true,
|
slash: true,
|
||||||
text: true,
|
text: true,
|
||||||
|
|
|
@ -8,7 +8,6 @@ module.exports = {
|
||||||
name: 'fox',
|
name: 'fox',
|
||||||
description: 'Get a random fox picture',
|
description: 'Get a random fox picture',
|
||||||
help: 'Get a random fox picture',
|
help: 'Get a random fox picture',
|
||||||
arguments: [],
|
|
||||||
options: [],
|
options: [],
|
||||||
slash: true,
|
slash: true,
|
||||||
text: true,
|
text: true,
|
||||||
|
|
|
@ -8,14 +8,6 @@ module.exports = {
|
||||||
name: 'guessnumber',
|
name: 'guessnumber',
|
||||||
description: 'Guess a number between 1 and 100',
|
description: 'Guess a number between 1 and 100',
|
||||||
help: 'Guess a number between 1 and 100',
|
help: 'Guess a number between 1 and 100',
|
||||||
arguments: [
|
|
||||||
{
|
|
||||||
name: 'number',
|
|
||||||
type: 'INTEGER',
|
|
||||||
description: 'Your guess',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
name: 'number',
|
name: 'number',
|
||||||
|
|
106
commands/help.js
106
commands/help.js
|
@ -1 +1,107 @@
|
||||||
//optiona name of the command
|
//optiona name of the command
|
||||||
|
var fs = require('fs');
|
||||||
|
function getAllCommands(client) {
|
||||||
|
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
|
||||||
|
const allCommands = [];
|
||||||
|
for (const file of commandFiles) {
|
||||||
|
const command = require(`./${file}`);
|
||||||
|
allCommands.push(command);
|
||||||
|
}
|
||||||
|
return allCommands;
|
||||||
|
}
|
||||||
|
function allCommandsNames(guild = true)
|
||||||
|
{
|
||||||
|
//check if it is in dm or guild
|
||||||
|
if(guild)
|
||||||
|
{
|
||||||
|
const commands = getAllCommands();
|
||||||
|
let str = '';
|
||||||
|
for(const command of commands)
|
||||||
|
{
|
||||||
|
if(command.admin === false)
|
||||||
|
str += command.name + '\n';
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const commands = getAllCommands();
|
||||||
|
let str = '';
|
||||||
|
for(const command of commands)
|
||||||
|
{
|
||||||
|
if(command.canBeUsedInDm)
|
||||||
|
if(command.admin === false)
|
||||||
|
str += command.name + '\n';
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getCommand(name, guild = true)
|
||||||
|
{
|
||||||
|
//check if it is in dm or guild
|
||||||
|
if(guild)
|
||||||
|
{
|
||||||
|
const commands = getAllCommands();
|
||||||
|
for(const command of commands)
|
||||||
|
{
|
||||||
|
if(command.name === name)
|
||||||
|
return command;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const commands = getAllCommands();
|
||||||
|
for(const command of commands)
|
||||||
|
{
|
||||||
|
if(command.name === name && command.canBeUsedInDm)
|
||||||
|
return command;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
module.exports = {
|
||||||
|
name: 'help',
|
||||||
|
description: 'Get a list of all commands or information about a specific command',
|
||||||
|
help: 'Get a list of all commands or information about a specific command',
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
name: 'command',
|
||||||
|
description: 'Command to get information about',
|
||||||
|
type: 3,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
slash: true,
|
||||||
|
text: true,
|
||||||
|
admin: false,
|
||||||
|
requireKick: false,
|
||||||
|
premium: false,
|
||||||
|
requireBan: false,
|
||||||
|
canBeUsedInDm: true,
|
||||||
|
contexts: ['GUILD_TEXT', 'GUID_VOICE', 'DM'],
|
||||||
|
integration_types: [0,1],
|
||||||
|
execute: async (message, args) => {
|
||||||
|
if(args.length === 0)
|
||||||
|
{
|
||||||
|
const commands = allCommandsNames();
|
||||||
|
message.channel.send(commands);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const command = getCommand(args[0]);
|
||||||
|
if(command === null)
|
||||||
|
{
|
||||||
|
message.channel.send('Command not found');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
message.channel.send('Name: ' + command.name + '\nDescription: ' + command.description + '\nHelp: ' + command.help);
|
||||||
|
},
|
||||||
|
executeSlash: async interaction => {
|
||||||
|
const command = getCommand(interaction.options.getString('command'));
|
||||||
|
if(command === null)
|
||||||
|
{
|
||||||
|
interaction.reply('Command not found');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
interaction.reply('Name: ' + command.name + '\nDescription: ' + command.description + '\nHelp: ' + command.help);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
|
@ -2,20 +2,6 @@ module.exports = {
|
||||||
name: 'kick',
|
name: 'kick',
|
||||||
description: 'Kicks a user from the server',
|
description: 'Kicks a user from the server',
|
||||||
help: 'Kicks a user from the server with a reason if provided. Requires the user to have the "Kick Members" permission. Requires the bot to have the "Kick Members" permission.',
|
help: 'Kicks a user from the server with a reason if provided. Requires the user to have the "Kick Members" permission. Requires the bot to have the "Kick Members" permission.',
|
||||||
arguments: [
|
|
||||||
{
|
|
||||||
name: 'user',
|
|
||||||
type: 'USER',
|
|
||||||
description: 'The user to kick',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'reason',
|
|
||||||
type: 'STRING',
|
|
||||||
description: 'The reason for the kick',
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
name: 'user',
|
name: 'user',
|
||||||
|
|
|
@ -71,20 +71,6 @@ module.exports = {
|
||||||
name: 'pokemon',
|
name: 'pokemon',
|
||||||
description: 'Get a random pokemon. **FUNCTION NOT FINISHED**',
|
description: 'Get a random pokemon. **FUNCTION NOT FINISHED**',
|
||||||
help: 'Get a random pokemon. **FUNCTION NOT FINISHED**',
|
help: 'Get a random pokemon. **FUNCTION NOT FINISHED**',
|
||||||
arguments: [
|
|
||||||
{
|
|
||||||
name: 'pokemonname',
|
|
||||||
type: 'STRING',
|
|
||||||
description: 'Name of the pokemon you want to get information about',
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'pokemonnumber',
|
|
||||||
type: 'INTEGER',
|
|
||||||
description: 'Number of the pokemon you want to get information about',
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
name: 'pokemonname',
|
name: 'pokemonname',
|
||||||
|
|
|
@ -2,14 +2,6 @@ module.exports = {
|
||||||
name: 'profilepicture',
|
name: 'profilepicture',
|
||||||
description: 'Get the profile picture of a user.',
|
description: 'Get the profile picture of a user.',
|
||||||
help: 'Get the profile picture of a user.',
|
help: 'Get the profile picture of a user.',
|
||||||
arguments: [
|
|
||||||
{
|
|
||||||
name: 'user',
|
|
||||||
type: 'User',
|
|
||||||
description: 'The user to get the profile picture',
|
|
||||||
required: false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
name: 'user',
|
name: 'user',
|
||||||
|
|
|
@ -2,14 +2,6 @@ module.exports = {
|
||||||
name: '',
|
name: '',
|
||||||
description: '',
|
description: '',
|
||||||
help: '',
|
help: '',
|
||||||
arguments: [
|
|
||||||
{
|
|
||||||
name: '',
|
|
||||||
description: '',
|
|
||||||
type: 3,
|
|
||||||
required: false,
|
|
||||||
}
|
|
||||||
],
|
|
||||||
options: [],
|
options: [],
|
||||||
slash: true,
|
slash: true,
|
||||||
text: true,
|
text: true,
|
||||||
|
|
|
@ -15,14 +15,6 @@ module.exports = {
|
||||||
name: 'waifu',
|
name: 'waifu',
|
||||||
description: 'Get a random waifu picture',
|
description: 'Get a random waifu picture',
|
||||||
help: 'Get a random waifu picture with the type you want',
|
help: 'Get a random waifu picture with the type you want',
|
||||||
arguments: [
|
|
||||||
{
|
|
||||||
name: 'type',
|
|
||||||
type: 'STRING',
|
|
||||||
description: 'The type of waifu picture you want',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
name: 'type',
|
name: 'type',
|
||||||
|
|
Loading…
Reference in New Issue