ircbotpoll.py - yougeek.dev

IRC Bot for creating polls
Install (Linux/Debian): # apt update # apt install python3 python3-venv python3-pip # mkdir -p /opt/ircbotpoll # wget -c "https://yougeek.dev/ircbotpoll/ircbotpoll.py" -O /opt/ircbotpoll/ircbotpoll.py # python3 -m venv /opt/ircbotpoll # source /opt/ircbotpoll/bin/activate # pip install --upgrade pip # pip install irc # useradd -m -s /bin/bash ircbot # chown ircbot:ircbot -R /opt/ircbotpoll Edit configuration: # vim /opt/ircbotpoll/ircbotpoll.py Replace these lines with your configuration: ######## CONFIGURATION (Edit with your settings) SERVER = "irc.example.net" PORT = 6667 USE_TLS = False NICK = "poll-bot" REALNAME = "IRC Poll Bot" CHANNELS = ["#support", "#geek"] ######### Add the bot at system startup. Create the file: # vim /etc/systemd/system/ircbotpoll.service Add the following: [Unit] Description=IRC Bot Poll After=network.target [Service] Type=simple User=ircbot Group=ircbot WorkingDirectory=/opt/ircbotpoll Environment=PATH=/opt/ircbotpoll/bin ExecStart=/opt/ircbotpoll/bin/python3 /opt/ircbotpoll/ircbotpoll.py Restart=on-failure RestartSec=5s KillMode=process [Install] WantedBy=multi-user.target Add the service at startup and start it: # systemctl daemon-reload # systemctl enable ircbotpoll # systemctl start ircbotpoll Syntax: !poll [question] !vote [option] !results !endpoll How to uninstall: # rm -rf /opt/ircbotpoll # rm -rf /etc/system/system/ircbotpoll.service # deluser ircbot