| import discord |
| from discord.ext import commands |
| import os |
|
|
| |
| |
| intents = discord.Intents.all() |
| bot = commands.Bot(command_prefix='.', intents=intents) |
|
|
| |
| |
| TOKEN = os.environ.get("BOT_TOKEN") |
|
|
| |
| @bot.event |
| async def on_ready(): |
| print(f'--- Maden System Online ---') |
| print(f'Logged in as: {bot.user.name}') |
| print(f'ID: {bot.user.id}') |
| print(f'Discord.py Version: {discord.__version__}') |
| print(f'---------------------------') |
| |
| |
| await bot.change_presence(activity=discord.Game(name="Maden Delta Force")) |
|
|
| |
|
|
| |
| @bot.command() |
| async def ping(ctx): |
| latency = round(bot.latency * 1000) |
| await ctx.send(f'🏓 Pong! | السرعة: {latency}ms') |
|
|
| |
| @bot.command() |
| async def hello(ctx): |
| await ctx.send(f'أهلاً بك يا {ctx.author.mention}! أنا بوت Maden Delta Force، كيف يمكنني مساعدتك؟') |
|
|
| |
| @bot.command() |
| async def server(ctx): |
| name = str(ctx.guild.name) |
| memberCount = str(ctx.guild.member_count) |
| await ctx.send(f'اسم السيرفر: {name}\nعدد الأعضاء: {memberCount}') |
|
|
| |
| if TOKEN: |
| try: |
| bot.run(TOKEN) |
| except discord.errors.LoginFailure: |
| print("خطأ: التوكن غير صحيح! تأكد من عمل Reset Token من صفحة المطورين.") |
| except Exception as e: |
| print(f"حدث خطأ أثناء التشغيل: {e}") |
| else: |
| print("خطأ: لم يتم العثور على التوكن! تأكد من إضافته في Settings > Secrets باسم BOT_TOKEN") |