simonbs
simonbs

Reputation: 8042

Python IRC bot with support for plugins and not command only

I have just made a script in Python which will connect to my MySQL database every XX second and check for new posts on my forum. If there are any new posts, I would like to have the user's of my IRC channel notified. To do this I need to hook up my script with an IRC bot. I have been searching around to find an IRC bot which supports plugins which are not only called by commands (e.g. ".google example") as I would like my script to be running constantly and when new posts are found have the bot print a message.

Does anyone know of an IRC bot which would allow me to do that?

Upvotes: 0

Views: 744

Answers (4)

Fabian
Fabian

Reputation: 4348

You could always take a look at Twisted, which is supposed to make it very easy for you to create your own IRC bot:

http://twistedmatrix.com/documents/10.0.0/api/twisted.words.protocols.irc.IRC.html

Upvotes: 1

simonbs
simonbs

Reputation: 8042

I am using the Twisted Library as suggested by @Fabian. Following the guide below, you will end up having a good skeleton for an IRC but which is easily extendable with your own plugins.

http://www.eflorenzano.com/blog/post/writing-markov-chain-irc-bot-twisted-and-python/

Upvotes: 0

Xion
Xion

Reputation: 22770

As a kind of shameless plug, I will point to the IRC bot that I have developed with ease of extensibility in mind (via plugins and custom commands):

While its plugins are generally meant to be driven by IRC events (such as an user joining a channel) and not a time-based "ticks", I think it would be feasible to utilize the "someone said something on channel" (message) event as a trigger for your database poll.

If you would like to play with this thing, I recommend looking at already existing plugins - especially the memo one.

Upvotes: 0

Adrien Plisson
Adrien Plisson

Reputation: 23303

you should easily find a python IRC client library which would let you do (almost) anything you want directly from your python script.

the Python Package Index (aka. pypi) lists some irc client libraries...

Upvotes: 0

Related Questions