Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Added options and code to enable ssl and use a specific port. #12

Merged
merged 1 commit into from 5 months ago

2 participants

Jacques Uber Mike Cooper
Jacques Uber

If the 'password' key exists in the irc settings section, the bot will attempt to use that password to register it's nick with nickserv.

Hack hack hack.

Jacques Uber uberj Added options and code to enable ssl and use a specific port.
If the 'password' key exists in the irc settings section, the bot will attempt to use that password to register it's nick with nickserv.
8cf6092
Mike Cooper
Owner

Nice. You should have it check to see how nickserv responded. Since it is already good at talking to nickserv, maybe integrate this in with AuthManager?

Mike Cooper mythmon merged commit e32afa4 into from
Jacques Uber uberj deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Aug 27, 2012
Jacques Uber uberj Added options and code to enable ssl and use a specific port.
If the 'password' key exists in the irc settings section, the bot will attempt to use that password to register it's nick with nickserv.
8cf6092
This page is out of date. Refresh to see the latest.

Showing 2 changed files with 16 additions and 1 deletion. Show diff stats Hide diff stats

  1. +3 0  config-sample.json
  2. +13 1 standup-irc.js
3  config-sample.json
@@ -8,6 +8,9 @@
8 8 "host": "irc.server.com",
9 9 "channels": ["#channel1", "#channel2"],
10 10 "nick": "standup"
  11 + "password": "password_for_nick", // If this key exists, the bot will try to identify with nickserv
  12 + "ssl": false,
  13 + "port": 6667 // 6697 for ssl
11 14 },
12 15 "log": {
13 16 "console": true,
14 standup-irc.js
@@ -74,7 +74,9 @@ if (config.pg.enabled) {
74 74
75 75 // Global client
76 76 irc_client = new irc.Client(config.irc.host, config.irc.nick, {
77   - channels: config.irc.channels
  77 + channels: config.irc.channels,
  78 + port: config.irc.port,
  79 + secure: config.irc.ssl
78 80 });
79 81
80 82 // Connected to IRC server
@@ -85,6 +87,16 @@ irc_client.on('registered', function(message) {
85 87 config.irc.realNick = message.args[0];
86 88 logger.info('Using nickname: ' + config.irc.realNick);
87 89
  90 +});
  91 +
  92 +// Wait for message of the day and decide whether we want to register our nick.
  93 +irc_client.addListener('motd', function (motd) {
  94 + logger.info('Seen MOTD');
  95 + if (config.irc.password) {
  96 + logger.info('Identifying with Nickserv');
  97 + irc_client.say('nickserv', 'identify ' + config.irc.password);
  98 + }
  99 +
88 100 // Check for additional channels and join
89 101 if (pg_client) {
90 102 var query = pg_client.query("SELECT id FROM channels");

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.