Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.50 KB | None | 0 0
  1. const Discord = require("discord.js");
  2. const client = new Discord.Client();
  3. const cfg = require('./config.json');
  4. const prefix = '>>';
  5. var mineflayer = require('mineflayer');
  6. var bot = mineflayer.createBot({
  7. host: "mc.hypixel.net", // optional
  8. port: 25565, // optional
  9. username: "", // email and password are required only for
  10. password: "", // online-mode=true servers
  11. version:"1.8"
  12. });
  13.  
  14. const embed = new Discord.RichEmbed()
  15. .setTitle("This is the DoggoBot!")
  16. .setAuthor("DoggoBot", "https://imgur.com/4h9apEU.jpg")
  17. /*
  18. * Alternatively, use "#00AE86", [0, 174, 134] or an integer number.
  19. */
  20. .setColor(0x00AE86)
  21. .setDescription("This is our bot! This bot can do lots of stuff Special thanks to Raz for making this bot!")
  22. .setFooter("Created by xItsRaz ©. All rights reserved.")
  23. .setImage("https://imgur.com/PtE4abi.jpg")
  24. .setThumbnail("https://imgur.com/4h9apEU.jpg")
  25. /*
  26. * Takes a Date object, defaults to current date.
  27. */
  28. .addField("What can I do?",
  29. "I can do lots of stuff, like verify users that are in the guild with their Minecraft. I can kick and invite players, the guild staff can talk in the chat with me.")
  30.  
  31.  
  32.  
  33.  
  34. client.on('ready', () => {
  35. console.log(`Connected to ${client.guilds.size} servers`);
  36. console.log(`Logged in as ${client.user.tag} (${client.user.id})`);
  37. client.user.setActivity("In Tiger Den Guild");
  38. console.log('[DISCORD] STARTUP!! \n');
  39.  
  40. console.log('DoggoBot for TigerDen \n',
  41. 'Created by @xItsRaz \n',
  42. 'for non-commercial use \n',
  43. 'Discord use only!'
  44. );
  45. });
  46. client.on('message', message => {
  47. if (message.author.bot || !message.content.startsWith(prefix)) return;
  48. const args = message.content.slice(prefix.length).split(' ');
  49. const command = args.shift();
  50.  
  51. if(command === 'help') {
  52. console.log("Message Recieved");
  53. message.channel.send("These are the commands. \n" +
  54. " \n" +
  55. ">>help - Prints this out. \n" +
  56. ">>gchat [Message] - Sends a message in the guild chat INGAME. \n" +
  57. ">>ochat [Message] - Sends a message in the officers chat INGAME. \n" +
  58. ">>kick [User] [Reason] - Kicks a member from the guild. \n" +
  59. ">>invite [User] - Invites a user to the guild. \n" +
  60. ">>demote [User] - Demotes a user in the guild. NOTE: INCLUDE INGAME USERNAME, NOT DISCORD. \n" +
  61. ">>promote [User] - Promotes a user in the guild. NOTE: INCLUDE INGAME USERNAME, NOT DISCORD. \n" +
  62. ">>cmd [Command] - Use all IN-GAME commands"
  63. );
  64. }
  65.  
  66. if(command === 'info') {
  67. //print info about the bot with embed
  68. message.channel.send({embed});
  69.  
  70.  
  71. }
  72.  
  73. if(command === "test") {
  74. console.log("Message Recieved");
  75. message.channel.send("I am working correctly (i hope lol)");
  76.  
  77. }
  78.  
  79. if(command === "thread") {
  80. console.log("Message Recieved");
  81. message.channel.send("This is the guild thread: ");
  82.  
  83. }
  84.  
  85. if(command === 'gchat') {
  86. console.log("Message Recieved");
  87. if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send("You can't use this command");
  88. let m = (args[0]);
  89. if (!m) return message.channel.send("Please specify a message");
  90. let mMessage = args.join(" ")
  91. let mAuthor = message.author.username
  92. console.log('/gchat ' + mMessage);
  93. bot.chat(`/gc ` + mAuthor + ': ' + mMessage);
  94.  
  95.  
  96. }
  97.  
  98. if(command === "ochat") {
  99. console.log("Message Recieved");
  100. if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send("You can't use this command");
  101. let oMes = (args[0]);
  102. if (!oMes) return message.channel.send("Please specify a message");
  103. let oMessage = args.join(" ")
  104. let oAuthor = message.author.username
  105. console.log('/ochat ' + oMessage);
  106. bot.chat(`/oc ` + oAuthor + ': ' + oMessage);
  107.  
  108.  
  109. }
  110.  
  111. if(command === "kick") {
  112. console.log("Message Recieved");
  113. if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send("You can't use this command");
  114. let user = (args[0]);
  115. if(!user) return message.channel.send("Please specify a user and a reason.");
  116. let kUser = args.join(' ');
  117. console.log('/g kick ' + kUser);
  118. bot.chat(`/g kick ` + kUser)
  119.  
  120.  
  121. }
  122.  
  123. if(command === "invite") {
  124. console.log("Message Recieved");
  125. if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send("You can't use this command");
  126. let user = (args[0]);
  127. if(!user) return message.channel.send("Please specify a user");
  128. let iUser = args.join(' ');
  129. console.log('/g invite ' + iUser);
  130. bot.chat(`/g invite ` + iUser)
  131.  
  132. }
  133.  
  134. if(command === "promote") {
  135. console.log("Message Recieved");
  136. if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send("You can't use this command");
  137. let user = (args[0]);
  138. if(!user) return message.channel.send("Please specify a user");
  139. let pUser = args.join(' ');
  140. console.log('/g promote ' + pUser);
  141. bot.chat(`/g promote ` + pUser)
  142. }
  143.  
  144. if(command === "demote") {
  145. console.log("Message Recieved");
  146. if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send("You can't use this command");
  147. let user = (args[0]);
  148. if(!user) return message.channel.send("Please specify a user");
  149. let dUser = args.join(' ');
  150. console.log('/g demote ' + dUser);
  151. bot.chat(`/g demote ` + dUser)
  152. }
  153.  
  154. if(command === "cmd") {
  155. console.log("Message Recieved");
  156. if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send("You can't use this command");
  157. let cmd = (args[0]);
  158. if(!cmd) return message.channel.send("Please enter a command!");
  159. let excmd = args.join(' ');
  160. console.log('/' + excmd);
  161. bot.chat(`/` + excmd);
  162.  
  163. }
  164.  
  165. });
  166.  
  167. client.on('message', function(message){
  168. if(message.content === "raz") {
  169. console.log("Message Recieved");
  170. message.channel.send("Raz is still the best");
  171. }
  172. });
  173.  
  174. bot.on('message', function (message) {
  175.  
  176. });
  177.  
  178. bot.once(`login`, () => {
  179. console.log('\n[MINEFLAYER] STARTUP!!');
  180. setTimeout(() => {
  181. bot.chat(`/home`)
  182. }, 2000)
  183. });
  184.  
  185. client.login("");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement