Skip to content

About

A Discord bot in Python with discord.py, ready to deploy on Serverk

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

بوت ديسكورد (discord.py)

قالب بوت ديسكورد بسيط بلغة بايثون: أمر /ping يرد بسرعة الاتصال. أنشئ منه ريبو خاصًا بك وابنِ عليه.

A minimal Discord bot in Python: a /ping command that answers with the latency. Make it your own repository and build on top.

شغّله على Serverk

انشر على سيرفرك

  1. اضغط الزر أعلاه، أو اضغط Use this template في GitHub ثم اختر ريبوك الجديد من «شغّل بوتك».
  2. أضف التوكن إلى المتغيرات باسم DISCORD_TOKEN واتركه حساسًا.
  3. اضغط «ادفع وانشر». نثبّت المكتبات بالأمر uv pip install -r requirements.txt، ونشغّل البوت بالأمر python main.py، على Python 3.12. وكل push على main ينشر بوتك من جديد.
المتغير مطلوب القيمة
DISCORD_TOKEN نعم توكن البوت من Discord Developer Portal
  • يصل كل متغير إلى بوتك بالاسم الذي حفظته به تمامًا، دون بادئة أو أي تغيير، ويقرؤه الكود من os.environ["DISCORD_TOKEN"].
  • لا يصل ملف .env إلى Serverk أبدًا: يستبعده .gitignore من الريبو، ونحذفه من أي zip ترفعه ونقترح أسماء متغيراته دون قيمها. يحمل .env.example الأسماء فقط.
  • يستخدم البوت discord.Intents.default()، ولا تشمل أيًّا من الـ Intents المميزة. إذا أضفت أحدها مثل Message Content ففعّله أولًا في Developer Portal، وإلا رفض ديسكورد تسجيل دخول البوت.
  • لا يفتح البوت أي منفذ حتى تفعّل عنوان الويب من الإدارة، فيصل إليه PORT و SERVERK_WEB_URL و SERVERK_WEB_HOST لتفاعلات ديسكورد عبر HTTP أو لصفحاتك.

الشروحات: شغّل بوتك أول مرة، أضف التوكن والمتغيرات، أين تجد توكن بوت ديسكورد.

Run it on Serverk

Deploy on Serverk

  1. Press the button above, or press Use this template on GitHub and pick your new repository on Run your bot.
  2. Add the token to your variables as DISCORD_TOKEN, marked sensitive.
  3. Press Pay and deploy. We install the dependencies with uv pip install -r requirements.txt and start the bot with python main.py, on Python 3.12. Every push to main deploys your bot again.
Variable Required Value
DISCORD_TOKEN Yes The bot token from the Discord Developer Portal
  • Every variable reaches your bot under exactly the name you saved it with, with no prefix and no renaming. The code reads it from os.environ["DISCORD_TOKEN"].
  • A .env file never reaches Serverk: .gitignore keeps it out of the repository, and we remove it from any zip you upload and suggest its variable names without the values. .env.example holds the names only.
  • The bot uses discord.Intents.default(), which holds no privileged intent. If you add one such as Message Content, turn it on in the Developer Portal first, or Discord refuses the bot's login.
  • The bot opens no port until you turn on the web address in Manage: it then gets PORT, SERVERK_WEB_URL and SERVERK_WEB_HOST, for Discord interactions over HTTP or your own pages.

Guides: Run your bot for the first time, Add the token and your variables, Where to find your Discord bot token.

مع أداة ذكاء اصطناعي / With an AI tool

يشرح ملف AGENTS.md في هذا الريبو ما سبق لأداة الذكاء الاصطناعي التي تكتب بها بوتك. وتعلّمها serverk-bot من Serverk طريقة النشر كاملة، وريبوها هو https://github.com/serverkgg/serverk-skills. لتنشر الأداة بوتك وتضبط متغيراته وتقرأ سجل النشر، اربطها بواجهة MCP على https://api.serverk.gg/mcp.

AGENTS.md tells the AI tool you write your bot with all of the above. Serverk's serverk-bot skill teaches it the whole workflow; its repository is https://github.com/serverkgg/serverk-skills. To let it deploy your bot, set its variables and read the deployment log, connect it to the Serverk MCP server at https://api.serverk.gg/mcp.

على جهازك / On your machine

cp .env.example .env
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
set -a && . ./.env && set +a
.venv/bin/python main.py

ضع التوكن في .env على جهازك فقط، ولا ترفعه أبدًا. مكانه على Serverk متغيرات بوتك.

Keep the token in .env on your own machine only and never push it. On Serverk it belongs in your bot's variables.

About

A Discord bot in Python with discord.py, ready to deploy on Serverk

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages