Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require("discord.js");
- const client = new Discord.Client();
- const cfg = require('./config.json');
- const prefix = '>>';
- var mineflayer = require('mineflayer');
- var bot = mineflayer.createBot({
- host: "mc.hypixel.net", // optional
- port: 25565, // optional
- username: "", // email and password are required only for
- password: "", // online-mode=true servers
- version:"1.8"
- });
- const embed = new Discord.RichEmbed()
- .setTitle("This is the DoggoBot!")
- .setAuthor("DoggoBot", "https://imgur.com/4h9apEU.jpg")
- /*
- * Alternatively, use "#00AE86", [0, 174, 134] or an integer number.
- */
- .setColor(0x00AE86)
- .setDescription("This is our bot! This bot can do lots of stuff Special thanks to Raz for making this bot!")
- .setFooter("Created by xItsRaz ©. All rights reserved.")
- .setImage("https://imgur.com/PtE4abi.jpg")
- .setThumbnail("https://imgur.com/4h9apEU.jpg")
- /*
- * Takes a Date object, defaults to current date.
- */
- .addField("What can I do?",
- "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.")
- client.on('ready', () => {
- console.log(`Connected to ${client.guilds.size} servers`);
- console.log(`Logged in as ${client.user.tag} (${client.user.id})`);
- client.user.setActivity("In Tiger Den Guild");
- console.log('[DISCORD] STARTUP!! \n');
- console.log('DoggoBot for TigerDen \n',
- 'Created by @xItsRaz \n',
- 'for non-commercial use \n',
- 'Discord use only!'
- );
- });
- client.on('message', message => {
- if (message.author.bot || !message.content.startsWith(prefix)) return;
- const args = message.content.slice(prefix.length).split(' ');
- const command = args.shift();
- if(command === 'help') {
- console.log("Message Recieved");
- message.channel.send("These are the commands. \n" +
- " \n" +
- ">>help - Prints this out. \n" +
- ">>gchat [Message] - Sends a message in the guild chat INGAME. \n" +
- ">>ochat [Message] - Sends a message in the officers chat INGAME. \n" +
- ">>kick [User] [Reason] - Kicks a member from the guild. \n" +
- ">>invite [User] - Invites a user to the guild. \n" +
- ">>demote [User] - Demotes a user in the guild. NOTE: INCLUDE INGAME USERNAME, NOT DISCORD. \n" +
- ">>promote [User] - Promotes a user in the guild. NOTE: INCLUDE INGAME USERNAME, NOT DISCORD. \n" +
- ">>cmd [Command] - Use all IN-GAME commands"
- );
- }
- if(command === 'info') {
- //print info about the bot with embed
- message.channel.send({embed});
- }
- if(command === "test") {
- console.log("Message Recieved");
- message.channel.send("I am working correctly (i hope lol)");
- }
- if(command === "thread") {
- console.log("Message Recieved");
- message.channel.send("This is the guild thread: ");
- }
- if(command === 'gchat') {
- console.log("Message Recieved");
- if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send("You can't use this command");
- let m = (args[0]);
- if (!m) return message.channel.send("Please specify a message");
- let mMessage = args.join(" ")
- let mAuthor = message.author.username
- console.log('/gchat ' + mMessage);
- bot.chat(`/gc ` + mAuthor + ': ' + mMessage);
- }
- if(command === "ochat") {
- console.log("Message Recieved");
- if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send("You can't use this command");
- let oMes = (args[0]);
- if (!oMes) return message.channel.send("Please specify a message");
- let oMessage = args.join(" ")
- let oAuthor = message.author.username
- console.log('/ochat ' + oMessage);
- bot.chat(`/oc ` + oAuthor + ': ' + oMessage);
- }
- if(command === "kick") {
- console.log("Message Recieved");
- if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send("You can't use this command");
- let user = (args[0]);
- if(!user) return message.channel.send("Please specify a user and a reason.");
- let kUser = args.join(' ');
- console.log('/g kick ' + kUser);
- bot.chat(`/g kick ` + kUser)
- }
- if(command === "invite") {
- console.log("Message Recieved");
- if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send("You can't use this command");
- let user = (args[0]);
- if(!user) return message.channel.send("Please specify a user");
- let iUser = args.join(' ');
- console.log('/g invite ' + iUser);
- bot.chat(`/g invite ` + iUser)
- }
- if(command === "promote") {
- console.log("Message Recieved");
- if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send("You can't use this command");
- let user = (args[0]);
- if(!user) return message.channel.send("Please specify a user");
- let pUser = args.join(' ');
- console.log('/g promote ' + pUser);
- bot.chat(`/g promote ` + pUser)
- }
- if(command === "demote") {
- console.log("Message Recieved");
- if(!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send("You can't use this command");
- let user = (args[0]);
- if(!user) return message.channel.send("Please specify a user");
- let dUser = args.join(' ');
- console.log('/g demote ' + dUser);
- bot.chat(`/g demote ` + dUser)
- }
- if(command === "cmd") {
- console.log("Message Recieved");
- if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send("You can't use this command");
- let cmd = (args[0]);
- if(!cmd) return message.channel.send("Please enter a command!");
- let excmd = args.join(' ');
- console.log('/' + excmd);
- bot.chat(`/` + excmd);
- }
- });
- client.on('message', function(message){
- if(message.content === "raz") {
- console.log("Message Recieved");
- message.channel.send("Raz is still the best");
- }
- });
- bot.on('message', function (message) {
- });
- bot.once(`login`, () => {
- console.log('\n[MINEFLAYER] STARTUP!!');
- setTimeout(() => {
- bot.chat(`/home`)
- }, 2000)
- });
- client.login("");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement