
Show HN: Ultra Easy Creating IRC Bot with New Python Mod - robinmanoli
https://github.com/RobinManoli/ircutil
======
robinmanoli
Although having coded for many years, this is my first open source project
ever released!

I have been running my own IRC-bot on it, being stable for a few months.

Thanks for checking it out ^^

~~~
brudgers
Curious about background readings for IRC chatbots that might be helpful for
someone interested in the topic...the tutorial seems a bit schematic.

~~~
robinmanoli
I'm not really sure what you can read about it. Are you familiar with IRC? IRC
is a text chat protocol which has been active a long time before Facebook, MSN
and even ICQ.

So an IRC bot is a kind of service for IRC chatrooms. IRC bots may define
words from a dictionary, do google searches, and so on. Usually the bots
answer commands such as !define some_word or !google my search.

You can read more on wikipedia:
[https://en.wikipedia.org/wiki/IRC_bot](https://en.wikipedia.org/wiki/IRC_bot)
and
[https://en.wikipedia.org/wiki/Internet_Relay_Chat](https://en.wikipedia.org/wiki/Internet_Relay_Chat)

You are right about the tutorial. I was thinking that if one is familiar with
IRC it should be quite easy to get started with this.

~~~
brudgers
Sure I've used IRC. That's a long way from programming against it.

I asked the question because I believe there are many professional developers
who have a similar knowledge gap despite having vastly more programming
experience than me.

That seems to often be the case with older technologies internet technologies.
I mean it's probably easier to point to resources for writing Slack bots than
an IRC bot.

~~~
robinmanoli
Well, I'm not sure what you are really after. I think you can find tutorials
for established bot modules, such as eggdrops or how to write an irssi script.

The tutorial I made is based on the code provided in the examples. There are
some common bot functions there, and explanations, which might be enough to
get started with your own.

Did you look at my examples which were mentioned in the tutorial?
[https://github.com/RobinManoli/ircutil/blob/master/examples/...](https://github.com/RobinManoli/ircutil/blob/master/examples/get_started_bot.py)
[https://github.com/RobinManoli/ircutil/blob/master/examples/...](https://github.com/RobinManoli/ircutil/blob/master/examples/tutorbot.py)

One point with my module is that you can access IRC as raw text. (See how
event.raw is used in get_started_bot.py). If you run this bot, you can observe
how IRC looks like in text mode. Already from there you can parse any of those
lines of text with Python to get started with your own bot.

Then you can use event helpers, (see examples). For example, if you want to
respond to a message you use:

if event.MSG: ...

and to send a message, use:

mybot.msg(channel_or_nickname, mymessage)

~~~
brudgers
Thanks. I appreciate it.

