الأكاديمية ← قنوات المراسلةتوثيق رسمي · إرشاد عربي

قناة IRC

IRC

متوسط3 دقائق قراءةالدرس 323 أسئلة✓ 2026-08-18
قبل أن تقرأ

ما هذه الصفحة، وماذا تحتوي.

بوابة المراسلة: الوصلة التي تجعلك تكلّم Hermes من تطبيق تستعمله أصلًا، مثل Telegram أو WhatsApp، بدل الطرفية. الوكيل الذي تصله من هاتفك تستعمله فعلًا. الذي يحتاج فتح الحاسوب تنساه بعد أسبوع. ستستعمل هنا hermes gateway setup وhermes gateway start، والقراءة نحو 3 دقائق. انتبه: افتح القناة لنفسك فقط في البداية عبر قائمة سماح. القناة المفتوحة تعني أن أي شخص يراسل وكيلك.

6أقسام
2أمثلة برمجية
1جداول
3أوامر
493كلمة من المصدر
ماذا ستستطيع بعدها

نتائج مأخوذة من هذه الصفحة، لا من قالب.

  • تعرف ما بوابة المراسلة ولماذا قد تحتاجه.
  • تنفّذ hermes gateway setup وhermes gateway start وتفهم ما يحدث بعدها.
  • تقرأ الجدول وتأخذ منه السطر الذي يخصّك فقط.
  • تضبط IRC_ALLOWED_USERS في المكان الصحيح.
ما ستقابله من أسماء

كما تظهر تمامًا داخل Hermes.

الأوامر
  • hermes gateway setup
  • hermes gateway start
  • hermes gateway status
متغيرات البيئة
  • IRC_ALLOWED_USERS
  • IRC_NICKSERV_PASSWORD
  • IRC_HOME_CHANNEL
  • IRC_CHANNEL
خريطة الصفحة

انتقل مباشرة إلى ما تحتاجه.

  1. 01Prerequisites
  2. 02Configure Hermes
  3. 03Access control
  4. 04Channels vs. DMs
  5. 05Run the gateway
  6. 06Notes
الصفحة الرسمية كاملة

بلا اختصار أو حذف.

النص أدناه منقول من المصدر الرسمي بالإنجليزية حتى تبقى الأوامر والأسماء دقيقة كما هي. قبل كل قسم شرح عربي يوضّح ما بداخله.

The IRC adapter connects Hermes to any IRC server and relays messages between an IRC channel (or direct messages) and the agent. It speaks the IRC protocol over Python's stdlib asyncio — no external dependencies, no SDK, no daemon. It works with public networks like Libera.Chat ↗ and any self-hosted ircd.

IRC is plain text: there is no voice, image, file, thread, reaction, typing, or streaming support — replies are sent as PRIVMSG lines, with long messages split to fit the IRC line limit.

Run hermes gateway setup and pick IRC for a guided walk-through.

Prerequisites

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه. تذكير: الوصلة التي تجعلك تكلّم Hermes من تطبيق تستعمله أصلًا، مثل Telegram أو WhatsApp، بدل الطرفية.

  • An IRC server to connect to (e.g. irc.libera.chat)
  • A channel to join (e.g. #hermes) — comma-separate to join several
  • A nickname for the bot (default: hermes-bot)
  • Optional: a registered nick + NickServ password if your network requires identification

Configure Hermes

جدول مرجعي. لا تقرأه كله، ابحث عن السطر الذي يخصّك فقط.

You can configure IRC two ways — environment variables (for a quick env-only setup) or the gateway block in ~/.hermes/gateway-config.yaml.

Option A — gateway-config.yaml

YAML14 سطرًا
gateway:
  platforms:
    irc:
      enabled: true
      extra:
        server: irc.libera.chat
        port: 6697
        nickname: hermes-bot
        channel: "#hermes"
        use_tls: true
        server_password: ""       # optional server password
        nickserv_password: ""     # optional NickServ identification
        allowed_users: []         # empty = allow all, or list of nicks
        max_message_length: 450   # IRC line limit (safe default)

Option B — environment variables

VariableRequiredDescription
IRC_SERVER✅IRC server hostname (e.g. irc.libera.chat)
IRC_CHANNEL✅Channel(s) to join — comma-separate for multiple
IRC_NICKNAME✅Bot nickname (default: hermes-bot)
IRC_PORT—Server port (default: 6697 with TLS, 6667 without)
IRC_USE_TLS—Use TLS (true/false; default true on port 6697)
IRC_SERVER_PASSWORD—Server password for the PASS command
IRC_NICKSERV_PASSWORD—NickServ password for automatic IDENTIFY on connect
IRC_ALLOWED_USERS—Comma-separated nicks allowed to talk to the bot
IRC_ALLOW_ALL_USERS—Allow anyone in the channel to talk to the bot (dev only)
IRC_HOME_CHANNEL—Channel for cron / notification delivery (defaults to IRC_CHANNEL)

Access control

إعدادات تضبطها مرة وتنساها. غيّر واحدًا في كل مرة حتى تعرف أثر كل تغيير. تضبط IRC_ALLOWED_USERS، IRC_NICKSERV_PASSWORD خارج المحادثة، في بيئة التشغيل.

By default, only nicks listed in allowed_users (or IRC_ALLOWED_USERS) may talk to the bot. Leave the list empty and set IRC_ALLOW_ALL_USERS=true to let anyone in the channel chat with Hermes — useful for testing, but not recommended on public networks since IRC nicks are not authenticated unless the network enforces NickServ.

If your network registers nicks, set IRC_NICKSERV_PASSWORD (or nickserv_password) so the bot identifies to NickServ on connect and keeps its registered nick.

Channels vs. DMs

إعدادات تضبطها مرة وتنساها. غيّر واحدًا في كل مرة حتى تعرف أثر كل تغيير. تضبط IRC_HOME_CHANNEL، IRC_CHANNEL خارج المحادثة، في بيئة التشغيل.

  • Messages in a joined channel are treated as a group conversation.
  • Private messages to the bot are treated as direct messages.

Cron jobs and notifications are delivered to the home channel — IRC_HOME_CHANNEL if set, otherwise the first IRC_CHANNEL.

Run the gateway

أوامر تكتبها في الطرفية. افهم ما يفعله الأمر قبل نسخه. الأوامر هنا: hermes gateway start، hermes gateway status.

Shellسطر واحد
hermes gateway start

Check status with hermes gateway status — IRC connection state is reported there, including for env-only setups.

Notes

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه.

  • Long agent replies are automatically split into multiple PRIVMSG lines to stay within the IRC line limit (max_message_length, default 450 bytes after protocol overhead).
  • The adapter acquires a scoped credential lock per server+nick, so two Hermes profiles won't fight over the same IRC identity.
اختبار الفهم

3 أسئلة إجاباتها كلها في هذه الصفحة.

كل خيار اسم حقيقي من توثيق Hermes. حتى الخيارات الخاطئة حقيقية، لكنها من صفحات أخرى.

1. أي متغير بيئة من التالي يظهر فعليًا في هذا الدرس؟
2. أي عنوان من التالي لا يظهر في هذا الدرس؟
3. أي مفتاح إعداد يظهر في أمثلة هذا الدرس؟