Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A1 STORE #57134

Closed
blackrt0 opened this issue Feb 19, 2025 · 1 comment
Closed

A1 STORE #57134

blackrt0 opened this issue Feb 19, 2025 · 1 comment
Labels
invalid Issues and PRs that are invalid.

Comments

@blackrt0
Copy link

No description provided.

@blackrt0
Copy link
Author

const { Client, GatewayIntentBits, Collection } = require("discord.js");
const fs = require("fs");
require("dotenv").config(); // تحميل التوكن من .env إذا كان موجودًا

const token = process.env.BOT_TOKEN || "YOUR_BOT_TOKEN"; // استخدم التوكن من .env أو أدخله هنا مباشرة

const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent
],
});

client.commands = new Collection();

// تحميل الأوامر من مجلد 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');

@targos targos closed this as not planned Won't fix, can't repro, duplicate, stale Feb 19, 2025
@targos targos added the invalid Issues and PRs that are invalid. label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Issues and PRs that are invalid.
Projects
None yet
Development

No branches or pull requests

2 participants