تخطَّ إلى المحتوى
TakoAPI
العودة إلى المهارات

telegram-colored-choices-buttons

بواسطة dandysuper

Web & Frontend Development
390التنزيلات وفق ما يذكره clawskills.sh
0المشاهدات
لا إعجاباتسجّل الدخول للإعجاب بهذه المهارة
—لم يُقيَّم بعد
تقييمك

موجز

Every time the bot presents choices to the user, it MUST automatically color each button based on how critical.

الوصف

ما الذي تفعله هذه المهارة

Automatically assigns colors to Telegram bot choice buttons based on action severity. Destructive actions (delete, transfer, ban) get red buttons, low-priority options get gray, and recommended actions get blue. The classification runs on button text and callback data without manual tagging.

Automatic keyword-based classification removes the need to manually set button styles on every message, keeping color semantics consistent across the bot without extra per-message logic.

متى تستخدمها

  • Confirming account deletion with a red button
  • Separating a purchase confirmation from a cancel option
  • Coloring a document approval flow with approve/reject/skip
  • Distinguishing a subscribe button from a dismiss option
  • Flagging irreversible data wipes in bot workflows

مثال على سير العمل

الإدخال

User asks: bot presents 'Delete all messages in this chat?' with three choices

الوكيل
  1. 1

    Bot builds a choices list with Approve, Delete, and Skip entries

  2. 2

    classify_button_style() scans each button's text and callback_data against keyword patterns

  3. 3

    Delete matches DESTRUCTIVE_SIGNALS, Skip matches SECONDARY_SIGNALS, Approve returns None

  4. 4

    build_choice_buttons() assembles inline_keyboard rows with style fields injected

  5. 5

    Bot sends the message via sendMessage with the colored inline_keyboard

الإخراج

Telegram renders three buttons: blue Approve, red Delete, gray Skip

المتطلبات

  • Telegram Bot API token

التثبيت

clawhub install dandysuper/telegram-colored-choices-buttons

شغّل أمر واجهة سطر الأوامر، أو الصق النص في Claude Code أو Cursor أو Codex أو أي وكيل برمجة تستخدمه.

الروابط