Skip to content

Add IRC chatbot example using RiveScript - #1

Merged
LilOleByte merged 1 commit into
mainfrom
cursor/irc-chatbot-example-c7dc
Sep 7, 2026
Merged

LilOleByte merged 1 commit into
mainfrom
cursor/irc-chatbot-example-c7dc

Conversation

@LilOleByte

Copy link
Copy Markdown
Owner

Adds eg/irc-bot, a RiveScript IRC chatbot that uses only the Ruby standard library (socket / openssl) and the sample brain in eg/brain.

The bot joins a channel and replies when:

  • a channel message starts with its nick (rsbot: hello or @rsbot hello)
  • someone sends a private message

Each IRC nick is used as the RiveScript username so per-user variables persist for the session.

Usage

ruby eg/irc-bot/bot.rb --help

IRC_HOST=irc.libera.chat IRC_PORT=6697 IRC_TLS=1 \
  IRC_NICK=rsbot IRC_CHANNEL=#botters-test ruby eg/irc-bot/bot.rb

Defaults connect to 127.0.0.1:6667 as rsbot in #rivescript so a casual ruby bot.rb does not hit a public network.

Tests

test/test_irc_bot.rb covers IRC line parsing, mention detection, password redaction, PING/PONG, mention vs unaddressed channel messages, private messages, and a handshake against a fake IRC server.

Open in Web Open in Cursor 

Introduce eg/irc-bot, a stdlib IRC adapter that loads the sample brain
and replies to nick mentions and private messages, with tests against a
fake IRC server.

Co-authored-by: LilOleByte <LilOleByte@users.noreply.github.com>
@LilOleByte
LilOleByte marked this pull request as ready for review September 7, 2026 10:53
@LilOleByte
LilOleByte merged commit fb5e93f into main Sep 7, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants