Skip to content
This repository has been archived by the owner on Oct 11, 2018. It is now read-only.

Commit

Permalink
oops, fixing bugs
Browse files Browse the repository at this point in the history
oops, fixing bugs
  • Loading branch information
jewdev committed Mar 15, 2018
1 parent bfe32fc commit 2fc1f82
Showing 1 changed file with 48 additions and 9 deletions.
57 changes: 48 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ client.on("message", async message => {
// Bot's commands from here.
switch (args[0]) {
case "ping":
console.log(`${message.author.tag} used the ${settings.botPREFIX}pong command!`);
console.log(`${message.author.tag} used the ${settings.botPREFIX}ping command!`);
message.reply("Pong!");
break;

Expand Down Expand Up @@ -941,7 +941,6 @@ request(botavatar, function (err, res, body) {

case "dick":
console.log(`${message.author.tag} used the ${settings.botPREFIX}dick command!`);

// pretty shitty command

let dicksize = ["=", "==", "===", "====", "=====", "======", "=======", "========", "=========", "=========="];
Expand All @@ -962,15 +961,14 @@ request(botavatar, function (err, res, body) {
let {body} = await dogsuperagent
.get(`https://random.dog/woof.json`);


let dogpicembed = new Discord.RichEmbed()
.setColor('#ff9900')
.setTitle('Dog Picture')
.setImage(body.url);

message.channel.send(dogpicembed);
break;

case "say":
console.log(`${message.author.tag} used the ${settings.botPREFIX}say command!`);

Expand All @@ -985,11 +983,52 @@ request(botavatar, function (err, res, body) {
}
break;

case "translate":
const translate = require('google-translate-api');
const Discord = require('discord.js');

let toTrans = message.content.split(' ').slice(1);
let language;

language = toTrans[toTrans.length - 2] === 'to' ? toTrans.slice(toTrans.length - 2, toTrans.length)[1].trim() : undefined;
if (!language) {
return message.reply(`Please supply valid agruments.\n**Example** \`${settings.botPREFIX}translate [text] to [language]\``);
}
let finalToTrans = toTrans.slice(toTrans.length - toTrans.length, toTrans.length - 2).join(' ');
translate(finalToTrans, {to: language}).then(res => {
message.channel.send({embed: {
color: 3447003,
author: {
name: 'NotABot\'s translator',
icon_url: client.user.avatarURL
},
fields: [{
name: "Translator",
value: `**From:** ${res.from.language.iso}\n\`\`\`${finalToTrans}\`\`\`\n**To: **${language}\n\`\`\`${res.text}\`\`\``
}
],
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© NotABot"
}
}
});
}).catch(err => {
message.channel.send({
embed: {
description: '❌ We could not find the supplied language.',
color: 0xE8642B
}
});
});
break;

// Help commands :)
case "help":
console.log(`${message.author.tag} used the ${settings.botPREFIX}help command!`);

message.reply("Please check your direct messages :inbox_tray:")
message.reply("Please check your direct messages :inbox_tray:");
message.author.send({embed: {
color: 3447003,
title: "Bot's commands",
Expand All @@ -999,13 +1038,13 @@ request(botavatar, function (err, res, body) {
**${settings.botPREFIX}modhelp** - Send the commands for mods.\n\
**${settings.botPREFIX}ownerhelp** - Sends the commands to the owner.\n\
**${settings.botPREFIX}bluehelp** - secret.\n\
**${settings.botPREFIX}ping** - The bot will reply you with P O N G.\n\
**${settings.botPREFIX}ping** - The bot will reply you with PONG.\n\
**${settings.botPREFIX}botinfo** - Give you info about the bot.\n\
**${settings.botPREFIX}8ball** - Ask the bot a (yes / no) question.\n\
**${settings.botPREFIX}8ball** - Ask the bot a (yes/no) question.\n\
**${settings.botPREFIX}weather** - Send a place in the world... x_x\n\
**${settings.botPREFIX}invitebot** - The bot will reply with his invite URL.\n\
**${settings.botPREFIX}coinflip** - Flips a coin! (50/50)\n\
**${settings.botPREFIX}userinfo** - Mention someone to get information about him. (TOP SECRET)\n\
**${settings.botPREFIX}userinfo** - Mention someone to get information about him.\n\
**${settings.botPREFIX}avatar** - Mention someone to get his avatar.\n\
**${settings.botPREFIX}uptime** - See the bot's stats.\n\
**${settings.botPREFIX}serverinfo** - See a server stats.\n\
Expand All @@ -1017,7 +1056,7 @@ request(botavatar, function (err, res, body) {
**${settings.botPREFIX}request** - Request new features from \`Blue Malgeran#3106\`!\n\
**${settings.botPREFIX}roll** - Rolls a random number!\n\
**${settings.botPREFIX}dick** - Sizing the dick of the user!\n\
**${settings.botPREFIX}dog** - Sends a picture of a dog!`
**${settings.botPREFIX}dog** - Sends a picture of dog!`
}
],
timestamp: new Date(),
Expand Down

0 comments on commit 2fc1f82

Please sign in to comment.