Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Latest commit

 

History

History
86 lines (71 loc) · 4.31 KB

README.md

File metadata and controls

86 lines (71 loc) · 4.31 KB

RetroShareChatBot

C++ chat bot for RetroShare using the RPC interface.
The bot uses an options.conf file for configuration and you can change settings from a control lobby in real-time (this changes are not saved)
Have a look at the options.conf file for an example configuration.

What is Retroshare?

RetroShare is a secure decentralised communication platform:
http://retroshare.sourceforge.net/

For more information on the RetroShare RPC system check out the git repository of its developer: https://github.com/drbob/pyrs#readme

Features:

  • written in C++ to run as a daemon
  • automatically join specific lobbies / all lobbies available
  • automatically create lobbies if they are not available
  • automatic response system
  • bridge to IRC (multiple channels and servers (TODO server))
  • control lobby - control your bot through a (suggested private) chat lobby

The bot is also able to leave lobbies when someone writes a special phrase (e.g. "!kill")
If desired the lobby can then be added to a blacklist and the bot will stop auto-joining it.
This options are all configurable!

A few words to the code:

This is my first C++ project ... so be gentle. Also i'm not familiar with IRC. If you find odd things just look away (or tell me how to to it better) :P

Most things are tested (at least once) and the code should be quite stable - but i can't promise that it's 100% bug free.

There are several parts that are a horrible mess (like the IRC code) and i'd like to rewrite them in the future. But since they work i'll keep them for now.

Things you need:

The project is written in Code::Blocks and the Makefile was created with cbp2make (http://sourceforge.net/projects/cbp2make/)

How to build/run:

build: use Code::Blocks or just "make"
run: just run the executable in bin/Debug / bin/Release - there are no parameters (yet). The bot expects the options.conf to be in the same folder as the binary (for now)

Other things you might want to know:

  • Everything related to lobbies is done based on the lobby name! Having two lobbies with the (exact) same name will cause problems!
  • For now the bot only supports one IRC server (multiple channels are fine as long as they are on the same server)
  • I've only tested "normal" public IRC channels and i expect everything else to fail
  • The options.conf file parser is not very robust - if you mess around with the file the bot will mostly crash

Control lobby commands:

Every command starts with a special character (you can pick one in the options.conf file). I'll use '!' here

  • !lobbies lists all available lobbies with their topic and an indicator showing if the bot has joined them
  • !join name joins a lobby (use %all% for all lobbies)
  • !leave name leaves a lobby (use %all% for all lobbies)
  • !say name;text sends a message to a chat lobby (use %all% for all lobbies)
  • !options shows current settings
  • !commands shows available commands
  • !blacklist shows lobbies ion the lobby blacklist
  • !clearblacklist clears the lobby blacklist
  • !reload/ !restart restarts the bot (reloading of options.conf)
  • !off shuts down the bot

Change settings
all settings here require a '1' for on or a '0' for off (e.g. "!autojoin 0")
i use CamelCase here for better reading

  • !autoResponse enable/disable auto response
  • !autoCreate enable/disable lobby creation
  • !autoJoin enable/disable automatically joining of lobbies
  • !joinAllLobbies enable/disable automatically joining of all lobbies (needs !autojoin being on )
  • !leaveLobbies enable/disable leaving (all) lobbies when (the bot) is shut down
  • !leaveLobbyOnMsg enable/disable leaving on special phrase (like "!kill")
  • !useBlacklist enable/disable using blacklist when leaving lobby an command

A few words to the options.conf file:

The file is parsed line by line. A line staring with '#' is ignored.
There are several scopes starting with [name] marking a section of the file.