Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1. "use strict"
  2.  
  3. /*
  4. Imports
  5. */
  6.  
  7. let IrcClient = require("irc").Client;
  8.  
  9. /*
  10. Constants
  11. */
  12.  
  13. const CONFIG = {
  14. server: "irc.rizon.net",
  15. channels: ["##pasta"],
  16. ignoreList: ["CummyPawsBot", "Combot", "PastaBot", "cuckbot", "kekbot", "pepebot", "katbot"],
  17. nick: "ghost_bot",
  18. userName: "username",
  19. realName: "man",
  20. nickservEnabled: true,
  21. nickservPass: "userpass",
  22. };
  23.  
  24. const TOMBSTONE = [
  25. " / ̄ ̄ ̄\\\\ ☆ *",
  26. " ☆ | R.I.P. || ☆ ",
  27. " | ~----~ || *",
  28. "――٩―|________||✿。――――/―ノ―――ヾ―――",
  29. ];
  30.  
  31. const FACES = [
  32. "(ц`ω´ц*)",
  33. "“ψ(`∇´)ψ",
  34. "ψ(*`ー´)ψ",
  35. "Ψ(`▽´)Ψ",
  36. "Ψ(`◇´)Ψ",
  37. "(屮`∀´)屮",
  38. "Щ(・`ω´・Щ)",
  39. "Ψ( ̄∀ ̄)Ψ",
  40. "Ψ(☆w☆)Ψ",
  41. "Ψ( ●`▽´● )Ψ",
  42. "ψ(`Д´)ψ",
  43. "ლ(`∀´ლ)",
  44. "<(●`∀´●)>”",
  45. "o(○`ω´○)9",
  46. "ρ(`.´)ρ",
  47. "पुनः कदा मेलिष्यामः ?"
  48. ];
  49.  
  50. /*
  51. Functions
  52. */
  53.  
  54. function randomFromArray(arr) {
  55. return arr[Math.floor(Math.random() * arr.length)];
  56. }
  57.  
  58. /*
  59. Program
  60. */
  61.  
  62. {
  63. let bot = new IrcClient(CONFIG.server, CONFIG.nick, CONFIG);
  64.  
  65. bot.addListener("message", (nick, to, message) => {
  66. if (CONFIG.ignoreList.indexOf(nick) >= 0) {
  67. return;
  68. }
  69.  
  70. message.split(" ").forEach((element) => {
  71. let word = element.toLowerCase().replace(/[^a-z]+/g, "");
  72.  
  73. switch (word) {
  74. case "rip":
  75. TOMBSTONE.forEach((line, i) => {
  76. setTimeout((line) => {
  77. bot.say(to, line);
  78. }, 1000 * i, line);
  79. });
  80. break;
  81. case "spooky":
  82. case "scary":
  83. case "skeletons":
  84. bot.say(to, randomFromArray(FACES));
  85. break;
  86. case "kys":
  87. case "kms":
  88. case "dead":
  89. bot.say(to, "/(x~x)\ अजीव");
  90. break;
  91. case "holy":
  92. case "israel":
  93. bot.say(to, "ゞ◎Д◎ヾ धावनं करोति { कृ }");
  94. break;
  95. case "ghost_bot":
  96. bot.say(to, "(((╬ ╬) ईङ्खति ");
  97. break;
  98. }
  99. });
  100. });
  101.  
  102. bot.addListener("ctcp-version", (nick, to, message) => {
  103. bot.notice(nick, "\u0001VERSION ayylmao\u0001");
  104. });
  105.  
  106. bot.on("error", (message) => {
  107. console.log(message);
  108. return;
  109. });
  110.  
  111. bot.on("registered", () => {
  112. if (CONFIG.nickservEnabled) {
  113. bot.say("NickServ", `IDENTIFY ${CONFIG.nickservPass}`);
  114. }
  115. });
  116.  
  117. bot.on("invite", (channel, nick) => {
  118. bot.join(channel);
  119. bot.say(channel, `${nick} here lies ghost bot, rip jones McCucky!`);
  120. return;
  121. });
  122. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement