القنوات والصوت
يمكن أن يبقى Anda في الطرفية أو ينضم إلى قنوات الفريق. تعيد القنوات السياق إلى وقت التشغيل ونظام الذاكرة نفسه.
القنوات المدعومة
- Telegram
- Discord
- Lark / Feishu
يوجد الإعداد تحت channels في ~/.anda/config.yaml.
المستخدمون المتعددون
يمكن لـ daemon واحد خدمة عدة مستخدمين موثوقين عبر وكيل Anda نفسه. أنشئ مفتاح مستخدم ثم استخدم ذلك id في حقل user داخل القناة. عند حذف user تستخدم القناة المالك المحلي من ~/.anda/keys/user.key.
anda user create alice
anda user list
يكتب الأمر المفتاح العام الجديد تحت users ويحفظ المفتاح الخاص المطابق في ~/.anda/keys/users/:
users:
- id: alice
pubkey: "ALICE_ED25519_PUBLIC_KEY"
Telegram
channels:
telegram:
- id: personal
user: alice
bot_token: "YOUR_TELEGRAM_BOT_TOKEN"
username: "YOUR_TELEGRAM_BOT_USERNAME"
allowed_users:
- "*"
mention_only: false
WeChat
channels:
wechat:
- id: personal
bot_token: ""
username: anda-wechat
allowed_users:
- "*"
عند ترك bot_token فارغًا يمكن استخدام anda channel init wechat ومسح QR.
Discord
يستخدم Discord رمز bot واتصال Gateway. أنشئ وثبّت bot قبل تعديل config.yaml:
- افتح Discord Developer Portal، ثم أنشئ app أو افتح app موجودة.
- في صفحة Bot انسخ رمز bot أو أعد إنشاءه. فعّل أيضًا Message Content Intent ضمن Privileged Gateway Intents حتى يستطيع Anda قراءة نص الرسائل العادية.
- في Installation تأكد أن Guild Install يحتوي على scope باسم
bot. من دونbotقد تظهر app في Discord Apps لكنها لن تظهر كعضو bot في الخادم. - امنح على الأقل
View ChannelsوSend MessagesوRead Message History. أضفAttach Filesلردود الملفات، وأضفAdd Reactionsإذا كانack_reactions: true. - ثبّت app في الخادم. بعد تثبيت الخادم يجب أن يظهر bot في قائمة الأعضاء.
channels:
discord:
- id: server
bot_token: "YOUR_DISCORD_BOT_TOKEN"
username: anda-discord
guild_id: "YOUR_DISCORD_GUILD_ID"
allowed_users:
- "YOUR_DISCORD_USER_ID"
mention_only: true
ack_reactions: true
الحقل الإلزامي الوحيد في التحقق من الإعداد هو bot_token. لإعداد عملي وأكثر أمانًا، اضبط allowed_users على Discord user IDs؛ عند ترك allowed_users فارغًا مع allow_external_users: false يتجاهل Anda المرسلين غير المسموح لهم.
anda channel list
anda restart
في قناة الخادم اذكر bot مثل @anda-discord لخص هذا النقاش. في DM مع bot أرسل رسالة عادية من دون ذكره.
Lark / Feishu
channels:
lark:
- id: work
app_id: "cli_xxx"
app_secret: "YOUR_APP_SECRET"
platform: feishu
receive_mode: websocket
mention_only: true
الأمان
- يحدد
allowed_usersمن يمكنه تشغيل Anda. - استخدم
"*"فقط عند قبول الوصول المفتوح. - يحتاج Lark/Feishu إلى
app_idوapp_secret. - تحفظ مسارات القنوات للرد في الخيط أو الغرفة الصحيحة.
الصوت
anda voice --record-secs 8
يتطلب الإدخال الصوتي transcription.enabled: true ويتطلب تشغيل الرد tts.enabled: true. للصوت كإدخال والنص كمخرج:
anda voice --record-secs 8 --no-playback