Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/data/tripCodes.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
"snake": "aSLQOY",
"leonardo": "mj87ss",
"Staticguy": "KbGeN+",
"Chaos": "V8We7p"
}
"Chaos": "V8We7p",
"_0x17": "leAybC"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks outdated

}
12 changes: 8 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ var config = require("./config.json");

fs.readdir("./src/commands", function(err, files)
{
if(err)
throw err;
if(err) throw err;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please dont reformat in feature PRs


var bot = new ChatConnection(config.url, config.nick, config.channel);

Expand Down Expand Up @@ -44,10 +43,15 @@ fs.readdir("./src/commands", function(err, files)
{
console.log(data.nick + ": " + data.text);

var lowerCaseNick = data.nick.toLowerCase();

if(data.nick == config.nick)
return;

if(this.bans.indexOf(data.nick.toLowerCase()) !== -1)
if(lowerCaseNick.substr(-3) == 'bot') // Don't reply to bots
return;

if(this.bans.indexOf(lowerCaseNick) !== -1)
return;

var msg = data.text;
Expand All @@ -57,7 +61,7 @@ fs.readdir("./src/commands", function(err, files)
var cmd = args[0].toLowerCase();
var args = args.slice(1);

if(typeof this.commands[cmd] == 'function' && this.commands.hasOwnProperty(cmd))
if(this.commands[cmd] instanceof Function && this.commands.hasOwnProperty(cmd))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instanceof throws an exception when this.commands[cmd] is undefined

this.commands[cmd](this, data.nick, args, data);
}
}
Expand Down