Skip to content
Internet Relay Chat bot
Python
Find file
Pull request Compare This branch is 112 commits ahead, 120 commits behind serpis:master.
Latest commit fcd72ad @dentarg Add simple Ansible deploy
Failed to load latest commit information.
data Include the data directoy in the reository
httpsrv removed executable on .py files
ircclient Unicode sandwich 🍞
plugins Remove leading and trailing whitespace from title
.gitignore Move bot configuration to environment variables
BUGS Added probable bug when shuting ircbot down..
README.md Update list of dependencies
ansible.cfg Add simple Ansible deploy
botnik.png
creds.txt remove all trailing whitespace
deploy.yml Add simple Ansible deploy
hosts Add simple Ansible deploy
ircbot.py Unicode sandwich 🍞
license.txt Grrr... Admin privilege check fixed now, probably needs restart :(
main.py remove all trailing whitespace
offline_tester.py Unicode sandwich 🍞
plugin_handler.py remove all trailing whitespace
settings.py Improve title channel list parsing

README.md

pynik

A Python IRC bot.

Environment variables

Configure your bot with the following environment variables:

Environment variable Description
SERVER IRC server the bot should connect to.
SERVER_PORT IRC server port.
NICK Nickname of the bot.
USERNAME Username part of the bot hostmask.
REALNAME Real name of the bot.
ADMINS Nicknames with bot admin privileges.
CHANNELS Channels the bot should join on start.
TITLE_CHANNELS Print the <title> of URLs in these channels.
twitter_consumer_key Twitter API key.
twitter_consumer_secret Twitter API secret.
twitter_access_token_key
twitter_access_token_secret

Twitter API keys are required by tweet.py. See dev.twitter.com for more info.

If you put the environment variables in a file named .env, you can use Honcho to start the bot.

Example of a .env file:

SERVER="irc.example.com"
SERVER_PORT="6667"
NICK="botnik"
USERNAME="botnik"
REALNAME="Freeze? I'm a robot. I'm not a refrigerator."
ADMINS="dentarg, serp"
CHANNELS="#foo, #bar, #baz"
TITLE_CHANNELS="#foo, #bar"

twitter_consumer_key=xxx
twitter_consumer_secret=xxx
twitter_access_token_key=xxx
twitter_access_token_secret=xxx

Dependencies

Pynik make use of the following Python libraries:

Development

Install dependencies for dependencies, most of them are for cryptography, which is used by requests.

sudo apt-get install -y build-essential libssl-dev libffi-dev python-dev python-setuptools

Install bot dependencies.

sudo easy_install pip

noglob sudo -H pip install --upgrade python-twitter requests[security] chardet beautifulsoup4 html5lib

Install Honcho if you don't have it

pip install honcho

Start the bot

honcho run python main.py
Something went wrong with that request. Please try again.