An IRC bot to be entered into cplusplus.com community competition
C++
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
include
src
.gitignore
README.md

README.md

aBot

An IRC bot written for a cplusplus.com community competition.

Dependencies:

Planned features:

  • Log channel activity -messages, join + parts, and possibly global notices
    • Store logs in std::vector<>
    • Set max size, if met write log to file
    • Write multiple logs, numbered ie: chatlog_.txt
  • Keep user log (users who enter channel) and keep list of join+part combos --Not currently written to disk
  • Automatically reconnect to server and channel
  • receive commands from channel and privmsg
  • results sent same manner as received (ie: if command from privmsg answer should be a privmsg)
  • implement command !lastseen [username] --get date + time last time [username] logged on
  • implement command !tell [public|private] [user] [message] --send [message] to [username] when they log back in, sent to channel if public or via privmsg if private -- NOTE: All params required!
  • implement command !quit -- quits current channel
  • implement command !join [channel] --quits current channel and joins specified channel
  • implement command !help --print help message to channel
  • implement command !exit -- shutsdown client after saving chat log data (if any) to disk
  • OPTIONAL implement command !weather [zip] | [city] [state|province|country] *2 letter abbreviation get current weather conditions for specified location
  • OPTIONAL implement command !cowsay --display a cow saying a fortune http://en.wikipedia.org/wiki/Cowsay Uses I heart quotes API http://iheartquotes.com/api

Usage:

abot <nick> <server> <channel>optional <port>optional
EX: >aBot abot_9333 "irc.freenode.net" "#chessplusplus" "6667"

Building:

Tested with:

  • Visual Studio 2012:
    • Create new project from existing source
  • GCC compile with:
    • g++ -o abot -std=c++11 -Iinclude src/Message.cpp src/Connection.cpp src/Utility.cpp src/Logger.cpp src/Bot.cpp src/main.cpp -lWs2_32 -lboost_system -lboost_filesystem -lboost_date_time -lboost_regex
  • MinGW compile with:
    • g++ -o abot -std=c++11 -D_WIN32_WINNT=0x0501 -DWINVER=0x0501 -Iinclude src/Message.cpp src/Connection.cpp src/Utility.cpp src/Logger.cpp src/Bot.cpp src/main.cpp -lWs2_32 -lboost_system -lboost_filesystem -lboost_date_time -lboost_regex

Issues:

  • Logging does not handle redirects (logs list intended channel not the acctual channel)
  • Not curenntly handling any exceptions

Thanks:

To Thumperrr for the use of his regex (and his idea of encapsulating irc messages)