1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-11-01 05:02:38 +00:00
Discord bot for reverse image searching
Find a file
Myned aff7fdf1c0
git: remove funding
Signed-off-by: Myned <dev@bjork.tech>
2024-09-08 20:23:58 -05:00
commands Change symantics 2023-03-06 20:39:11 -06:00
tools Fix deprecations 2023-03-06 20:36:53 -06:00
.gitignore Initial hikari rewrite 2022-02-21 01:10:57 -06:00
config.py Initial addition of music commands 2022-03-04 00:06:52 -06:00
LICENSE Initial commit 2017-09-24 01:48:05 -04:00
modufur.service Update repo name 2023-03-17 01:15:14 -05:00
poetry.toml Add poetry config 2022-02-22 13:02:37 -06:00
pyproject.toml Update poetry version 2023-03-17 08:49:20 -05:00
README.md git: remove funding 2024-09-08 20:23:58 -05:00
run.py Fix deprecations 2023-03-06 20:36:53 -06:00

Modufur

An experimental Hikari Discord bot for reverse image searching using SauceNAO & Kheina

Prerequisites

Linux is used for the following commands
WSL can be used to run Linux on Windows, but is not required to run the bot

Requirements

Git
Python 3.10+
Poetry

Installing

  1. Clone repository
git clone https://github.com/Myned/modufur.git
  1. Go to project folder
cd modufur
  1. Create a virtual environment and install dependencies
poetry install

Usage

  1. Go to project folder
cd modufur
  1. Run with optimizations
poetry run python -OO run.py

Setup

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

systemd service

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

  1. Go to project folder
cd modufur
  1. Copy user service file
cp modufur.service ~/.config/systemd/user
  1. Replace user in WorkingDirectory with current user
sed -i "s|\(WorkingDirectory=/home/\)user|\1$(whoami)|" ~/.config/systemd/user/modufur.service
  1. Reload user daemon
systemctl --user daemon-reload
  1. Start and enable service on login
systemctl --user enable --now modufur
  1. Enable lingering to start user services on boot
sudo loginctl enable-linger $(whoami)

Updating

  1. Go to project folder
cd modufur
  1. Pull changes from repository
git pull
  1. Update virtual environment
poetry update
  1. Restart systemd user service
systemctl --user restart modufur

Uninstalling

  1. Stop and disable systemd user service
systemctl --user disable --now modufur
  1. Remove systemd user service file
rm ~/.config/systemd/user/modufur.service
  1. Optionally disable lingering
sudo loginctl disable-linger username
  1. Remove project folder
rm -rf modufur

Contributing

  1. Fork this repository on GitHub
  2. Make changes to the code
  3. Format the code with Black inside the project folder
    poetry run black .
    
  4. Commit the changes to the fork
  5. Create a pull request from the fork

FAQ

What happened to the public bot?

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.

Why can't I send explicit images to the bot?

Discord currently has no way to disable scanning content for bots.
You can send links uploaded elsewhere instead.

Credits

hikari
hikari-lightbulb
hikari-miru
songbird-py
pysaucenao