dadahsueh/zakook-bot
Simple KOOK bot that can subscribe to RSS feeds.
๐งZakook Bot๐ง
- TODOs
- channel logging
- fix concurrency
๐ค Simple template KOOK bot. Doesn't do much, does do RSS.
๐ Table of Contents
๐ง About
For educational purposes. Good clean code. The bot is intended for Kook, can subscribe to RSS feeds, and ~~
definitely~~ probably plausibly maybe scalable. Uses Python v3.11.9
and khl.py.
bot/commands- bot command codebot/databases- database codebot/messages- messages and card messages templatebot/tasks- bot tasks codebot/utils- utility code
๐ Usage
To begin exploring:
/help
Commands
/help: get usage./jini: ping pong check./clear: clears all messages of a text channel./rss sub [url]: subscribes the current channel to a rss feed, immediately posts the newest entry and periodically
posts new entries./rss unsub [url]: unsubscribes the current channel from a rss feed./rss list: see a list of rss feeds the current channel is subscribed to./rss unsub [all/*]or/rss unsuball: unsubscribes the current channel from all rss feeds./rss dump: dumps all rss links.
1๏ธโฃ Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and
testing
Prerequisites
If you need to clone the repo
git clone https://github.com/dadahsueh/zakook-bot.git
cd zakook-bot
mv .env.template .env
If you do not see a .env file just manually rename .env.template to .env and or create one with touch .env.
Then configure the .env as like below (substituting for your values).
You could also run with python main.py -t YOUR_TOKEN.
TOKEN=BOT_TOKEN_HERE
CONTAINER_NAME=zakook-bot-runner
ADMIN_USERS=["635507656"]
BOT_NAME=ZAKOOK
BOT_VERSION=v0.0.1
MUSIC_STATUS=["(็งไบบ็ฌๅฃฐ);่ต้ฉฌๅจ", ";"]
CF=
Installing
- Create Python virtual environment or just
python -m venv venv
virtualenv venv
- Windows POSH activate venv
./venv/Scripts/activate
- Linux / Mac activate venv
source venv/bin/activate
- Install dependencies
pip install -r requirements.txt
- Annnnnnnnnnd run ๐
python main.py
You can also try running with arguments -t TOKEN or --token TOKEN, and -v -vv for verbosity changes. Which would
look like python main.py -t TOKEN -vv
Also also try -cf https://xxxworker.xxxname.workers.dev/ to configure a Cloudflare Worker
๐ Deploying your own bot
Docker README <--Goooo.
Cloudflare Worker README <--For RSSHub.
๐ Acknowledgements
- khl.py: Python SDK for KOOK API
- Kook-Source-Query Bot
- Kyouka ้ๅ ็นๆญๆบๅจไบบ
- RiddleSolver: Git Summary


