mirror of
https://github.com/arthur-pbty/selfbot-discord.git
synced 2026-06-03 23:36:23 +02:00
29 lines
849 B
TypeScript
29 lines
849 B
TypeScript
import { Message, Events } from "discord.js";
|
|
const getPrefix = require("../fonctions/getPrefix");
|
|
import { Permissions } from "discord.js-selfbot-v13"
|
|
|
|
module.exports = {
|
|
name: Events.MessageCreate,
|
|
async execute(message: Message, client: any) {
|
|
if (!message.author.id === client.user.id) return;
|
|
|
|
const prefix = await getPrefix()
|
|
if (message.content.startsWith(prefix)) {
|
|
const args = message.content.slice(prefix.length).trim().split(/ +/);
|
|
const commandName = args.shift()?.toLowerCase();
|
|
|
|
const command = client.commands.get(commandName);
|
|
if (!command) return;
|
|
|
|
try {
|
|
command.execute(message, args, client);
|
|
setTimeout(() => {
|
|
if (message.deletable) message.delete();
|
|
}, 300000);
|
|
} catch (error) {
|
|
console.error(error);
|
|
}
|
|
|
|
}
|
|
}
|
|
}; |