Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var irc = require("irc");
- var a = "!tb echo 'Error: No input specified!'"
- var prefix = "!tb " // this tells the bot to listen to !tb before commands
- var bot = new irc.Client("irc.caffie.net", "TomBot", {
- userName : "TomBot",
- realName : "realname",
- password : "", // this isnt mentioned in the object for some reason (only use if logging in)
- port : 6667,
- debug : true,
- showErrors : true,
- auchannelRejoin : true,
- auchannelConnect : true,
- channels : ["#hellwithLDA"],
- secure : false,
- selfSigned : false,
- certExpired : false,
- floodProtection : false,
- floodProtectionDelay : 1000,
- sasl : false,
- stripColors : false,
- channelPrefixes : "&#",
- messageSplit : 512,
- });
- bot.addListener("message", function (user, channel, message, obj) {
- if (message == prefix + "hello") {
- bot.say(channel, "Hello, " + user + "!");
- }
- });
- //Owner only command
- bot.addListener("message", function (user, channel, message, obj) {
- if (message == prefix + "echo") {
- if (obj.host == "caffie-828CA7C9.lightspeed.livnmi.sbcglobal.net") {
- bot.say(channel, "" + a.substr(a.search(/\s\w/)/+1, a.length) + "");
- }
- else {
- bot.say(channel, "Error: You do not have sufficient permissions!");
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement