mirror of
https://github.com/Gloridust/WechatOnCloud.git
synced 2026-06-16 19:53:53 +08:00
54ed841a68
管理页 UI/UX - 实例卡片操作改为「管理」分类折叠菜单(默认收起,点开按 运维/设置/危险 分组的 文字操作),替代之前难辨认的图标排;删除单独成组、红色,降低误点 - 修复展开一张卡片时同行其它卡片被 grid 拉等高(inst-grid align-items:start) - 管理页空状态(无实例/无子账号)改为图标+标题+说明+引导按钮 - 主页实例卡片加副行(状态·微信版本)、悬停上浮高亮 Telegram 命令机器人(轮询版,纯 GitHub Actions,无服务器) - .github/workflows/telegram-bot.yml + scripts/telegram-bot.mjs - 私聊/群组命令:/help /releases /release <tag> /issues /issue <编号> - cron 每 5 分钟 getUpdates,处理后用 offset 向 Telegram 确认,无需持久化存储 - 受 vars.TELEGRAM_BOT_ENABLED 开关;命令非实时(cron 限制),文档已说明 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
41 lines
1.5 KiB
YAML
41 lines
1.5 KiB
YAML
name: telegram-bot
|
||
|
||
# Telegram 命令机器人(轮询版)——无需服务器,仅靠 GitHub Actions cron。
|
||
# 私聊 / 群组都可用命令查询:/help /releases /release <tag> /issues /issue <编号>。
|
||
#
|
||
# 启用(一次性):
|
||
# 1) 已配置 telegram-notify 用到的 TELEGRAM_BOT_TOKEN(Secret)即可复用;
|
||
# 2) 仓库 Settings → Secrets and variables → Actions → Variables 新建
|
||
# TELEGRAM_BOT_ENABLED = true (未设为 true 则本工作流不运行,避免空跑)
|
||
# 3) 把机器人拉进群组 / 在私聊里 /start。
|
||
#
|
||
# 局限:cron 最小 5 分钟且可能再延后 → 命令非实时;GitHub 会在仓库 60 天无活动时暂停定时任务。
|
||
# 想立即处理一次:Actions → telegram-bot → Run workflow(workflow_dispatch)。
|
||
|
||
on:
|
||
schedule:
|
||
- cron: '*/5 * * * *'
|
||
workflow_dispatch: {}
|
||
|
||
permissions:
|
||
contents: read
|
||
issues: read
|
||
|
||
# 避免轮询任务并发重叠重复处理;新触发取消正在跑的(残留未确认更新下次重处理,无副作用)
|
||
concurrency:
|
||
group: telegram-bot
|
||
cancel-in-progress: true
|
||
|
||
jobs:
|
||
poll:
|
||
runs-on: ubuntu-latest
|
||
if: ${{ vars.TELEGRAM_BOT_ENABLED == 'true' }}
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
- name: Poll Telegram & handle commands
|
||
env:
|
||
TG_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
|
||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||
REPO: ${{ github.repository }}
|
||
run: node .github/scripts/telegram-bot.mjs
|