limiter | ||
secrets | ||
utils | ||
.gitignore | ||
activity.log | ||
bot.py | ||
config.sample.txt | ||
LICENSE | ||
README.md | ||
requirements.txt | ||
TootHTMLParser.py |
masto-image-bot
Un bot qui récupère une image random en local et la publie
Copiez le fichier config.sample.txt
en config.txt
, ajoutez le chemin de votre dossier image.
Remplissez le fichier secrets/secrets.txt
et remplissez le avec les code que vous trouverez dans l'onglet développeur de votre compte Mastodon.
Configure it
Copy config.sample.txt
to config.txt
and replace data by your data.
If you don't want any "spoiler text", just leave the line empty.
Actually, bot limit request at 4 per minute per person. Later, a make it configurable on config file.
Field name | Description | Value |
---|---|---|
img_path | Path where image are located | /home/bot/img |
name | Name of your bot (name after @). Is usefull to hide it's name in reply | mybot |
sensitive | Hide picture behind "sensitive content" mask or not | yes |
default_text | Text for --img option | string |
spoiler_text | Text for every spoiler (or CW) (for --img or --stream option) | string |
limit | Limit send per minute per person | int |
Use it
usage: bot.py [-h] [-i] [-s]
Choose between image or streaming
optional arguments:
-h, --help show this help message and exit
-i, --img post image
-s, --stream stream user profile
--img
option send image.
--stream
option send image on mention
Create a systemd service
On /etc/systemd/system/bot.service
copy paste code behind
[Unit]
Description=Image bot Mastodon
Documentation=https://git.drycat.fr/Dryusdan/masto-random-local-image-bot/src/branch/master
Requires=network.target
After=network.target
[Service]
Type=simple
User=masto-bot
TimeoutSec=15
WorkingDirectory=/home/masto-bot/
ExecStart=/usr/bin/python3 bot.py --stream