You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// تحميل الأوامر من مجلد commands
const commandFiles = fs.readdirSync("./commands").filter(file => file.endsWith(".js"));
for (const file of commandFiles) {
try {
const command = require(./commands/${file});
if (!command.data || !command.data.toJSON) {
console.warn(⚠️ تخطي الملف ${file}: لا يحتوي على 'data.toJSON()');
continue;
}
client.commands.set(command.data.name, command);
} catch (error) {
console.error(❌ خطأ في تحميل الأمر ${file}:, error);
}
}
client.once("ready", () => {
console.log(✅ Logged in as ${client.user.tag});
});
client.on("interactionCreate", async interaction => {
if (!interaction.isCommand()) return;
const command = client.commands.get(interaction.commandName);
if (!command) return;
try {
await command.execute(interaction);
} catch (error) {
console.error(❌ خطأ أثناء تنفيذ الأمر ${interaction.commandName}:, error);
await interaction.reply({ content: "❌ حدث خطأ أثناء تنفيذ الأمر!", ephemeral: true });
}
});
// تشغيل البوت باستخدام التوكن
client.login('MTMzOTYxMDIyODk5MTMzMjQyNg.GqU5oX.p43233MKLQyyYEXaQpkvgBUgKYhQzecx4a40No');
No description provided.
The text was updated successfully, but these errors were encountered: