Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. bot.on('message', function (user, userID, channelID, message, evt) {
  2. if (userID != "<513501693753688066>") {
  3. if (message.includes("status report")) {
  4. bot.sendMessage({
  5. to: channelID,
  6. message: "Did you submit your status report to the administrator today?"
  7. });
  8. } else if (message.includes("the core")) {
  9. bot.sendMessage({
  10. to: channelID,
  11. message: "Release date: unknown"
  12. });
  13. }
  14. }
  15. // Our bot needs to know if it will execute a command
  16. // It will listen for messages that will start with `!`
  17. if (message.substring(0, 1) == '!') {
  18. var args = message.substring(1).split(' ');
  19. var cmd = args[0];
  20.  
  21. args = args.splice(1);
  22. switch(cmd) {
  23. // !twhl
  24. case 'twhl':
  25. bot.sendMessage({
  26. to: channelID,
  27. message: 'Up and ready!'
  28. });
  29. break;
  30. // !sledge
  31. case 'sledge':
  32. bot.sendMessage({
  33. to: channelID,
  34. message: 'You can download **Sledge** here: http://sledge-editor.com/'
  35. });
  36. break;
  37. // !sharplife
  38. case 'sharplife':
  39. bot.sendMessage({
  40. to: channelID,
  41. message: 'You can check **Sharp-Life** here: https://github.com/SamVanheer/SharpLife-Engine'
  42. });
  43. break;
  44. // !compo
  45. case 'compo':
  46. bot.sendMessage({
  47. to: channelID,
  48. message: '**There are no competitions running at the moment.**'
  49. });
  50. break;
  51. // !wiki
  52. case 'wiki':
  53. bot.sendMessage({
  54. to: channelID,
  55. message: '**The wiki contains all of the collective knowledge that the community has acquired over the years**: https://twhl.info/wiki'
  56. });
  57. break;
  58. // !vault
  59. case 'vault':
  60. bot.sendMessage({
  61. to: channelID,
  62. message: 'TWHL\'s Map **Vault**: https://twhl.info/vault'
  63. });
  64. break;
  65. // Just add any case commands if you want to..
  66. }
  67. }
  68. });
  69. bot.on('guildMemberAdd', function(member) {
  70. bot.sendMessage({
  71. to: '291678871856742400',
  72. message: `Hi <@${member.id}>! :wave: Welcome to the **TWHL Discord Server**! :slight_smile:`
  73. });
  74. });
  75. bot.on('guildMemberRemove', function(member) {
  76. bot.sendMessage({
  77. to: '291678871856742400',
  78. message: `<@${member.id}> just leaved us... :cry:`
  79. });
  80. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement