The ircBot

A newly released IRC Bot that helps with channel management

Coded in C for efficiency, The ircBot was designed to help with the management of channels, sometimes referred to as chat rooms, on IRC.

I needed a bot to help manage a channel with a friend a few years ago, so I made this bot. I debated whether to release the source code, and here it finally is. Enjoy. As it's open source software, I probably should say share and enjoy.

Designed for Linux, it probably could be compiled for Windows with some changes. I'll get to that soon.

Usage

The setup script allows installing to /usr/local/bin/ircBot, or compile and run from the directory where the source code is located.

Testing

If you're modifying the bot, you might want to test it on an IRC server on your own computer. To install a small IRC server for testing, try the following command:

sudo apt install ngircd

Configuration

The folder from which the program is run must contain a cfg.txt file, or one will be generated. The default config has the bot try to connect to an IRC server on your own machine. Here's another example of a good cfg.txt file:

irc.prison.net
EdAnger

%supernets hardchats

#ircBot
=Ron's IRC bot - http://rockymount.us?s=ircbot&d=Ron
~We welcome %s!

@	*	75.110.42.24

The first line of the cfg.txt file contains the address to connect to. The second line contains the nick, or name, for the bot to use.

Then, there are the following kinds of entries.

A line starting with > tells whom to forward private messages to. In case someone communicates to the bot privately, the bot will notify the specified nick.

A line starting with @ tells the nick and address of a channel operator. Either can be * to match anything. These users will be given operator mode by the bot upon joining.

A line starting with - tells the nick and address of a banned user. Either can be * to match anything. These users will be kicked upon joining.

A line starting with % specifies banned words. Users who say these will be kicked.

A line that starts with # indicates a channel to join.

Channels may have any or all of these options:

A line starting with ! specifies a file containing news alerts. When the bot sees that the contents of the file have changed, it announces those contents in the channel unless too short or long. It's ok if the file doesn't exist.

A line starting with = tells the topic for the channel. The bot will only set the topic in some conditions. If not provided, the bot will never set the topic.

A line starting with ~ specifies a greeting to tell to users who join. Include %s for the user's nick. Operators receive no greeting. If not provided, the bot will never tell a greeting.

A line starting with ^ specifies the flags for the channel.

These are the flags that are currently available:

r Rejoin when not present in channel after a ping or two.

Changelog

1.0 Initial release

1.1 More resilient connection, changes nick if needed, checks all allocated memory.

More features will probably be coming.




Page generated in 0.139088 seconds.

© 2024 RockyMount.US