项目地址:https://github.com/ypq123456789/TrafficCop
昨晚有坛友提了这个需求,我想想也是,这个需求应该大伙们都需要。所以,肝了昨天一个晚上加今天一天,调试出了这个功能。此中辛苦,不足为外人道也。不多说了,求点赞!求给项目点个 star!愿意赞助的可以看看项目 readme 最后。
目前我暂时使用没啥问题,大伙们多测试使用下。
## Telegram Bot 集成
TrafficCop 现在集成了 Telegram Bot 功能,可以发送以下通知:
– 限速警告
– 限速解除通知
– 新周期开始通知
– 关机警告
– 每日流量报告
要使用此功能,请在脚本配置过程中提供你的 Telegram Bot Token 和 Chat ID。
Telegram Bot Token 在你创建机器人时会显示。
Chat ID 获取方法:https://api.telegram.org/bot${BOT_TOKEN}/getUpdates
${BOT_TOKEN} 是你的 Telegram Bot Token
坛友提醒:chatid 还可以找 bot 获取,更简单,比如 [username_to_id_bot](https://t.me/username_to_id_bot)
### 相关命令
一键推送脚本
curl -H "Accept: application/vnd.github.v3.raw" -fsSL "https://api.github.com/repos/ypq123456789/TrafficCop/contents/tg_notifier.sh" | tr -d '\r' > /root/tg_notifier.sh && chmod +x /root/tg_notifier.sh && bash /root/tg_notifier.sh
查看 tg 推送定时执行日志
tail -f -n 30 /root/tg_notifier_cron.log
查看当前状态
tail -f -n 30 /tmp/last_traffic_notification
杀死所有 TG 推送进程
pkill -f tg_notifier.sh && crontab -l | grep -v "tg_notifier.sh" | crontab -
推送示意如下:
![图片[1]|【TrafficCop 大更新】支持 TG 推送!|不死鸟资源网](https://www.busi.net/wp-content/uploads/2025/06/20250615074932114-image-496x1024.png)
本站资源均为作者提供和网友推荐收集整理而来,仅供学习和研究使用,请在下载后24小时内删除,谢谢合作!
THE END