- TODOs
- channel logging
- fix concurrency
🤖 Simple template KOOK bot. Doesn't do much, does do RSS.
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
To begin exploring:
/help
/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.
These instructions will get you a copy of the project up and running on your local machine for development and testing
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=
- 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