Advertisement
Guest User

Untitled

a guest
Sep 10th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. var irc = require("irc");
  2. var a = "!tb echo test"
  3. var prefix = "!tb " // this tells the bot to listen to !tb before commands
  4. var bot = new irc.Client("irc.caffie.net", "TomBot", {
  5. userName : "TomBot",
  6. realName : "realname",
  7. password : "", // this isnt mentioned in the object for some reason (only use if logging in)
  8. port : 6667,
  9. debug : true,
  10. showErrors : true,
  11. auchannelRejoin : true,
  12. auchannelConnect : true,
  13. channels : ["#hellwithLDA"],
  14. secure : false,
  15. selfSigned : false,
  16. certExpired : false,
  17. floodProtection : false,
  18. floodProtectionDelay : 1000,
  19. sasl : false,
  20. stripColors : false,
  21. channelPrefixes : "&#",
  22. messageSplit : 512,
  23. });
  24.  
  25. bot.addListener("message", function (user, channel, message, obj) {
  26. if (message == prefix + "hello") {
  27. bot.say(channel, "Hello, " + user + "!");
  28. }
  29. });
  30.  
  31. //Owner only command
  32. bot.addListener("message", function (user, channel, message, obj) {
  33. if (message == prefix + "echo") {
  34. if (obj.host == "caffie-828CA7C9.lightspeed.livnmi.sbcglobal.net") {
  35. bot.say(channel, "" + a.split(/+/).slice(2).join(" ") + "");
  36. }
  37. else {
  38. bot.say(channel, "Error: You do not have sufficient permissions!");
  39. }
  40. }
  41. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement