important alert: Cloudflare workers free plan only run script 10ms, So only simple message handling functions can be done.
This bot is an attempt to run on cloudflare workers, you can edit the function handlemessage and handleinline to easily create your own bot.
You can use starter.js
to create the bot you own quickly.
-
Go to ask t.me/botfather that he can tell you some infomation about your bot(token)
-
Create a worker in cloudflare and paste hitokoto_bot.js
-
Use the information above to edit the first 3 lines
-
set your bot's webhook (browser or curl)
curl https://api.telegram.org/bot[token]/setwebhook?url=[workersurl] workersurl:
-
Enjoy yourself and do some magic edit to build you own bot ~ If you still have problems you can create a issue, I can help you.
- hitokoto local data https://github.com/kokororin/hitokoto
- seed-shuffle https://github.com/yixizhang/seed-shuffle/
- cloudflare
MIT