mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
- Rename lobster extension → flow (dir, types, env vars, docs) - LOBSTER_* env vars → BOT_FLOW_* / BOT_* - 🦞 → 🤖 everywhere (src, docs, skills, zh-CN) - docs.bot.ai → docs.hanzo.bot - github.com/bot/bot → github.com/hanzoai/bot - @bot/* → @hanzo/bot-* (npm scope) - ~/.bot/ → ~/.hanzo/bot/ (config paths) - discord.gg/hanzo → discord.gg/XthHQQj (real Hanzo Discord) - clawhub.com → skills.hanzo.bot - ClawDock → BotDock in shell helpers - EXFOLIATE lore → Hanzo Bot branding in all locales - LOBSTER_PALETTE → BOT_PALETTE, LOBSTER_ASCII → BOT_ASCII
2.6 KiB
2.6 KiB
read_when, summary, title, x-i18n
| read_when | summary | title | x-i18n | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
通过 Gateway 网关 + CLI 发送投票 | 投票 |
|
投票
支持的渠道
- WhatsApp(Web 渠道)
- Discord
- MS Teams(Adaptive Cards)
CLI
# WhatsApp
hanzo-bot message poll --target +15555550123 \
--poll-question "Lunch today?" --poll-option "Yes" --poll-option "No" --poll-option "Maybe"
hanzo-bot message poll --target [email protected] \
--poll-question "Meeting time?" --poll-option "10am" --poll-option "2pm" --poll-option "4pm" --poll-multi
# Discord
hanzo-bot message poll --channel discord --target channel:123456789 \
--poll-question "Snack?" --poll-option "Pizza" --poll-option "Sushi"
hanzo-bot message poll --channel discord --target channel:123456789 \
--poll-question "Plan?" --poll-option "A" --poll-option "B" --poll-duration-hours 48
# MS Teams
hanzo-bot message poll --channel msteams --target conversation:19:[email protected] \
--poll-question "Lunch?" --poll-option "Pizza" --poll-option "Sushi"
选项:
--channel:whatsapp(默认)、discord或msteams--poll-multi:允许选择多个选项--poll-duration-hours:仅限 Discord(省略时默认为 24)
Gateway 网关 RPC
方法:poll
参数:
to(字符串,必需)question(字符串,必需)options(字符串数组,必需)maxSelections(数字,可选)durationHours(数字,可选)channel(字符串,可选,默认:whatsapp)idempotencyKey(字符串,必需)
渠道差异
- WhatsApp:2-12 个选项,
maxSelections必须在选项数量范围内,忽略durationHours。 - Discord:2-10 个选项,
durationHours限制在 1-768 小时之间(默认 24)。maxSelections > 1启用多选;Discord 不支持严格的选择数量限制。 - MS Teams:Adaptive Card 投票(由 Hanzo Bot 管理)。无原生投票 API;
durationHours被忽略。
智能体工具(Message)
使用 message 工具的 poll 操作(to、pollQuestion、pollOption,可选 pollMulti、pollDurationHours、channel)。
注意:Discord 没有"恰好选择 N 个"模式;pollMulti 映射为多选。
Teams 投票以 Adaptive Cards 形式渲染,需要 Gateway 网关保持在线
以将投票记录到 ~/.hanzo/bot/msteams-polls.json。