Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

网页能正常反应是否补货,tg bot没有补货通知,帮我看看哪里有问题。谢谢啊 #18

Closed
aff2018 opened this issue Aug 23, 2019 · 13 comments

Comments

@aff2018
Copy link

aff2018 commented Aug 23, 2019

##1
image
/www/wwwroot/域名/public/bot.php,做了上面这样的修改

运行:
https://api.telegram.org/bot[Token]/setWebhook?url=https://[domain]/bot.php
[token],[domain]换成我自己的设置了,也返回成功的提示了。
和bot对话/start,能得到sckey码
把机器人加入到通道,设置管理员,再通道里对话/start,也能得到sckey码

##2
image
/www/wwwroot/域名/app/index/config.php,做了上面这样的修改。

##3
image
/www/wwwroot/域名/gotest/config.json,做了上面这样的修改

目前网页能正常反应是否补货。
但是tg bot没有补货通知。

求解,网站程序中还有哪里需要设置?

@546669204
Copy link
Owner

使用的时个人推 还是 频道 推送
个人推送 需要订阅 想要 的那个 记录 修改 自己的key
频道推送需要 把机器人加到频道里面 然后设置权限 设置 频道key

@aff2018
Copy link
Author

aff2018 commented Aug 23, 2019

和bot对话/start,能得到sckey码
把机器人加入到通道,设置管理员,再通道里对话/start,也能得到sckey码

频道推送:机器人已加到频道里面 然后也设置权限为管理员了, 设置 频道key,也搞了,是这个文件里的把?:
/www/wwwroot/域名/app/index/config.php
tgchannersckey也设置了

@546669204
Copy link
Owner

再把 “https://github.com/546669204/vps-inventory-monitoring/blob/master/app/index/model/Index.php” 里面的 [https://cloud.hcaiyue.top/tgbot.php] 换成 你自己的地址

@aff2018
Copy link
Author

aff2018 commented Aug 23, 2019

再把 “https://github.com/546669204/vps-inventory-monitoring/blob/master/app/index/model/Index.php” 里面的 [https://cloud.hcaiyue.top/tgbot.php] 换成 你自己的地址

换好了,如图,就两处吧?
image

@546669204
Copy link
Owner

是的。 现在再试试 。 你是使用 cron 定时访问网站的方式 监听的吧。 那就不用改了。
如果使用命令行方式还要改 https://github.com/546669204/vps-inventory-monitoring/blob/master/app/index/command/VpsTest.php
如果使用 二进制文件 方式 就要修改 https://github.com/546669204/vps-inventory-monitoring/blob/master/gotest/config.json

目前提供

  1. cron+http
  2. php think vpstest
  3. go 代码编译运行

@aff2018
Copy link
Author

aff2018 commented Aug 23, 2019

是的。 现在再试试 。 你是使用 cron 定时访问网站的方式 监听的吧。 那就不用改了。
如果使用命令行方式还要改 https://github.com/546669204/vps-inventory-monitoring/blob/master/app/index/command/VpsTest.php
如果使用 二进制文件 方式 就要修改 https://github.com/546669204/vps-inventory-monitoring/blob/master/gotest/config.json

目前提供

  1. cron+http
  2. php think vpstest
  3. go 代码编译运行

是的,我用的cron定时访问网站的方法。
要调试的话,需要改哪个文件什么地方?(不会调试,等真实补货触发了,捂脸!)
谢谢作者耐心解答,静等~不行再来骚扰,233

@546669204
Copy link
Owner

你可以找一个有货的 然后 吧数据库里改成没有货。 等他一波请求就有了。

@aff2018
Copy link
Author

aff2018 commented Aug 23, 2019

你可以找一个有货的 然后 吧数据库里改成没有货。 等他一波请求就有了。

感谢,终于收到了,通道和个人推,都提示了。

另外,
3. go 代码编译运行,特想知道这种方法,怎么搞?怎么运行?执行哪个文件?

@546669204
Copy link
Owner

会 go 语言吗 可以 尝试 执行 go run

@aff2018
Copy link
Author

aff2018 commented Aug 23, 2019

用过,不熟。
需要go run 哪个文件?

@546669204
Copy link
Owner

执行整个目录 不用加文件

@aff2018
Copy link
Author

aff2018 commented Aug 23, 2019

执行整个目录 不用加文件

懂了,谢谢大佬耐心解答!有问题再请教了。

@546669204
Copy link
Owner

好的。 那我关闭了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants