I'm learning Python and would like to start a small project. It seems that making IRC bots is a popular project amongst beginners so I thought I would implement one. Obviously, there are core functionalities like being able to connect to a server and join a channel but what are some good functionalities that are usually included in the bots? Thanks for your ideas.
I'm also in the process of writing a bot in node.js. Here are some of my goals/functions:
- map '@' command so the bot detects the last URI in message history and uses the w3 html validation service
- setup a trivia game by invoking !ask, asks a question with 3 hints, have the ability to load custom questions based on category
- get the weather with
weather
[zip/name] - hook up
jseval
command to evaluate javascript, same for python and perl and haskell seen
command that reports the last time the bot has "seen" a person online- translate command to translate X language string to Y language string
- map
dict
to a dictionary service - map
wik
to wiki service
Unless it's solely for the educational experience, you should really just use a framework for the core functionality.
That said, here's some of the things the bot in my home IRC channel does:
- Choose one item from a list of options
- Display a random entry from the Linux fortunes file
- Display a random set of words from the Emacs spook file
- Check every line from a user and display a quote from The Big Lebowski if it's sufficiently similar (this is probably a bit my-channel specific :) )
- Check if a link has been mentioned before and say who/when (we all read the same RSS feeds and tend to duplicate links a lot)
- Conduct a poll
- Pull a given quote from our internal QDB
- Check if a given link has been posted to Reddit, and give the corresponding Reddit thread link if so. If a Reddit link is posted, give the direct link instead
- Track the last time a given nick was in the channel, and the last time they spoke
- Queue a message for an offline nick that's automatically sent in-channel when they join
- Use Google Translate to translate a given phrase
- Post a given line to our channel's Twitter feed
- Choose a random user and kick them (not the best idea depending on how unruly your channel is)
- Pull the summary of a given term from Wikipedia and display it along with a link to the full article
- Display information about any posted Youtube link (video title, length, submitter, votes, comments, etc.)
Make a google search to get a library that implements IRC protocol for you. That way you only need to add the features, those are already something enough to bother you.
Common functions:
- Conduct a search from a wiki or google
- Notify people on project/issue updates
- Leave a message
- Toy for spamming the channel
- Pick a topic
- Categorize messages
- Search from channel logs
Again, this is an utterly personal suggestion, but I would really like to see eggdrop rewritten in Python.
Such a project could use Twisted to provide the base IRC interaction, but would then need to support add-on scripts.
This would be great for allowing easy IRC bot functionality to be built upon using python, instead of TCL, scripts.