【已解答】TG机器人布置了打不开因为什么各位大佬啊
为了能快速了解并处理您的问题,请提供以下基础信息:面板、插件版本:宝塔
系统版本:
7.9:CentOS 7
问题描述:我的TG机器人在云服务的宝塔上搭建的GO项目,启动不了,提示找不到CHAT
相关截图(日志、错误):
启动失败
panic: Bad Request: chat not found
goroutine 1 [runningl:
tg_pay_gate/internal/utils/tg_bot.InitTGBot0
C:/Users/MY/GolandProjects/tg_pay_gate/internal/utils/tg_bot/tg_bot.go:50 +
Ox1bd
main.main0
C:/Users/MY/GolandProjects/tg_pay_gate/cmd/main.go:23 +0xf4
Config loaded: &{TgBotToken:7650816667:AAG94pjNuc2aC4cs-iTLeLDH0hGt6
Mu1z4w GrouplD:-1002697059574 Price:10 Host:https://hostfornotify.com Pr
oxy:(EnableProxy:false Protocol:socks5 Host:127.0.0.1 Port:10808])
付费计划信息:&{Pid:123456Key:XXXXX Url:https://mopay.vip/api/order/epay/
submit.php PayType:USDT-TRON-2-USDT NotifyUrl:/api/epay_notify)
正在连接TG
TG连接成功
正在校验管理员身份
panic: Bad Request: chat not found
goroutine 1 [runningl:
tg_pay_gate/internal/utils/tg_bot.InitTGBot0
C:/Users/MY/GolandProjects/tg_pay_gate/internal/utils/tg_bot/tg_bot.go:50 +
Ox1bd
main.main0
C:/Users/MY/GolandProjects/tg_pay_gate/cmd/main.go:23 +0xf4 启动失败
panic: Bad Request: chat not found
goroutine 1 [runningl:
tg_pay_gate/internal/utils/tg_bot.InitTGBot0
C:/Users/MY/GolandProjects/tg_pay_gate/internal/utils/tg_bot/tg_bot.go:50 +
Ox1bd
main.main0
C:/Users/MY/GolandProjects/tg_pay_gate/cmd/main.go:23 +0xf4
Config loaded: &{TgBotToken:7650816667:AAG94pjNuc2aC4cs-iTLeLDH0hGt6
Mu1z4w GrouplD:-1002697059574 Price:10 Host:https://hostfornotify.com Pr
oxy:(EnableProxy:false Protocol:socks5 Host:127.0.0.1 Port:10808])
付费计划信息:&{Pid:123456Key:XXXXX Url:https://mopay.vip/api/order/epay/
submit.php PayType:USDT-TRON-2-USDT NotifyUrl:/api/epay_notify)
正在连接TG
TG连接成功
正在校验管理员身份
panic: Bad Request: chat not found
goroutine 1 [runningl:
tg_pay_gate/internal/utils/tg_bot.InitTGBot0
C:/Users/MY/GolandProjects/tg_pay_gate/internal/utils/tg_bot/tg_bot.go:50 +
Ox1bd
main.main0
C:/Users/MY/GolandProjects/tg_pay_gate/cmd/main.go:23 +0xf4 错误 panic: Bad Request: chat not found 表明在初始化 Telegram 机器人时,程序尝试访问一个 不存在的聊天群组(Chat)。具体原因可能包括:
GroupID 配置错误:提供的群组 ID 无效或格式错误。
机器人未加入群组:机器人未被添加到目标群组中。
权限不足:机器人未被授予访问群组的权限。
代码逻辑问题:在 InitTGBot 中尝试操作群组时未正确处理异常
页:
[1]