Skip to content

Instantly share code, notes, and snippets.

@stephenyeargin
Last active January 3, 2016 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save stephenyeargin/8465564 to your computer and use it in GitHub Desktop.
Save stephenyeargin/8465564 to your computer and use it in GitHub Desktop.
Hubot and ZNC. This is a quick set of tips on how to set up your Hubot to connect through ZNC to your IRC server (freenode, self hosted, etc.). It assumes you already know a bit about ZNC and configuring a Hubot.

This was a bit of a trick to get set up, so here it is for anyone who comes across it in search results.

ZNC User Account

  • Set up the account as usual (note the username and password)
  • Set the defualt buffer size to 0. Every time the bot reconnects after a crash, it would try to respond to the commands it hear or respond in the buffer, and might crash it again.
  • Go ahead and define a network and channel for your bot. Note the network name.
  • You should now see a "ghost" for your hubot connected.
  • Look at the ZNC user list. The hubot user will show 1 network, but 0 clients.

Hubot

If you are already using the IRC adapter, you just need to adjust some of the environment variables.

export HUBOT_IRC_SERVER="{servername}"
export HUBOT_IRC_PASSWORD="{username}/{network}:{password}"
export HUBOT_IRC_PORT="8080"
export HUBOT_IRC_ROOMS="#hubot"

Start the hubot through your normal process (supervisor, init.d, other daemon, etc.).

You should now see that one client is connected on the User tab in ZNC. If so, test your bot out in a connected channel.

That's it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment