An experimental Hikari Discord bot for reverse image searching using SauceNAO & Kheina
Linux is used for the following commands
WSL can be used to run Linux on Windows, but is not required to run the bot
- Clone repository
git clone https://github.com/Myned/modufur.git
- Go to project folder
cd modufur
- Create a virtual environment and install dependencies
poetry install
- Go to project folder
cd modufur
- Run with optimizations
poetry run python -OO run.py
Run to create config.toml
The file will automatically generate if it does not exist
guilds = [] # guild IDs to register commands, empty for global
master = 0 # guild ID to register owner commands
client = 0 # bot application ID
token = "" # bot token
activity = "" # bot status
saucenao = "" # saucenao token
e621 = "" # e621 token
Run in the background on most Linux machines
This assumes that the project folder is located at ~/.git/modufur
Change the WorkingDirectory
path in modufur.service
if this is not the case
- Go to project folder
cd modufur
- Copy user service file
cp modufur.service ~/.config/systemd/user
- Replace
user
inWorkingDirectory
with current user
sed -i "s|\(WorkingDirectory=/home/\)user|\1$(whoami)|" ~/.config/systemd/user/modufur.service
- Reload user daemon
systemctl --user daemon-reload
- Start and enable service on login
systemctl --user enable --now modufur
- Enable lingering to start user services on boot
sudo loginctl enable-linger $(whoami)
- Go to project folder
cd modufur
- Pull changes from repository
git pull
- Update virtual environment
poetry update
- Restart systemd user service
systemctl --user restart modufur
- Stop and disable systemd user service
systemctl --user disable --now modufur
- Remove systemd user service file
rm ~/.config/systemd/user/modufur.service
- Optionally disable lingering
sudo loginctl disable-linger username
- Remove project folder
rm -rf modufur
- Fork this repository on GitHub
- Make changes to the code
- Format the code with Black inside the project folder
poetry run black .
- Commit the changes to the fork
- Create a pull request from the fork
My Discord account was deleted, so a new bot had to be created.
Although public, I do not wish for it to be excessively used due to API quotas.
Discord currently has no way to disable scanning content for bots.
You can send links uploaded elsewhere instead.