Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.41 KB | None | 0 0
  1. const Discord = require("discord.js");
  2. const TOKEN = "NjMyNDA3MDE3NTI0NDI4ODAw.XaE-lQ.THjKDaaSkgdjMXcLdRNnJ7e3aa0";
  3. const PREFIX = "0£0$";
  4. var bot = new Discord.Client();
  5. const Halloween = "October";
  6. const Christmas = "December";
  7. const Easter = "April";
  8. var objToday = new Date(),
  9. weekday = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'),
  10. dayOfWeek = weekday[objToday.getDay()],
  11. domEnder = function() { var a = objToday; if (/1/.test(parseInt((a + "").charAt(0)))) return "th"; a = parseInt((a + "").charAt(1)); return 1 == a ? "st" : 2 == a ? "nd" : 3 == a ? "rd" : "th" }(),
  12. dayOfMonth = today + ( objToday.getDate() < 10) ? '0' + objToday.getDate() + domEnder : objToday.getDate() + domEnder,
  13. months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'),
  14. curMonth = months[objToday.getMonth()],
  15. curYear = objToday.getFullYear(),
  16. curHour = objToday.getHours() > 12 ? objToday.getHours() - 12 : (objToday.getHours() < 10 ? "0" + objToday.getHours() : objToday.getHours()),
  17. curMinute = objToday.getMinutes() < 10 ? "0" + objToday.getMinutes() : objToday.getMinutes(),
  18. curSeconds = objToday.getSeconds() < 10 ? "0" + objToday.getSeconds() : objToday.getSeconds(),
  19. curMeridiem = objToday.getHours() > 12 ? "PM" : "AM";
  20. var today = curMonth
  21. var dmDate = `It was asked at | _${curMonth} ${dayOfMonth} ${curYear} At ${curHour}${curMeridiem} and ${curMinute} minutes_`
  22.  
  23. bot.on("ready", function(){
  24. console.log("Running");
  25. if(Halloween === curMonth) {
  26. bot.user.setUsername("🎃TARS")
  27. console.log("Halloween TARS")
  28. };
  29. if(Christmas === curMonth) {
  30. bot.user.setUsername("🎅TARS")
  31. console.log("Christmas TARS")
  32. };
  33. if(Easter === curMonth) {
  34. bot.user.setUsername("🐇TARS")
  35. console.log("Easter TARS")
  36. };
  37. if(Easter != curMonth) {
  38. if(Christmas != curMonth) {
  39. if(Halloween != curMonth) {
  40. bot.user.setUsername("TARS")
  41. console.log("No ongoing events")
  42. };
  43. };
  44. };
  45. });
  46.  
  47. bot.on("message", function(message) {
  48. if (message.author.equals(bot.user)) return;
  49. var args = message.content.toLowerCase().split(" ");
  50. var answermessage = message.content.toLowerCase();
  51. var serverdm = message.guild;
  52. var usersMessage = message.author;
  53. console.log(usersMessage);
  54.  
  55.  
  56. console.log(args);
  57. if (answermessage.includes("what is tars")) {
  58. message.reply("contacting <@224237621503721475>, please wait.")
  59. bot.users.get("224237621503721475").send(`Hey, someone is trying to ask what I am in ${serverdm}. Would you mind answering them?
  60. ${usersMessage}\'s message is:
  61.  
  62. \`${answermessage}\`
  63.  
  64. ${dmDate}`)
  65. };
  66. if (answermessage.includes("who is tars")) {
  67. message.reply("contacting <@224237621503721475>, please wait.")
  68. bot.users.get("224237621503721475").send(`Hey, someone is trying to ask who I am in ${serverdm}. Would you mind answering them?
  69. ${usersMessage}\'s message is:
  70.  
  71. \`${answermessage}\`
  72.  
  73. ${dmDate}`)
  74. };
  75. if (answermessage.includes("what does tars do")) {
  76. message.reply("contacting <@224237621503721475>, please wait.")
  77. bot.users.get("224237621503721475").send(`Hey, someone is trying to ask what I do in ${serverdm}. Would you mind answering them?
  78. ${usersMessage}\'s message is:
  79.  
  80. \`${answermessage}\`
  81.  
  82. ${dmDate}`)
  83. };
  84. if (answermessage.includes("whats tars")) {
  85. message.reply("contacting <@224237621503721475>, please wait.")
  86. bot.users.get("224237621503721475").send(`Hey, someone is trying to ask what I am in ${serverdm}. Would you mind answering them?
  87. ${usersMessage}\'s message is:
  88.  
  89. \`${answermessage}\`
  90.  
  91. ${dmDate}`)
  92. };
  93. if (answermessage.includes("what\'s tars")) {
  94. message.reply("contacting <@224237621503721475>, please wait.")
  95. bot.users.get("224237621503721475").send(`Hey, someone is trying to ask what I am in ${serverdm}. Would you mind answering them?
  96. ${usersMessage}\'s message is:
  97.  
  98. \`${answermessage}\`
  99.  
  100. ${dmDate}`)
  101. };
  102. if (answermessage.includes("whos tars")) {
  103. message.reply("contacting <@224237621503721475>, please wait.")
  104. bot.users.get("224237621503721475").send(`Hey, someone is trying to ask who I am in ${serverdm}. Would you mind answering them?
  105. ${usersMessage}\'s message is:
  106.  
  107. \`${answermessage}\`
  108.  
  109. ${dmDate}`)
  110. };
  111. if (answermessage.includes("who\'s tars")) {
  112. message.reply("contacting <@224237621503721475>, please wait.")
  113. bot.users.get("224237621503721475").send(`Hey, someone is trying to ask who I am in ${serverdm}. Would you mind answering them?
  114. ${usersMessage}\'s message is:
  115.  
  116. \`${answermessage}\`
  117.  
  118. ${dmDate}`)
  119. };
  120. if (answermessage.includes("who made tars")) {
  121. message.reply("contacting <@224237621503721475>, please wait.")
  122. bot.users.get("224237621503721475").send(`Hey, someone is trying to ask who created me in ${serverdm}. Would you mind answering them?
  123. ${usersMessage}\'s message is:
  124.  
  125. \`${answermessage}\`
  126.  
  127. ${dmDate}`)
  128. };
  129. if (answermessage.includes("who created tars")) {
  130. message.reply("contacting <@224237621503721475>, please wait.")
  131. bot.users.get("224237621503721475").send(`Hey, someone is trying to ask who created me in ${serverdm}. Would you mind answering them?
  132. ${usersMessage}\'s message is:
  133.  
  134. \`${answermessage}\`
  135.  
  136. ${dmDate}`)
  137. };
  138. if (answermessage.includes("wtf is tars")) {
  139. message.reply("contacting <@224237621503721475>, please wait.")
  140. bot.users.get("224237621503721475").send(`Hey, someone is trying to ask what I am in ${serverdm}. Would you mind answering them?
  141. ${usersMessage}\'s message is:
  142.  
  143. \`${answermessage}\`
  144.  
  145. ${dmDate}`)
  146. };
  147. if (answermessage.includes("what the fuck is tars")) {
  148. message.reply("contacting <@224237621503721475>, please wait.")
  149. bot.users.get("224237621503721475").send(`Hey, someone is trying to ask what I am in ${serverdm}. Would you mind answering them?
  150. ${usersMessage}\'s message is:
  151.  
  152. \`${answermessage}\`
  153.  
  154. ${dmDate}`)
  155. };
  156. if (answermessage.includes("how was tars created")) {
  157. message.reply("Contacting <@224237621503721475>, please wait.")
  158. bot.users.get("224237621503721475").send(`Hey, someone is trying to ask how I was made in ${serverdm}. Would you mind answering them?
  159. ${usersMessage}\'s message is:
  160.  
  161. \`${answermessage}\`
  162.  
  163. It was sent at ${dmDate}`)
  164. };
  165. if (answermessage.includes("how was tars made")) {
  166. message.reply("Contacting <@224237621503721475>, please wait.")
  167. bot.users.get("224237621503721475").send(`Hey, someone is trying to ask how I was made in ${serverdm}. Would you mind answering them?
  168. ${usersMessage}\'s message is:
  169.  
  170. \`${answermessage}\`
  171.  
  172. It was sent at ${dmDate}`)
  173. };
  174. if (answermessage.includes("how did tars get created")) {
  175. message.reply("Contacting <@224237621503721475>, please wait.")
  176. bot.users.get("224237621503721475").send(`Hey, someone is trying to ask how I was made in ${serverdm}. Would you mind answering them?
  177. ${usersMessage}\'s message is:
  178.  
  179. \`${answermessage}\`
  180.  
  181. ${dmDate}`)
  182. };
  183. if (answermessage.includes("how did tars get made")) {
  184. message.reply("Contacting <@224237621503721475>, please wait.")
  185. bot.users.get("224237621503721475").send(`Hey, someone is trying to ask how I was made in ${serverdm}. Would you mind answering them?
  186. ${usersMessage}\'s message is:
  187.  
  188. \`${answermessage}\`
  189.  
  190. ${dmDate}`)
  191. };
  192. });
  193. bot.login(TOKEN);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement