This is a Discord bot which replies a random frame of the very famous video 【東方】Bad Apple!! PV【影絵】 by default, or an arbitrary video specified in the config file.
This project is forked from NPCat / bad-apple-bot. We have read, extended, optimized and refactored all the codes.
You can click the thumbnail below to watch the demo of ./terminal.py
on YouTube.
![]() |
---|
Demo of ./terminal.py . |
sudo pip3 install discord.py Pillow opencv-python
- Write a config file.
cp ./config_example.json ./config.json
vi ./config.json
- Convert a video to frames.
./video_to_frames.sh #takes long (e.g. 51s)
- Start a bot.
./main.py
- Post the following string in Discord. If
<frame number>
is omitted or invalid, a frame is randomly picked.
bad apple [<frame number>]
![]() |
---|
Screenshot of ./main.py . |
Frames can also be printed to a terminal.
./terminal.py
![]() |
---|
Screenshot of ./terminal.py . |