Skip to content

Instantly share code, notes, and snippets.

@evwltrs
Created September 5, 2018 18:22
Show Gist options
  • Save evwltrs/aba4a95962478415bee4b76a29f102ab to your computer and use it in GitHub Desktop.
Save evwltrs/aba4a95962478415bee4b76a29f102ab to your computer and use it in GitHub Desktop.
Commands
const Discord = require("discord.js"); //YOU WILL NEED TO DEFINE DISCORD SINCE WE ARE USING THE EMBED!
exports.run = async (bot, message, args) => { //OH BTW BOT IS YOUR CLIENT SO IF YOU USED CLIENT THEN CHNAGE ALL THE "BOT" TO "CLIENT" cool!
var footertext = [`${bot.user.username}: oof sexy`, `${bot.user.username}: nice`, `${bot.user.username}: 🔥`, `${bot.user.username}: Someone's looking sharp today!`, `${bot.user.username}: oof if i wasn't a bot...`, `${bot.user.username}: looking sexier than a mug`];
var rand = Math.floor(Math.random() * footertext.length);
var randomfooter = footertext[rand]; //THIS AND THE TWO LINES ABOVE IS TOTALLY UNNECESSARY. But you want to make your bot more interactive so keep it.Just an array of some random shit, you can add more if you would like just read the code and change it at your will!
message.channel.startTyping(); // TELLS YOUR HANDICAPPED BOT TO START TYPING! ;)
let msg = await message.channel.send('``Generating that sexy avatar...``') //UNNECESSARY BUT COOL.
let user = message.mentions.users.first() || message.author; //THIS IS IMPORTANT BECAUSE YOU WANT YOUR BOT TO SHOW OTHER PEOPLE'S AVATAR AS WELL BY MENTIONING THEM!
// AVATAR EMBED
let embed = new Discord.MessageEmbed() //HERE WE DEFINE THE EMBED
.setAuthor(`${user.username}'s Avatar`) //HERE WE SHOW THE USER'S NAME!
.setImage(user.displayAvatarURL) // USER'S AVATAR
.setColor(1234) //SET THE EMBED COLOR TO THE HIGHEST ROLE COLOR THE BOT HAS! cool right :D
.setFooter(`${randomfooter}`) //FOOTER AND ICON
.setTimestamp(); //SHOWS THAT COOL TIME ON THE FOOTER!
await message.channel.send(embed) //NOW WE GIVE IT SOMETIME TO DO ALL THE CRAZY STUFF ON TOP AND THEN SEND THE EMBED!
message.channel.stopTyping(true); // TELLS YOUR HANDICAPPED BOT TO STOP TYPING! ;)
msg.delete(); // THIS WILL DELETE (Generating that sexy avatar...) AFTER SENDING THE EMBED! This will be quick so watch out for the small details :P
}
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "User"
};
exports.help = {
name: "avatar",
category: "Miscelaneous",
description: "Grabs a users avatr",
usage: "avatar @Infinite#3277"
};
exports.run = (client, message, args, tools) => {
// First, we need to get the arguments. Although, if you use the command handler it will be stored in `args`, so we can just combine it.
let question = encode(args.join(' ')); // We are combining by space, since we split by spaces before. Then, we are encoding it so we can turn it into a url.
// Now, we can form the link.
let link = `https://www.lmgtfy.com/?q=${question}`; // Now, this holds the link since it just adds the encoded string to the end.
// Output to chat
message.channel.send(`**<${link}>**`); // Enclosing in ** makes it bold, enclosing in <> hides the embed that comes from the link.
}
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "User"
};
exports.help = {
name: "lmgtfy",
category: "Miscelaneous",
description: "When people have the inability to google for some reason",
usage: "lmgtfy test"
};
const Discord = require("discord.js");
module.exports.run = async (bot, message, args) => {
let replies = ["One", "Two", "Three", "Four", "Five", "Six"];
let result = Math.floor((Math.random() * replies.length));
message.delete().catch(O_o => {});
try {
let newembed = new Discord.MessageEmbed()
.setAuthor("A dice has been rolled!")
.setColor("#00FF00")
.setDescription("Rolled By: " + message.author.username + "\nResult: " + replies[result]);
message.channel.send({
embed: newembed
});
} catch (e) {
console.log(e.stack);
}; // The try is because it errored when I didn't do it.
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "User"
};
exports.help = {
name: "rolldice",
category: "Miscelaneous",
description: "keep on rollin'",
usage: "rolldice"
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment