your-diary / bad-apple-bot

https://www.youtube.com/watch?v=njc7omGdASw

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About

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.

Demo Video

You can click the thumbnail below to watch the demo of ./terminal.py on YouTube.

Demo of ./terminal.py.

Requirements

sudo pip3 install discord.py Pillow opencv-python

Usage

Discord Bot

  1. Write a config file.
cp ./config_example.json ./config.json
vi ./config.json
  1. Convert a video to frames.
./video_to_frames.sh #takes long (e.g. 51s)
  1. Start a bot.
./main.py
  1. 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.

Print to Terminal

Frames can also be printed to a terminal.

./terminal.py
Screenshot of ./terminal.py.

About

https://www.youtube.com/watch?v=njc7omGdASw


Languages

Language:Python 99.0%Language:Shell 1.0%