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',
|
||||
description: 'Test command for args',
|
||||
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: [
|
||||
{
|
||||
name: 'type3',
|
||||
|
|
|
@ -2,14 +2,6 @@ module.exports = {
|
|||
name: 'ban',
|
||||
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.',
|
||||
arguments: [
|
||||
{
|
||||
name: 'user',
|
||||
type: 'USER',
|
||||
description: 'The user to ban',
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: 'user',
|
||||
|
|
|
@ -8,7 +8,6 @@ module.exports = {
|
|||
name: 'cat',
|
||||
description: 'Get a random cat picture',
|
||||
help: 'Get a random cat picture',
|
||||
arguments: [],
|
||||
options: [],
|
||||
slash: true,
|
||||
text: true,
|
||||
|
|
|
@ -8,7 +8,6 @@ module.exports = {
|
|||
name: 'catfact',
|
||||
description: 'Get a random cat fact',
|
||||
help: 'Get a random cat fact',
|
||||
arguments: [],
|
||||
options: [],
|
||||
slash: true,
|
||||
text: true,
|
||||
|
|
|
@ -8,7 +8,6 @@ module.exports = {
|
|||
name: 'chuck',
|
||||
description: 'Get a random Chuck Norris joke',
|
||||
help: 'Get a random Chuck Norris joke',
|
||||
arguments: [],
|
||||
options: [],
|
||||
slash: true,
|
||||
text: true,
|
||||
|
|
|
@ -49,26 +49,6 @@ module.exports = {
|
|||
name: 'colorrgb',
|
||||
description: '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,
|
||||
text: true,
|
||||
admin: false,
|
||||
|
|
|
@ -4,14 +4,6 @@ module.exports = {
|
|||
name: 'dns',
|
||||
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.',
|
||||
arguments: [
|
||||
{
|
||||
name: 'domain',
|
||||
type: 'STRING',
|
||||
description: 'The domain to look up',
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: 'domain',
|
||||
|
|
|
@ -8,7 +8,6 @@ module.exports = {
|
|||
name: 'dog',
|
||||
description: 'Get a random dog picture',
|
||||
help: 'Get a random dog picture',
|
||||
arguments: [],
|
||||
options: [],
|
||||
slash: true,
|
||||
text: true,
|
||||
|
|
|
@ -8,7 +8,6 @@ module.exports = {
|
|||
name: 'fox',
|
||||
description: 'Get a random fox picture',
|
||||
help: 'Get a random fox picture',
|
||||
arguments: [],
|
||||
options: [],
|
||||
slash: true,
|
||||
text: true,
|
||||
|
|
|
@ -8,14 +8,6 @@ module.exports = {
|
|||
name: 'guessnumber',
|
||||
description: '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: [
|
||||
{
|
||||
name: 'number',
|
||||
|
|
106
commands/help.js
106
commands/help.js
|
@ -1 +1,107 @@
|
|||
//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',
|
||||
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.',
|
||||
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: [
|
||||
{
|
||||
name: 'user',
|
||||
|
|
|
@ -71,20 +71,6 @@ module.exports = {
|
|||
name: 'pokemon',
|
||||
description: '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: [
|
||||
{
|
||||
name: 'pokemonname',
|
||||
|
|
|
@ -2,14 +2,6 @@ module.exports = {
|
|||
name: 'profilepicture',
|
||||
description: '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: [
|
||||
{
|
||||
name: 'user',
|
||||
|
|
|
@ -2,14 +2,6 @@ module.exports = {
|
|||
name: '',
|
||||
description: '',
|
||||
help: '',
|
||||
arguments: [
|
||||
{
|
||||
name: '',
|
||||
description: '',
|
||||
type: 3,
|
||||
required: false,
|
||||
}
|
||||
],
|
||||
options: [],
|
||||
slash: true,
|
||||
text: true,
|
||||
|
|
|
@ -15,14 +15,6 @@ module.exports = {
|
|||
name: 'waifu',
|
||||
description: 'Get a random waifu picture',
|
||||
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: [
|
||||
{
|
||||
name: 'type',
|
||||
|
|
Loading…
Reference in New Issue