Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var mineflayer = require("mineflayer");
- const Discord = require("discord.js"); //comment your code pls
- const discord_client = new Discord.Client();
- var bot = mineflayer.createBot({
- host: "BotsAndLegit.aternos.me",
- port: 25565,
- username: "familiekrsmanovic@gmx.de",
- password: "Mihailo27!",
- version: "1.12.2"
- });
- bot.on("error", err => console.log(err))
- discord_client.on("ready", () => {
- console.log(`Logged in as ${discord_client.user.tag}!`);
- });
- discord_client.on("message", message => {
- if (message.channel.id != "630456693951692812") return;
- if (message.author.id == "387719715646210048") return;
- // if (message.content !== "/list") {
- var message = "<" + message.author.username + ">: " + message;
- bot.chat(message);
- // } else {
- // bot.chat("/list");
- });
- bot.once("login", () => {
- console.log("logged in");
- });
- //mc_bot.on("chat", function(username, message) {
- //if (message.content("!tp")) {
- //mc_bot.chat("Test" + username)
- //} else {
- //}
- //});
- bot.on("chat", function(username, message) {
- if (username === bot.username) return;
- if (username === "online") return;
- if (message.startsWith("me] ")) {
- console.log("private message: " + message);
- return;
- }
- var message = "**" + username + "**: " + message;
- //channels = discord_client.channels
- discord_client.channels.get("630456693951692812").send(message);
- //var message = "**" + username + "**: " + message;
- //var message = "<" + username + ">: " + message.content;
- });
- bot.on("message", message => {
- console.log(message.toAnsi());
- });
- bot.on("kicked", reason => {
- console.log(`I got kicked for ${reason}`);
- });
- discord_client.on("message", message => {
- if(message.channel.id !== "630456693951692812") return;
- if (message.content == "!shutdown" &&
- (message.author.id == "227468746443325441" ||
- message.author.id == "288055512405245953")
- ){
- discord_client.channels.get("630456693951692812").send("Shutting Down");
- bot.quit();
- }
- });
- discord_client.on("chat", function(message, username) {
- if(message.content === "<" + username + "> " + "!tp")
- var message1 = "/tp" + username;
- bot.chat(message1)
- })
- discord_client.on("message", message => {
- if(message.content === "!start"){
- bot = mineflayer.createBot({
- host: "BotsAndLegit.aternos.me",
- port: 25565,
- username: "familiekrsmanovic@gmx.de",
- password: "Mihailo27!",
- version: "1.12.2"
- })
- }
- });
- /*mc_bot.on('playerJoined', function(player) {
- console.log(player.username + " joined")
- mc_bot.chat("Heyo! " + player.username)
- });
- var stdin = process.openStdin();
- stdin.addListener("data", function(d) {
- bot.chat("" +
- d.toString().trim() + "");
- });*/
- discord_client.login("~~~")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement