A Python IRC Bot
A Python IRC Bot
sudo apt install python3-mysqldb
sudo pip3 install --upgrade PyMySQL
sudo pip3 install --upgrade irc lxml tmdbsimple wolframalpha prettytable psutil pony requests
$TEHBOTDIR
cd $TEHBOTDIR
python3 -m tehbot
Tehbot has a command line interface which accepts the following commands:
reload
— reloads all plugins and applies all changes made to tehbot’s connectionsquit
— quits tehbot (optional arguments are supplied as quit message)stats
— shows some statistics about connected networks’ status and period command pluginsconfig
— edit or show tehbot’s settingsconfig global set botname "mytehbot"
— set tehbot’s name to mytehbot
config global set ircname "mytehbot"
— set tehbot’s irc name to mytehbot
config global set username "mytehbot"
— set tehbot’s user name to mytehbot
config global set cmdprefix "!"
— set tehbot’s command prefix to !
(tehbot will react to IRC messages that start with !
)config global add connection ircnet irc.network.org 7000
— add ircnet as IRC network tehbot should connect toconfig connection ircnet set ssl "True"
config connection ircnet add channels #channel1
config connection ircnet add channels #channel2
channelkeyconfig connection ircnet add operators your_nickserv_regged_nick1
config connection ircnet add operators your_nickserv_regged_nick2
Optionally:
config connection ircnet set botname "tehnetworkbot"
— set a network specific name tehbot should useconfig connection ircnet set password "********"
— set a NICKSERV password tehbot should use to authenticateconfig connection ircnet set host "irc.network.org"
config connection ircnet set port 7000
config channel ircnet #channel1 set password "********"
— set channel password for this channelconfig channel ircnet #channel1 set logging False
— turn off logging for this channelconfig plugin PingPlugin set enabled True