mirror of
https://github.com/arthur-pbty/selfbot-discord.git
synced 2026-06-20 13:50:47 +02:00
add base commands
This commit is contained in:
@@ -0,0 +1,58 @@
|
|||||||
|
import { Message } from "discord.js";
|
||||||
|
|
||||||
|
interface Command {
|
||||||
|
name: string;
|
||||||
|
aliases?: string[];
|
||||||
|
description: string;
|
||||||
|
emote?: string;
|
||||||
|
utilisation?: string;
|
||||||
|
category?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
aliases: ['h', 'aide'],
|
||||||
|
description: 'Affiche la liste des commandes',
|
||||||
|
emote: '📚',
|
||||||
|
utilisation: '<commande>',
|
||||||
|
|
||||||
|
async execute(message: Message, args: string[], client: any) {
|
||||||
|
const prefix = '!!'
|
||||||
|
|
||||||
|
if (args[0]) {
|
||||||
|
const command = client.commands.get(args[0]);
|
||||||
|
if (!command) {
|
||||||
|
return message.edit(`Je n'ai pas trouvé de commande nommée "${args[0]}".`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return message.edit(`# Aide pour la commande ${command.emote ? ` ${command.emote}` : '🔧'} ${command.name}\nUtilisation : \`${prefix}${command.name}${command.utilisation ? ` ${command.utilisation}` : ''}\`\nCatégorie : ${command.category || 'Non spécifiée'}\nAlias : ${command.aliases ? command.aliases.map((alias: string) => `\`${alias}\``).join(', ') : 'Aucun'}`);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
let commands: Command[] = [];
|
||||||
|
for (const command of client.commands?.values() || []) {
|
||||||
|
const existingCommand = commands.find(cmd => cmd.name === command.name);
|
||||||
|
if (!existingCommand) {
|
||||||
|
commands.push(command);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let categories: { [key: string]: Command[] } = {};
|
||||||
|
commands.forEach((command: any) => {
|
||||||
|
if (!categories[command.category]) {
|
||||||
|
categories[command.category] = [];
|
||||||
|
}
|
||||||
|
categories[command.category]?.push(command);
|
||||||
|
});
|
||||||
|
|
||||||
|
let description = `Pour obtenir de l'aide sur les commandes faite ${prefix}help <commande>.\n Il y a ${commands.length} commandes disponibles\n\n`;
|
||||||
|
|
||||||
|
for (const [category, commands] of Object.entries(categories)) {
|
||||||
|
description += `**Catégorie ${category}**\n`;
|
||||||
|
description += commands.length > 0 ? '> ' + commands.map(command => `\`${command.name}\``).join(', ') : '> Aucune commande dans cette catégorie';
|
||||||
|
description += '\n\n';
|
||||||
|
}
|
||||||
|
|
||||||
|
message.edit(`# 📚 Information\n${description}`)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
+3
-4
@@ -1,13 +1,12 @@
|
|||||||
const { ButtonStyle, ButtonBuilder, ActionRowBuilder } = require('discord.js');
|
import { Message, Client } from 'discord.js';
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
aliases: ['latence'],
|
aliases: ['latence'],
|
||||||
description: 'Avoir la latence du bot.',
|
description: 'Avoir la latence du bot.',
|
||||||
emote: '⏱️',
|
emote: '⏱️',
|
||||||
utilisation: '',
|
utilisation: '',
|
||||||
permission: 0,
|
|
||||||
|
|
||||||
async execute(message: any, args: string[], client: any) {
|
async execute(message: Message, args: string[], client: Client) {
|
||||||
message.reply("pong");
|
message.edit(`Pong! ${client.ws.ping}ms`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -14,9 +14,11 @@ module.exports = {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
command.execute(message, args, client);
|
command.execute(message, args, client);
|
||||||
|
setTimeout(() => {
|
||||||
|
if (message.deletable) message.delete();
|
||||||
|
}, 300000);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
message.edit("Erreur lors de l'exécution de la commande");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
const { Collection } = require('discord.js')
|
import { Collection } from 'discord.js';
|
||||||
const { Client } = require('discord.js-selfbot-v13');
|
const { Client } = require('discord.js-selfbot-v13');
|
||||||
|
|
||||||
const loadEvents = require("./loadEvents");
|
const loadEvents = require("./loadEvents");
|
||||||
|
|||||||
Reference in New Issue
Block a user