/OPbot

IRC bot that OPs people in the whitelist when they join the channel

Primary LanguagePython

OpBot

This is an irc bot with the following functionalities:

  • Gives people that are on a whitelist op when they join the channel.
  • Checks the weather by using the yr.no service. .w [city]
  • Converts currencies using the http://www.google.com/finance/converter service. .ex [amount] [fromCurrency] [toCurrency]
  • If a link is posted in the channel it gets the link title and posts it in the chat.
  • Magic 8-ball .8ball [question]

Setup

Change these values in settings.conf before usage:

nick = BotNick
server = Irc.Server
port = IrcPort
channel = #IrcChannel
whitelist = nick1,nick2,nick3

Usage

  • Run with python python opbot.py
  • The bot needs op before it can give op to others
  • The weather function can be called by typing .weather [city] in the channel
  • For more information on the weather service, please refer to https://github.com/KarlHerler/yr-py

Database

  • For the weather service we need correct geonames for all cities.
  • City names and geonames are saved in a sqlite3 database. (geonames.sql)
  • The database has one table called cities. It consists of two varchar fields: city and geoname.

Example data:

city              geoname                                
----------------  ---------------------------------------
sutton-coldfield  United_Kingdom/England/Sutton_Coldfield
gillingham        United_Kingdom/England/Gillingham~26486
worthing          United_Kingdom/England/Worthing~2633521
hastings          United_Kingdom/England/Hastings        
london            United_Kingdom/England/London          
birmingham        United_Kingdom/England/Birmingham