SHARE
TWEET

Bot

a guest Oct 21st, 2019 179 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var mineflayer = require("mineflayer");
  2. const Discord = require("discord.js"); //comment your code pls
  3. const discord_client = new Discord.Client();
  4.  
  5. var bot = mineflayer.createBot({
  6.   host: "BotsAndLegit.aternos.me",
  7.   port: 25565,
  8.   username: "familiekrsmanovic@gmx.de",
  9.   password: "Mihailo27!",
  10.   version: "1.12.2"
  11. });
  12.  
  13. bot.on("error", err => console.log(err))
  14.  
  15. discord_client.on("ready", () => {
  16.   console.log(`Logged in as ${discord_client.user.tag}!`);
  17. });
  18.  
  19. discord_client.on("message", message => {
  20.   if (message.channel.id != "630456693951692812") return;
  21.   if (message.author.id == "387719715646210048") return;
  22.  // if (message.content !== "/list") {
  23.     var message = "<" + message.author.username + ">: " + message;
  24.     bot.chat(message);
  25.  // } else {
  26.    // bot.chat("/list");
  27. });
  28.  
  29. bot.once("login", () => {
  30.   console.log("logged in");
  31. });
  32.  
  33. //mc_bot.on("chat", function(username, message) {
  34. //if (message.content("!tp")) {
  35.   //mc_bot.chat("Test" + username)
  36. //} else {
  37. //}
  38. //});
  39.  
  40. bot.on("chat", function(username, message) {
  41.   if (username === bot.username) return;
  42.   if (username === "online") return;
  43.   if (message.startsWith("me] ")) {
  44.     console.log("private message: " + message);
  45.     return;
  46.  
  47.   }
  48.  
  49.   var message = "**" + username + "**: " + message;
  50.   //channels = discord_client.channels
  51.   discord_client.channels.get("630456693951692812").send(message);
  52.  
  53.   //var message = "**" + username + "**: " + message;
  54.   //var message = "<" + username + ">: " + message.content;
  55. });
  56.  
  57. bot.on("message", message => {
  58.   console.log(message.toAnsi());
  59. });
  60.  
  61. bot.on("kicked", reason => {
  62.   console.log(`I got kicked for ${reason}`);
  63. });
  64.  
  65. discord_client.on("message", message => {
  66.    if(message.channel.id !== "630456693951692812") return;
  67.   if (message.content == "!shutdown" &&
  68.   (message.author.id == "227468746443325441" ||
  69.   message.author.id == "288055512405245953")
  70.  
  71.   ){
  72.    discord_client.channels.get("630456693951692812").send("Shutting Down");
  73.     bot.quit();
  74.   }
  75. });
  76.  
  77. discord_client.on("chat", function(message, username) {
  78.   if(message.content === "<" + username + "> " + "!tp")
  79.  
  80.   var message1 = "/tp" + username;
  81.   bot.chat(message1)
  82.  
  83. })
  84.  
  85.  
  86.  
  87. discord_client.on("message", message => {
  88.   if(message.content === "!start"){
  89.   bot = mineflayer.createBot({
  90.   host: "BotsAndLegit.aternos.me",
  91.   port: 25565,
  92.   username: "familiekrsmanovic@gmx.de",
  93.   password: "Mihailo27!",
  94.   version: "1.12.2"
  95.   })
  96.  }
  97. });
  98.  
  99.  
  100. /*mc_bot.on('playerJoined', function(player) {
  101.   console.log(player.username + " joined")
  102.   mc_bot.chat("Heyo! " + player.username)
  103. });
  104.  
  105. var stdin = process.openStdin();
  106.  
  107. stdin.addListener("data", function(d) {
  108.     bot.chat("" +
  109.     d.toString().trim() + "");
  110. });*/
  111.  
  112.       discord_client.login("~~~")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top