Changed indent

merge-requests/2/head
Supositware 5 years ago
parent e8ce566c4b
commit a64c0a2cc8

@ -51,7 +51,7 @@ class autoresponseCommand extends Command {
fs.close(); fs.close();
return console.log(err); return console.log(err);
} }
}) });
} }
}); });
@ -71,10 +71,10 @@ class autoresponseCommand extends Command {
fs.close(); fs.close();
return console.log(err); return console.log(err);
} }
}) });
}
});
} }
})
};
fs.close(); fs.close();
return message.channel.send(`Autoresponse have been ${text}d`); return message.channel.send(`Autoresponse have been ${text}d`);

@ -32,14 +32,14 @@ class BanCommand extends Command {
let reasons = args.reasons; let reasons = args.reasons;
if(member == this.client) if(member == this.client)
return message.channel.send('Cant ban me fool') return message.channel.send('Cant ban me fool');
if(!reasons) if(!reasons)
reasons = 'Nothing have been specified' reasons = 'Nothing have been specified';
if(member.id === message.author.id) if(member.id === message.author.id)
return message.channel.send("Why would you ban yourself ?") return message.channel.send('Why would you ban yourself ?');
member.ban(`Banned by : ${message.author.username} for the following reasons : ${reasons}`) member.ban(`Banned by : ${message.author.username} for the following reasons : ${reasons}`)
.then(() => message.reply(`${member.user.username} was succesfully banned with the following reasons "${reasons}".`)) .then(() => message.reply(`${member.user.username} was succesfully banned with the following reasons "${reasons}".`));
} }
} }

@ -34,13 +34,13 @@ class KickCommand extends Command {
if(member === this.client.user) if(member === this.client.user)
return message.channel.say('Cant kick me fool'); return message.channel.say('Cant kick me fool');
if(member.id === message.author.id) if(member.id === message.author.id)
return message.channel.say("Why would you kick yourself ?"); return message.channel.say('Why would you kick yourself ?');
if(!reasons) if(!reasons)
reasons = 'Nothing have been specified.'; reasons = 'Nothing have been specified.';
await member.kick(`Kicked by : ${message.author.username} for the following reasons : ${reasons}`) await member.kick(`Kicked by : ${message.author.username} for the following reasons : ${reasons}`)
.then(() => message.reply(`${member.user.username} was succesfully kicked with the following reasons "${reasons}".`)) .then(() => message.reply(`${member.user.username} was succesfully kicked with the following reasons "${reasons}".`))
.catch(err => console.error(err)) .catch(err => console.error(err));
} }
} }

@ -7,8 +7,8 @@ class PruneCommand extends Command {
category: 'admin', category: 'admin',
args: [ args: [
{ {
id: "amount", id: 'amount',
type: "integer" type: 'integer'
} }
], ],
clientPermissions: ['MANAGE_MESSAGES'], clientPermissions: ['MANAGE_MESSAGES'],

@ -26,8 +26,8 @@ class shameboardCommand extends Command {
console.log(err); console.log(err);
} }
fs.close(); fs.close();
return message.channel.send(`This channel have been set as the shameboard`); return message.channel.send('This channel have been set as the shameboard');
}) });
} else { } else {
let shameboard = JSON.parse(data); //now it an object let shameboard = JSON.parse(data); //now it an object
shameboard['shameboard'] = shameboardChannel; shameboard['shameboard'] = shameboardChannel;
@ -37,11 +37,11 @@ class shameboardCommand extends Command {
fs.close(); fs.close();
return console.log(err); return console.log(err);
} }
}) });
} }
}); });
fs.close(); fs.close();
return message.channel.send(`This channel have been set as the shameboard`); return message.channel.send('This channel have been set as the shameboard');
} }
} }

@ -7,12 +7,12 @@ class PruneCommand extends Command {
category: 'admin', category: 'admin',
args: [ args: [
{ {
id: "slowmodeNumber", id: 'slowmodeNumber',
type: "integer" type: 'integer'
}, },
{ {
id: "realtime", id: 'realtime',
type: "integer", type: 'integer',
optional: true, optional: true,
} }
], ],
@ -32,7 +32,7 @@ class PruneCommand extends Command {
let realtime = args.realtime; let realtime = args.realtime;
if (slowmodeNumber > 120) if (slowmodeNumber > 120)
return message.channel.send("Slowmode can only be set to 120 seconds or lower!"); return message.channel.send('Slowmode can only be set to 120 seconds or lower!');
message.channel.setRateLimitPerUser(slowmodeNumber); message.channel.setRateLimitPerUser(slowmodeNumber);
@ -41,11 +41,11 @@ class PruneCommand extends Command {
message.channel.send(`Slowmode have been set to ${slowmodeNumber} seconds and will end in ${realtime} minutes!`); message.channel.send(`Slowmode have been set to ${slowmodeNumber} seconds and will end in ${realtime} minutes!`);
setTimeout (function (){ setTimeout (function (){
message.channel.setRateLimitPerUser(0); message.channel.setRateLimitPerUser(0);
return message.channel.send("Slowmode is now disabled!") return message.channel.send('Slowmode is now disabled!');
}, time); }, time);
} else { } else {
if (slowmodeNumber == 0) if (slowmodeNumber == 0)
return message.channel.send("Slowmode have been disabled!") return message.channel.send('Slowmode have been disabled!');
return message.channel.send(`Slowmode have been set to ${slowmodeNumber} seconds!`); return message.channel.send(`Slowmode have been set to ${slowmodeNumber} seconds!`);
} }
} }

@ -26,8 +26,8 @@ class StarBoardCommand extends Command {
console.log(err); console.log(err);
} }
fs.close(); fs.close();
return message.channel.send(`This channel have been set as the starboard`); return message.channel.send('This channel have been set as the starboard');
}) });
} else { } else {
let starboard = JSON.parse(data); //now it an object let starboard = JSON.parse(data); //now it an object
starboard['starboard'] = starboardChannel; starboard['starboard'] = starboardChannel;
@ -37,11 +37,11 @@ class StarBoardCommand extends Command {
fs.close(); fs.close();
return console.log(err); return console.log(err);
} }
}) });
} }
}); });
fs.close(); fs.close();
return message.channel.send(`This channel have been set as the starboard`); return message.channel.send('This channel have been set as the starboard');
} }
} }

@ -9,19 +9,19 @@ class TagCommand extends Command {
split: 'quoted', split: 'quoted',
args: [ args: [
{ {
id: "trigger", id: 'trigger',
type: "string" type: 'string'
}, },
{ {
id: "response", id: 'response',
type: "string" type: 'string'
} }
], ],
channelRestriction: 'guild', channelRestriction: 'guild',
description: { description: {
content: 'Create custom autoresponse', content: 'Create custom autoresponse',
usage: '[trigger] [response]', usage: '[trigger] [response]',
examples: ['"do you know da wea" "Fuck off dead meme"'] examples: ['do you know da wea', 'Fuck off dead meme']
} }
}); });
} }
@ -31,31 +31,28 @@ class TagCommand extends Command {
let response = args.response; let response = args.response;
trigger = trigger.toLowerCase(); trigger = trigger.toLowerCase();
do {
trigger = trigger.replace('--', ' ');
} while (trigger.includes('--'))
let customresponse = {}; let customresponse = {};
let json = JSON.stringify(customresponse); let json = JSON.stringify(customresponse);
fs.readFile(`./tag/${message.guild.id}.json`, 'utf8', function readFileCallback(err, data) { fs.readFile(`./tag/${message.guild.id}.json`, 'utf8', function readFileCallback(err, data) {
if (err) { if (err) {
fs.writeFile(`./tag/${message.guild.id}.json`, `{"${trigger}":"${response}"}`, function (err) { fs.writeFile(`./tag/${message.guild.id}.json`, `{'${trigger}':'${response}'}`, function (err) {
if (err) { if (err) {
fs.close(); fs.close();
console.log(err); console.log(err);
} }
}) });
} else { } else {
customresponse = JSON.parse(data); //now it an object customresponse = JSON.parse(data); //now it an object
customresponse[trigger] = response customresponse[trigger] = response;
json = JSON.stringify(customresponse); //convert it back to json json = JSON.stringify(customresponse); //convert it back to json
fs.writeFile(`./tag/${message.guild.id}.json`, json, 'utf8', function (err) { fs.writeFile(`./tag/${message.guild.id}.json`, json, 'utf8', function (err) {
if (err) { if (err) {
fs.close(); fs.close();
return console.log(err); return console.log(err);
} }
}) });
} }
}); });

@ -24,7 +24,7 @@ class UnbanCommand extends Command {
async exec(message, args) { async exec(message, args) {
message.guild.unban(args.member) message.guild.unban(args.member)
.then(() => message.reply(`user was succesfully unbanned.`)); .then(() => message.reply('user was succesfully unbanned.'));
} }
} }

@ -9,15 +9,15 @@ class UnTagCommand extends Command {
split: 'none', split: 'none',
args: [ args: [
{ {
id: "trigger", id: 'trigger',
type: "string" type: 'string'
} }
], ],
channelRestriction: 'guild', channelRestriction: 'guild',
description: { description: {
content: 'Remove created custom autoresponse', content: 'Remove created custom autoresponse',
usage: '[trigger]', usage: '[trigger]',
examples: ['"do you know da wea"'] examples: ['do you know da wea']
} }
}); });
} }
@ -27,8 +27,8 @@ class UnTagCommand extends Command {
trigger = trigger.toLowerCase(); trigger = trigger.toLowerCase();
let customresponse = {} let customresponse = {};
let json = JSON.stringify(customresponse) let json = JSON.stringify(customresponse);
fs.readFile(`./tag/${message.guild.id}.json`, 'utf8', function readFileCallback(err, data) { fs.readFile(`./tag/${message.guild.id}.json`, 'utf8', function readFileCallback(err, data) {
@ -36,14 +36,14 @@ class UnTagCommand extends Command {
console.log(err); console.log(err);
} else { } else {
customresponse = JSON.parse(data); //now it an object customresponse = JSON.parse(data); //now it an object
delete customresponse[trigger] delete customresponse[trigger];
json = JSON.stringify(customresponse); //convert it back to json json = JSON.stringify(customresponse); //convert it back to json
fs.writeFile(`./tag/${message.guild.id}.json`, json, 'utf8', function (err) { fs.writeFile(`./tag/${message.guild.id}.json`, json, 'utf8', function (err) {
if (err) { if (err) {
fs.close(); fs.close();
return console.log(err); return console.log(err);
} }
}) });
} }
}); });

@ -16,18 +16,18 @@ class AdviceCommand extends Command {
} }
async exec(message) { async exec(message) {
fetch("http://api.adviceslip.com/advice").then((response) => { fetch('http://api.adviceslip.com/advice').then((response) => {
return response.json(); return response.json();
}).then((response) => { }).then((response) => {
const adviceEmbed = new Discord.RichEmbed() const adviceEmbed = new Discord.RichEmbed()
.setColor("#ff9900") .setColor('#ff9900')
.setTitle(response.slip.slip_id) .setTitle(response.slip.slip_id)
.setDescription(response.slip.advice) .setDescription(response.slip.advice);
message.channel.send(adviceEmbed); message.channel.send(adviceEmbed);
})} });
}
} }
module.exports = AdviceCommand; module.exports = AdviceCommand;

@ -1,5 +1,5 @@
const { Command } = require('discord-akairo'); const { Command } = require('discord-akairo');
const fetch = require('node-fetch') const fetch = require('node-fetch');
class ImgurCommand extends Command { class ImgurCommand extends Command {
constructor() { constructor() {
@ -15,13 +15,13 @@ class ImgurCommand extends Command {
} }
async exec(message) { async exec(message) {
fetch("https://api.imgur.com/3/gallery/hot/day?showViral=true&mature=false&perPage=100&album_previews=true", { fetch('https://api.imgur.com/3/gallery/hot/day?showViral=true&mature=false&perPage=100&album_previews=true', {
headers: { "Authorization": "Client-ID e4cb6948f80f295" }, headers: { 'Authorization': 'Client-ID e4cb6948f80f295' },
}).then((response) => { }).then((response) => {
return response.json(); return response.json();
}).then((response) => { }).then((response) => {
if (response.success == 'false') if (response.success == 'false')
return message.channel.send('An error has occured') return message.channel.send('An error has occured');
const i = Math.floor((Math.random() * response.data.length)); const i = Math.floor((Math.random() * response.data.length));

@ -8,8 +8,8 @@ class ClapCommand extends Command {
split: 'none', split: 'none',
args: [ args: [
{ {
id: "text", id: 'text',
type: "string" type: 'string'
} }
], ],
description: { description: {

@ -9,8 +9,8 @@ class EmotesayCommand extends Command {
split: 'none', split: 'none',
args: [ args: [
{ {
id: "text", id: 'text',
type: "string" type: 'string'
} }
], ],
description: { description: {
@ -28,7 +28,7 @@ class EmotesayCommand extends Command {
let emojiArray = []; let emojiArray = [];
for (let i = 0; i < text.length; i++) for (let i = 0; i < text.length; i++)
emojiArray[i] = emojiCharacters[text.toLowerCase().split('')[i]]; emojiArray[i] = emojiCharacters[text.toLowerCase().split('')[i]];
message.channel.send(emojiArray.join("")) message.channel.send(emojiArray.join(''));
} }
} }

@ -17,7 +17,7 @@ class InspiroBotCommand extends Command {
async exec(message) { async exec(message) {
fetch('http://inspirobot.me/api?generate=true') fetch('http://inspirobot.me/api?generate=true')
.then(res => res.text()) .then(res => res.text())
.then(body => message.channel.send({files: [body]})) .then(body => message.channel.send({files: [body]}));
} }
} }
module.exports = InspiroBotCommand; module.exports = InspiroBotCommand;

@ -1,4 +1,5 @@
const { Command } = require('discord-akairo'); const { Command } = require('discord-akairo');
const Discord = require('discord.js');
const fetch = require('node-fetch'); const fetch = require('node-fetch');
class RedditCommand extends Command { class RedditCommand extends Command {
@ -23,30 +24,30 @@ class RedditCommand extends Command {
async exec(message, args) { async exec(message, args) {
let sub = args.sub; let sub = args.sub;
let i, a;
fetch('https://www.reddit.com/r/' + sub + '.json?limit=100').then((response) => { fetch('https://www.reddit.com/r/' + sub + '.json?limit=100').then((response) => {
return response.json(); return response.json();
}).then((response) => { }).then((response) => {
if (!response.data) if (!response.data)
return message.channel.send('Not a valid subreddit') return message.channel.send('Not a valid subreddit');
while (response.data.children[i].data.post_hint !== 'image') { while (response.data.children[i].data.post_hint !== 'image') {
i = Math.floor((Math.random() * response.data.children.length)); i = Math.floor((Math.random() * response.data.children.length));
a++;
a++
if (a == 5) if (a == 5)
return message.channel.send("Could not find any images") return message.channel.send('Could not find any images');
} }
if (response.data.children[i].data.over_18 == true) if (response.data.children[i].data.over_18 == true)
return message.channel.send(`No nsfw ( if you want a nsfw version of this commands use the feedback commands "${prefix} feedback <your feedback>")`) return message.channel.send('No nsfw');
const redditEmbed = new Discord.RichEmbed() const redditEmbed = new Discord.RichEmbed()
.setColor("#ff9900") .setColor('#ff9900')
.setTitle(response.data.children[i].data.title) .setTitle(response.data.children[i].data.title)
.setImage(response.data.children[i].data.url) .setImage(response.data.children[i].data.url)
.setURL('https://reddit.com' + response.data.children[i].data.permalink) .setURL('https://reddit.com' + response.data.children[i].data.permalink)
.setFooter(`${response.data.children[i].data.ups} 💬 ${response.data.children[i].data.num_comments}`) .setFooter(`${response.data.children[i].data.ups} 💬 ${response.data.children[i].data.num_comments}`);
message.channel.send(redditEmbed); message.channel.send(redditEmbed);
}) });
} }
} }
module.exports = RedditCommand; module.exports = RedditCommand;

@ -24,54 +24,54 @@ class SayCommand extends Command {
let text = args.text; let text = args.text;
// Load all the different files // Load all the different files
const verb = require('../../dictionary/verbs.json') const verb = require('../../dictionary/verbs.json');
const noun = require('../../dictionary/noun.json') const noun = require('../../dictionary/noun.json');
const adjective = require('../../dictionary/adjectives.json') const adjective = require('../../dictionary/adjectives.json');
const adverbs = require('../../dictionary/adverbs.json') const adverbs = require('../../dictionary/adverbs.json');
const activities = require('../../dictionary/activities.json') const activities = require('../../dictionary/activities.json');
const celebreties = require('../../dictionary/celebreties.json') const celebreties = require('../../dictionary/celebreties.json');
const countries = require('../../dictionary/countries.json') const countries = require('../../dictionary/countries.json');
const diseases = require('../../dictionary/diseases.json') const diseases = require('../../dictionary/diseases.json');
const elements = require('../../dictionary/elements.json') const elements = require('../../dictionary/elements.json');
const hobbies = require('../../dictionary/hobbies.json') const hobbies = require('../../dictionary/hobbies.json');
const music = require('../../dictionary/music.json') const music = require('../../dictionary/music.json');
const prefixes = require('../../dictionary/prefixes.json') const prefixes = require('../../dictionary/prefixes.json');
const pronouns = require('../../dictionary/pronouns.json') const pronouns = require('../../dictionary/pronouns.json');
const states = require('../../dictionary/states.json') const states = require('../../dictionary/states.json');
const titles = require('../../dictionary/titles.json') const titles = require('../../dictionary/titles.json');
const units = require('../../dictionary/units.json') const units = require('../../dictionary/units.json');
// Generate a random number // Generate a random number
function randNumber(file) { function randNumber(file) {
let Rand = Math.floor((Math.random() * file.length) + 1); let Rand = Math.floor((Math.random() * file.length) + 1);
return Rand; return Rand;
} }
// Replace with a random word from the json // Replace with a random word from the json
do { do {
text = text.replace(/\[verb\]/, verb[randNumber(verb)]) text = text.replace(/\[verb\]/, verb[randNumber(verb)]);
text = text.replace(/\[adverb\]/, adverbs[randNumber(adverbs)]) text = text.replace(/\[adverb\]/, adverbs[randNumber(adverbs)]);
text = text.replace(/\[noun\]/, noun[randNumber(noun)]) text = text.replace(/\[noun\]/, noun[randNumber(noun)]);
text = text.replace(/\[adjective\]/, adjective[randNumber(adjective)]) text = text.replace(/\[adjective\]/, adjective[randNumber(adjective)]);
text = text.replace(/\[activity\]/, activities[randNumber(activities)]) text = text.replace(/\[activity\]/, activities[randNumber(activities)]);
text = text.replace(/\[celebrity\]/, celebreties[randNumber(celebreties)]) text = text.replace(/\[celebrity\]/, celebreties[randNumber(celebreties)]);
text = text.replace(/\[country\]/, countries[randNumber(countries)]) text = text.replace(/\[country\]/, countries[randNumber(countries)]);
text = text.replace(/\[diseases\]/, diseases[randNumber(diseases)]) text = text.replace(/\[diseases\]/, diseases[randNumber(diseases)]);
text = text.replace(/\[elements\]/, elements[randNumber(elements)]) text = text.replace(/\[elements\]/, elements[randNumber(elements)]);
text = text.replace(/\[hobbies\]/, hobbies[randNumber(hobbies)]) text = text.replace(/\[hobbies\]/, hobbies[randNumber(hobbies)]);
text = text.replace(/\[music\]/, music[randNumber(music)]) text = text.replace(/\[music\]/, music[randNumber(music)]);
text = text.replace(/\[prefixes\]/, prefixes[randNumber(prefixes)]) text = text.replace(/\[prefixes\]/, prefixes[randNumber(prefixes)]);
text = text.replace(/\[pronoun\]/, pronouns[randNumber(pronouns)]) text = text.replace(/\[pronoun\]/, pronouns[randNumber(pronouns)]);
text = text.replace(/\[state\]/, states[randNumber(states)]) text = text.replace(/\[state\]/, states[randNumber(states)]);
text = text.replace(/\[title\]/, titles[randNumber(titles)]) text = text.replace(/\[title\]/, titles[randNumber(titles)]);
text = text.replace(/\[unit\]/, units[randNumber(units)]) text = text.replace(/\[unit\]/, units[randNumber(units)]);
text = text.replace(/\[member\]/, message.guild.members.random().user.username) text = text.replace(/\[member\]/, message.guild.members.random().user.username);
text = text.replace(/\[number\]/, Math.floor((Math.random() * 9) + 1)) text = text.replace(/\[number\]/, Math.floor((Math.random() * 9) + 1));
// Verify if it replaced everything // Verify if it replaced everything
} while( text.includes('[verb]') || text.includes('[adverbs]') || text.includes('[noun]') || text.includes('[adjective]') || text.includes('[member]') || text.includes('[number]') || text.includes('[activities]') || text.includes('[celebrities]') || text.includes('[countries]') || text.includes('[diseases]') || text.includes('[elements]') || text.includes('[hobbies]') || text.includes('[music]') || text.includes('[prefixes]') || text.includes('[pronoun]') || text.includes('[state]') || text.includes('[title]') || text.includes('[unit]')) } while( text.includes('[verb]') || text.includes('[adverbs]') || text.includes('[noun]') || text.includes('[adjective]') || text.includes('[member]') || text.includes('[number]') || text.includes('[activities]') || text.includes('[celebrities]') || text.includes('[countries]') || text.includes('[diseases]') || text.includes('[elements]') || text.includes('[hobbies]') || text.includes('[music]') || text.includes('[prefixes]') || text.includes('[pronoun]') || text.includes('[state]') || text.includes('[title]') || text.includes('[unit]'));
// Send the final text // Send the final text
return message.channel.send(text); return message.channel.send(text);
} }
} }

@ -1,6 +1,6 @@
const { Command } = require('discord-akairo'); const { Command } = require('discord-akairo');
class SayCommand extends Command { class SaydCommand extends Command {
constructor() { constructor() {
super('sayd', { super('sayd', {
aliases: ['sayd'], aliases: ['sayd'],
@ -25,57 +25,57 @@ class SayCommand extends Command {
let text = args.text; let text = args.text;
// Load all the different files // Load all the different files
const verb = require('../../dictionary/verbs.json') const verb = require('../../dictionary/verbs.json');
const noun = require('../../dictionary/noun.json') const noun = require('../../dictionary/noun.json');
const adjective = require('../../dictionary/adjectives.json') const adjective = require('../../dictionary/adjectives.json');
const adverbs = require('../../dictionary/adverbs.json') const adverbs = require('../../dictionary/adverbs.json');
const activities = require('../../dictionary/activities.json') const activities = require('../../dictionary/activities.json');
const celebreties = require('../../dictionary/celebreties.json') const celebreties = require('../../dictionary/celebreties.json');
const countries = require('../../dictionary/countries.json') const countries = require('../../dictionary/countries.json');
const diseases = require('../../dictionary/diseases.json') const diseases = require('../../dictionary/diseases.json');
const elements = require('../../dictionary/elements.json') const elements = require('../../dictionary/elements.json');
const hobbies = require('../../dictionary/hobbies.json') const hobbies = require('../../dictionary/hobbies.json');
const music = require('../../dictionary/music.json') const music = require('../../dictionary/music.json');
const prefixes = require('../../dictionary/prefixes.json') const prefixes = require('../../dictionary/prefixes.json');
const pronouns = require('../../dictionary/pronouns.json') const pronouns = require('../../dictionary/pronouns.json');
const states = require('../../dictionary/states.json') const states = require('../../dictionary/states.json');
const titles = require('../../dictionary/titles.json') const titles = require('../../dictionary/titles.json');
const units = require('../../dictionary/units.json') const units = require('../../dictionary/units.json');
// Generate a random number // Generate a random number
function randNumber(file) { function randNumber(file) {
let Rand = Math.floor((Math.random() * file.length) + 1); let Rand = Math.floor((Math.random() * file.length) + 1);
return Rand; return Rand;
} }
// Replace with a random word from the json // Replace with a random word from the json
do { do {
text = text.replace(/\[verb\]/, verb[randNumber(verb)]) text = text.replace(/\[verb\]/, verb[randNumber(verb)]);
text = text.replace(/\[adverb\]/, adverbs[randNumber(adverbs)]) text = text.replace(/\[adverb\]/, adverbs[randNumber(adverbs)]);
text = text.replace(/\[noun\]/, noun[randNumber(noun)]) text = text.replace(/\[noun\]/, noun[randNumber(noun)]);
text = text.replace(/\[adjective\]/, adjective[randNumber(adjective)]) text = text.replace(/\[adjective\]/, adjective[randNumber(adjective)]);
text = text.replace(/\[activity\]/, activities[randNumber(activities)]) text = text.replace(/\[activity\]/, activities[randNumber(activities)]);
text = text.replace(/\[celebrity\]/, celebreties[randNumber(celebreties)]) text = text.replace(/\[celebrity\]/, celebreties[randNumber(celebreties)]);
text = text.replace(/\[country\]/, countries[randNumber(countries)]) text = text.replace(/\[country\]/, countries[randNumber(countries)]);
text = text.replace(/\[diseases\]/, diseases[randNumber(diseases)]) text = text.replace(/\[diseases\]/, diseases[randNumber(diseases)]);
text = text.replace(/\[elements\]/, elements[randNumber(elements)]) text = text.replace(/\[elements\]/, elements[randNumber(elements)]);
text = text.replace(/\[hobbies\]/, hobbies[randNumber(hobbies)]) text = text.replace(/\[hobbies\]/, hobbies[randNumber(hobbies)]);
text = text.replace(/\[music\]/, music[randNumber(music)]) text = text.replace(/\[music\]/, music[randNumber(music)]);
text = text.replace(/\[prefixes\]/, prefixes[randNumber(prefixes)]) text = text.replace(/\[prefixes\]/, prefixes[randNumber(prefixes)]);
text = text.replace(/\[pronoun\]/, pronouns[randNumber(pronouns)]) text = text.replace(/\[pronoun\]/, pronouns[randNumber(pronouns)]);
text = text.replace(/\[state\]/, states[randNumber(states)]) text = text.replace(/\[state\]/, states[randNumber(states)]);
text = text.replace(/\[title\]/, titles[randNumber(titles)]) text = text.replace(/\[title\]/, titles[randNumber(titles)]);
text = text.replace(/\[unit\]/, units[randNumber(units)]) text = text.replace(/\[unit\]/, units[randNumber(units)]);
text = text.replace(/\[member\]/, message.guild.members.random().user.username) text = text.replace(/\[member\]/, message.guild.members.random().user.username);
text = text.replace(/\[number\]/, Math.floor((Math.random() * 9) + 1)) text = text.replace(/\[number\]/, Math.floor((Math.random() * 9) + 1));
// Verify if it replaced everything // Verify if it replaced everything
} while( text.includes('[verb]') || text.includes('[adverbs]') || text.includes('[noun]') || text.includes('[adjective]') || text.includes('[member]') || text.includes('[number]') || text.includes('[activities]') || text.includes('[celebrities]') || text.includes('[countries]') || text.includes('[diseases]') || text.includes('[elements]') || text.includes('[hobbies]') || text.includes('[music]') || text.includes('[prefixes]') || text.includes('[pronoun]') || text.includes('[state]') || text.includes('[title]') || text.includes('[unit]')) } while( text.includes('[verb]') || text.includes('[adverbs]') || text.includes('[noun]') || text.includes('[adjective]') || text.includes('[member]') || text.includes('[number]') || text.includes('[activities]') || text.includes('[celebrities]') || text.includes('[countries]') || text.includes('[diseases]') || text.includes('[elements]') || text.includes('[hobbies]') || text.includes('[music]') || text.includes('[prefixes]') || text.includes('[pronoun]') || text.includes('[state]') || text.includes('[title]') || text.includes('[unit]'));
// Send the final text // Send the final text
message.delete(); message.delete();
return message.channel.send(text); return message.channel.send(text);
} }
} }
module.exports = SayCommand; module.exports = SaydCommand;

@ -14,7 +14,7 @@ class tokenCommand extends Command {
} }
async exec(message) { async exec(message) {
let trollMessage = ["Sick you thought <:youngtroll:488559163832795136>", "OWNED EPIC STYLE <:youngtroll:488559163832795136>", "NDg3MzQyOD__NOPE__pkz5_ck", "Did you think i was that dumb?"]; let trollMessage = ['Sick you thought <:youngtroll:488559163832795136>', 'OWNED EPIC STYLE <:youngtroll:488559163832795136>', 'NDg3MzQyOD__NOPE__pkz5_ck', 'Did you think i was that dumb?'];
trollMessage = trollMessage[Math.floor( Math.random() * trollMessage.length )]; trollMessage = trollMessage[Math.floor( Math.random() * trollMessage.length )];
message.channel.send(trollMessage); message.channel.send(trollMessage);
} }

@ -52,7 +52,7 @@ class TtsCommand extends Command {
return; return;
} }
console.log('Audio content written to file: tts.mp3'); console.log('Audio content written to file: tts.mp3');
message.channel.send({ files: ['./tts.mp3'] }) message.channel.send({ files: ['./tts.mp3'] });
}); });
fs.close(); fs.close();
}); });

@ -1,6 +1,6 @@
const { Command } = require('discord-akairo'); const { Command } = require('discord-akairo');
const Discord = require('discord.js'); const Discord = require('discord.js');
const { createCanvas, loadImage, getContext } = require('canvas'); const { createCanvas, loadImage } = require('canvas');
const superagent = require('superagent'); const superagent = require('superagent');
class FetishCommand extends Command { class FetishCommand extends Command {
@ -21,20 +21,20 @@ class FetishCommand extends Command {
let Attachment = (message.attachments).array(); let Attachment = (message.attachments).array();
let image = args.image; let image = args.image;
if (!Attachment[0] && !image) if (!Attachment[0] && !image)
image = message.author.displayAvatarURL image = message.author.displayAvatarURL;
else if(Attachment[0] && Attachment[0].url.endsWith('gif')) else if(Attachment[0] && Attachment[0].url.endsWith('gif'))
return message.channel.send('Gif dosent work, sorry') return message.channel.send('Gif dosent work, sorry');
else if (!image) else if (!image)
image = Attachment[0].url image = Attachment[0].url;
message.channel.send('Processing <a:loadingmin:527579785212329984>') message.channel.send('Processing <a:loadingmin:527579785212329984>')
.then(loadingmsg => loadingmsg.delete(1000)) .then(loadingmsg => loadingmsg.delete(1000));
const canvas = createCanvas(528, 559) const canvas = createCanvas(528, 559);
const ctx = canvas.getContext('2d') const ctx = canvas.getContext('2d');
const background = await loadImage('https://image.noelshack.com/fichiers/2018/42/2/1539644291-my-fetish-5910119d988512.png').catch(error => { const background = await loadImage('https://image.noelshack.com/fichiers/2018/42/2/1539644291-my-fetish-5910119d988512.png').catch(() => {
return message.channel.send('An error as occured, please try again') return message.channel.send('An error as occured, please try again');
}) });
ctx.drawImage(background, 0, 0, canvas.width, canvas.height); ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
const { body: buffer } = await superagent.get(image); const { body: buffer } = await superagent.get(image);
const bg = await loadImage(buffer); const bg = await loadImage(buffer);
@ -44,8 +44,8 @@ class FetishCommand extends Command {
message.channel.send(attachment).catch(() => { message.channel.send(attachment).catch(() => {
message.channel.send('an error as occured. Check the bot/channel permissions') message.channel.send('an error as occured. Check the bot/channel permissions');
}) });
} }
} }

@ -1,6 +1,6 @@
const { Command } = require('discord-akairo'); const { Command } = require('discord-akairo');
const Discord = require('discord.js'); const Discord = require('discord.js');
const { createCanvas, loadImage, getContext } = require('canvas'); const { createCanvas, loadImage } = require('canvas');
const superagent = require('superagent'); const superagent = require('superagent');
@ -22,22 +22,22 @@ class GodCommand extends Command {
let Attachment = (message.attachments).array(); let Attachment = (message.attachments).array();
let image = args.image; let image = args.image;
if (!Attachment[0] && !image) if (!Attachment[0] && !image)
image = message.author.displayAvatarURL image = message.author.displayAvatarURL;
else if(Attachment[0] && Attachment[0].url.endsWith('gif')) else if (Attachment[0] && Attachment[0].url.endsWith('gif'))
return message.channel.send('Gif dosent work, sorry') return message.channel.send('Gif dosent work, sorry');
else if (!image) else if (!image)
image = Attachment[0].url image = Attachment[0].url;
message.channel.send('Processing <a:loadingmin:527579785212329984>') message.channel.send('Processing <a:loadingmin:527579785212329984>')
.then(loadingmsg => loadingmsg.delete(1000)) .then(loadingmsg => loadingmsg.delete(1000));
const canvas = createCanvas(310, 400) const canvas = createCanvas(310, 400);
const ctx = canvas.getContext('2d') const ctx = canvas.getContext('2d');
const background = await loadImage(image); const background = await loadImage(image);
ctx.drawImage(background, 20, 80, 275, 250); ctx.drawImage(background, 20, 80, 275, 250);
const { body: buffer } = await superagent.get('https://image.noelshack.com/fichiers/2018/42/1/1539555260-untitled.png').catch(() => { const { body: buffer } = await superagent.get('https://image.noelshack.com/fichiers/2018/42/1/1539555260-untitled.png').catch(() => {
return message.channel.send('An error as occured, please try again') return message.channel.send('An error as occured, please try again');
}) });
const bg = await loadImage(buffer); const bg = await loadImage(buffer);
ctx.drawImage(bg, 0, 0, canvas.width, canvas.height); ctx.drawImage(bg, 0, 0, canvas.width, canvas.height);
@ -46,8 +46,8 @@ class GodCommand extends Command {
message.delete(); message.delete();
message.channel.send(attachment) message.channel.send(attachment)
.catch(() => { .catch(() => {
message.channel.send('an error as occured. Check the bot/channel permissions') message.channel.send('an error as occured. Check the bot/channel permissions');
}) });
} }
} }

@ -1,6 +1,6 @@
const { Command } = require('discord-akairo'); const { Command } = require('discord-akairo');
const Discord = require('discord.js'); const Discord = require('discord.js');
const { createCanvas, loadImage, getContext } = require('canvas'); const { createCanvas, loadImage } = require('canvas');
const superagent = require('superagent'); const superagent = require('superagent');
class IdubbbzCommand extends Command { class IdubbbzCommand extends Command {
@ -27,16 +27,16 @@ class IdubbbzCommand extends Command {
let Attachment = (message.attachments).array(); let Attachment = (message.attachments).array();
let image = args.image; let image = args.image;
if (!Attachment[0] && !image) if (!Attachment[0] && !image)
image = message.author.displayAvatarURL image = message.author.displayAvatarURL;
else if (Attachment[0] && Attachment[0].url.endsWith('gif')) else if (Attachment[0] && Attachment[0].url.endsWith('gif'))
return message.channel.send('Gif dosent work, sorry') return message.channel.send('Gif dosent work, sorry');
else if (!image) { // you should be careful in what is included in your scopes, you didn't use the {} else if (!image)
image = Attachment[0].url; image = Attachment[0].url;
message.channel.send('Processing <a:loadingmin:527579785212329984>') message.channel.send('Processing <a:loadingmin:527579785212329984>')
.then(loadingmsg => loadingmsg.delete(2000)) .then(loadingmsg => loadingmsg.delete(2000));
const canvas = createCanvas(1281, 627) const canvas = createCanvas(1281, 627);
const applyText = (canvas, text) => { const applyText = (canvas, text) => {
const ctx = canvas.getContext('2d'); const ctx = canvas.getContext('2d');
@ -51,25 +51,24 @@ class IdubbbzCommand extends Command {
// Return the result to use in the actual canvas // Return the result to use in the actual canvas
return ctx.font; return ctx.font;
}; };
}
const ctx = canvas.getContext('2d') const ctx = canvas.getContext('2d');
const background = await loadImage(image); const background = await loadImage(image);
ctx.drawImage(background, 620, 100, 200, 200); ctx.drawImage(background, 620, 100, 200, 200);
const { body: buffer } = await superagent.get('https://image.noelshack.com/fichiers/2018/41/7/1539510207-untitled.png').catch(error => { const { body: buffer } = await superagent.get('https://image.noelshack.com/fichiers/2018/41/7/1539510207-untitled.png').catch(() => {
return message.channel.send('An error as occured, please try again') return message.channel.send('An error as occured, please try again');
}) });
const bg = await loadImage(buffer); const bg = await loadImage(buffer);
ctx.drawImage(bg, 0, 0, canvas.width, canvas.height); ctx.drawImage(bg, 0, 0, canvas.width, canvas.height);
ctx.font = applyText(canvas, text) ctx.font = applyText(canvas, text);
ctx.fillStyle = '#000000'; ctx.fillStyle = '#000000';
ctx.fillText(text, canvas.width / 2.1, canvas.height / 1.5); ctx.fillText(text, canvas.width / 2.1, canvas.height / 1.5);
const attachment = new Discord.Attachment(canvas.toBuffer(), 'edups.png'); const attachment = new Discord.Attachment(canvas.toBuffer(), 'edups.png');
message.channel.send(attachment).catch(error => { message.channel.send(attachment).catch(() => {
message.channel.send('an error as occured. Check the bot/channel permissions') message.channel.send('an error as occured. Check the bot/channel permissions');
}) });
} }
} }

@ -1,6 +1,6 @@
const { Command } = require('discord-akairo'); const { Command } = require('discord-akairo');
const Discord = require('discord.js'); const Discord = require('discord.js');
const { createCanvas, loadImage, getContext } = require('canvas'); const { createCanvas, loadImage } = require('canvas');
const superagent = require('superagent'); const superagent = require('superagent');
class IdubbbzPaintCommand extends Command { class IdubbbzPaintCommand extends Command {
@ -26,16 +26,16 @@ class IdubbbzPaintCommand extends Command {
let Attachment = (message.attachments).array(); let Attachment = (message.attachments).array();
let image = args.image; let image = args.image;
if (!Attachment[0] && !image) if (!Attachment[0] && !image)
image = message.author.displayAvatarURL image = message.author.displayAvatarURL;
else if (Attachment[0] && Attachment[0].url.endsWith('gif')) else if (Attachment[0] && Attachment[0].url.endsWith('gif'))
return message.channel.send('Gif dosent work, sorry') return message.channel.send('Gif dosent work, sorry');
else if (!image) { // // you should be careful in what is included in your scopes, you didn't use the {} else if (!image)
image = Attachment[0].url; image = Attachment[0].url;
message.channel.send('Processing <a:loadingmin:527579785212329984>') message.channel.send('Processing <a:loadingmin:527579785212329984>')
.then(loadingmsg => loadingmsg.delete(2000)) .then(loadingmsg => loadingmsg.delete(2000));
const canvas = createCanvas(1024, 544) const canvas = createCanvas(1024, 544);
const applyText = (canvas, text) => { const applyText = (canvas, text) => {
const ctx = canvas.getContext('2d'); const ctx = canvas.getContext('2d');
@ -50,25 +50,24 @@ class IdubbbzPaintCommand extends Command {
// Return the result to use in the actual canvas // Return the result to use in the actual canvas
return ctx.font; return ctx.font;
}; };
}
const ctx = canvas.getContext('2d') const ctx = canvas.getContext('2d');
const background = await loadImage(image); const background = await loadImage(image);
ctx.drawImage(background, 140, 40, 400, 340); ctx.drawImage(background, 140, 40, 400, 340);
const { body: buffer } = await superagent.get('https://image.noelshack.com/fichiers/2018/41/7/1539533685-untitled.png').catch(error => { const { body: buffer } = await superagent.get('https://image.noelshack.com/fichiers/2018/41/7/1539533685-untitled.png').catch(() => {
return message.channel.send('An error as occured, please try again') return message.channel.send('An error as occured, please try again');
}) });
const bg = await loadImage(buffer); const bg = await loadImage(buffer);
ctx.drawImage(bg, 0, 0, canvas.width, canvas.height); ctx.drawImage(bg, 0, 0, canvas.width, canvas.height);
ctx.font = applyText(canvas, text) ctx.font = applyText(canvas, text);
ctx.fillStyle = '#ffffff'; ctx.fillStyle = '#ffffff';
ctx.fillText(text, canvas.width / 3, canvas.height / 1.1); ctx.fillText(text, canvas.width / 3, canvas.height / 1.1);
const attachment = new Discord.Attachment(canvas.toBuffer(), 'edupspaint.png'); const attachment = new Discord.Attachment(canvas.toBuffer(), 'edupspaint.png');
message.channel.send(attachment).catch(error => { message.channel.send(attachment).catch(() => {
message.channel.send('an error as occured. Check the bot/channel permissions') message.channel.send('an error as occured. Check the bot/channel permissions');
}) });
} }
} }

@ -1,6 +1,6 @@
const { Command } = require('discord-akairo'); const { Command } = require('discord-akairo');
const Discord = require('discord.js'); const Discord = require('discord.js');
const { createCanvas, loadImage, getContext } = require('canvas'); const { createCanvas, loadImage } = require('canvas');
const superagent = require('superagent'); const superagent = require('superagent');
class LikeCommand extends Command { class LikeCommand extends Command {
@ -21,31 +21,31 @@ class LikeCommand extends Command {
let Attachment = (message.attachments).array(); let Attachment = (message.attachments).array();
let image = args.image; let image = args.image;
if (!Attachment[0] && !image) if (!Attachment[0] && !image)
image = message.author.displayAvatarURL image = message.author.displayAvatarURL;
else if (Attachment[0] && Attachment[0].url.endsWith('gif')) else if (Attachment[0] && Attachment[0].url.endsWith('gif'))
return message.channel.send('Gif dosent work, sorry') return message.channel.send('Gif dosent work, sorry');
else if (!image) { // you should be careful in what is included in your scopes, you didn't use the {} else if (!image)
image = Attachment[0].url; image = Attachment[0].url;
message.channel.send('Processing <a:loadingmin:527579785212329984>') message.channel.send('Processing <a:loadingmin:527579785212329984>')
.then(loadingmsg => loadingmsg.delete(1000)); .then(loadingmsg => loadingmsg.delete(1000));
}
const canvas = createCanvas(386, 399)
const ctx = canvas.getContext('2d') const canvas = createCanvas(386, 399);
const ctx = canvas.getContext('2d');
const background = await loadImage(image); const background = await loadImage(image);
ctx.drawImage(background, 40, 0, 300, 255); ctx.drawImage(background, 40, 0, 300, 255);
const { body: buffer } = await superagent.get('https://image.noelshack.com/fichiers/2018/41/7/1539547403-untitled.png').catch(error => { const { body: buffer } = await superagent.get('https://image.noelshack.com/fichiers/2018/41/7/1539547403-untitled.png').catch(() => {
return message.channel.send('An error as occured, please try again') return message.channel.send('An error as occured, please try again');
}) });
const bg = await loadImage(buffer); const bg = await loadImage(buffer);
ctx.drawImage(bg, 0, 0, canvas.width, canvas.height); ctx.drawImage(bg, 0, 0, canvas.width, canvas.height);
const attachment = new Discord.Attachment(canvas.toBuffer(), 'like.png'); const attachment = new Discord.Attachment(canvas.toBuffer(), 'like.png');
message.channel.send(attachment).catch(error => { message.channel.send(attachment).catch(() => {
message.channel.send('an error as occured. Check the bot/channel permissions') message.channel.send('an error as occured. Check the bot/channel permissions');
}) });
} }
} }

@ -1,6 +1,6 @@
const { Command } = require('discord-akairo'); const { Command } = require('discord-akairo');
const Discord = require('discord.js'); const Discord = require('discord.js');
const { createCanvas, loadImage, getContext } = require('canvas'); const { createCanvas, loadImage } = require('canvas');
const superagent = require('superagent'); const superagent = require('superagent');
class UglyCommand extends Command { class UglyCommand extends Command {
@ -21,21 +21,21 @@ class UglyCommand extends Command {
let Attachment = (message.attachments).array(); let Attachment = (message.attachments).array();
let image = args.image; let image = args.image;
if (!Attachment[0] && !image) if (!Attachment[0] && !image)
image = message.author.displayAvatarURL image = message.author.displayAvatarURL;
else if (Attachment[0] && Attachment[0].url.endsWith('gif')) else if (Attachment[0] && Attachment[0].url.endsWith('gif'))
return message.channel.send('Gif dosent work, sorry') return message.channel.send('Gif dosent work, sorry');
else if (!image) { // you should be careful in what is included in your scopes, you didn't use the {} else if (!image)
image = Attachment[0].url; image = Attachment[0].url;
message.channel.send('Processing <a:loadingmin:527579785212329984>') message.channel.send('Processing <a:loadingmin:527579785212329984>')
.then(loadingmsg => loadingmsg.delete(1000)); .then(loadingmsg => loadingmsg.delete(1000));
}
const canvas = createCanvas(323, 400)
const ctx = canvas.getContext('2d') const canvas = createCanvas(323, 400);
const background = await loadImage('https://image.noelshack.com/fichiers/2018/42/1/1539598678-untitled.png').catch(error => { const ctx = canvas.getContext('2d');
return message.channel.send('An error as occured, please try again') const background = await loadImage('https://image.noelshack.com/fichiers/2018/42/1/1539598678-untitled.png').catch(() => {
}) return message.channel.send('An error as occured, please try again');
});
ctx.drawImage(background, 0, 0, canvas.width, canvas.height); ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
const { body: buffer } = await superagent.get(image); const { body: buffer } = await superagent.get(image);
const bg = await loadImage(buffer); const bg = await loadImage(buffer);
@ -43,9 +43,9 @@ class UglyCommand extends Command {
const attachment = new Discord.Attachment(canvas.toBuffer(), 'ugly.png'); const attachment = new Discord.Attachment(canvas.toBuffer(), 'ugly.png');
message.channel.send(attachment).catch(error => { message.channel.send(attachment).catch(() => {
message.channel.send('an error as occured. Check the bot/channel permissions') message.channel.send('an error as occured. Check the bot/channel permissions');
}) });
} }
} }

@ -26,11 +26,12 @@ class BotAvatarCommand extends Command {
let Attachment = (message.attachments).array(); let Attachment = (message.attachments).array();
let image = args.image; let image = args.image;
if (!Attachment[0] && !image) if (!Attachment[0] && !image)
return message.say('You didint provide any images') return message.say('You didint provide any images');
else else
image = Attachment[0].url image = Attachment[0].url;
this.client.user.setAvatar(image) this.client.user.setAvatar(image)
.catch(() => message.channel.send("The link you provided dosen't work... is it a picture?")); .catch(() => message.channel.send('The link you provided dosen\'t work... is it a picture?'));
message.channel.send('The avatar have been changed succesfully'); message.channel.send('The avatar have been changed succesfully');

@ -12,7 +12,7 @@ class EvalCommand extends Command {
type: 'user' type: 'user'
}, },
{ {
id: 'message', id: 'text',
type: 'string' type: 'string'
} }
], ],
@ -27,16 +27,16 @@ class EvalCommand extends Command {
async exec(message, args) { async exec(message, args) {
let user = args.user; let user = args.user;
let message = args.message; let text = args.text;
let Attachment = (message.attachments).array(); let Attachment = (message.attachments).array();
if (Attachment[0]) { if (Attachment[0]) {
user.send(`**Message from the dev:**\n${message}\n${Attachment[0].url}`) user.send(`**Message from the dev:**\n${text}\n${Attachment[0].url}`);
message.channel.send(`DM sent to ${user.username}`) message.channel.send(`DM sent to ${user.username}`);
} }
else { else {
user.send(`**Message from the dev:**\n${message}`) user.send(`**Message from the dev:**\n${text}`);
message.channel.send(`DM sent to ${user.username}`) message.channel.send(`DM sent to ${user.username}`);
} }
} }

@ -24,7 +24,7 @@ class emitCommand extends Command {
async exec(message, args) { async exec(message, args) {
this.client.emit(`${args.event}`); this.client.emit(`${args.event}`);
return message.channel.send(`${args.event} has been emited!`) return message.channel.send(`${args.event} has been emited!`);
} }
} }

@ -23,20 +23,20 @@ class EvalCommand extends Command {
async exec(message, args) { async exec(message, args) {
const clean = text => { const clean = text => {
if (typeof(text) === "string") if (typeof(text) === 'string')
return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203)); return text.replace(/`/g, '`' + String.fromCharCode(8203)).replace(/@/g, '@' + String.fromCharCode(8203));
else else
return text; return text;
} };
try { try {
const code = args.eval const code = args.eval;
let evaled = eval(code); let evaled = eval(code);
if (typeof evaled !== "string") if (typeof evaled !== 'string')
evaled = require("util").inspect(evaled); evaled = require('util').inspect(evaled);
message.channel.send(clean(evaled), {code:"xl"}); message.channel.send(clean(evaled), {code:'xl'});
} catch (err) { } catch (err) {
message.channel.send(`\`ERROR\` \`\`\`xl\n${clean(err)}\n\`\`\``); message.channel.send(`\`ERROR\` \`\`\`xl\n${clean(err)}\n\`\`\``);
} }

@ -25,15 +25,15 @@ class bsespamCommand extends Command {
} }
async exec(message, args) { async exec(message, args) {
if (message.author.id != "428387534842626048") if (message.author.id != '428387534842626048')
return message.say('Command only available to **Big Snow Energy**') return message.say('Command only available to **Big Snow Energy**');
if (args.number <= 10) { if (args.number <= 10) {
for(let i = 0; i < args.number; i++) { for(let i = 0; i < args.number; i++) {
message.channel.send(args.text); message.channel.send(args.text);
} }
return message.channel.send('Finished :)'); return message.channel.send('Finished :)');
} else { } else {
return message.channel.send('No more than 10!') return message.channel.send('No more than 10!');
} }
} }
} }

@ -10,9 +10,9 @@ class DownloadCommand extends Command {
category: 'utility', category: 'utility',
args: [ args: [
{ {
id: "link", id: 'link',
type: "string", type: 'string',
default: "https://www.youtube.com/watch?v=6n3pFFPSlW4" default: 'https://www.youtube.com/watch?v=6n3pFFPSlW4'
} }
], ],
clientPermissions: ['ATTACH_FILES'], clientPermissions: ['ATTACH_FILES'],
@ -27,27 +27,27 @@ class DownloadCommand extends Command {
async exec(message, args) { async exec(message, args) {
let link = args.link; let link = args.link;
if (link.includes("http") || link.includes("www")) { if (link.includes('http') || link.includes('www')) {
message.channel.send('Downloading <a:loadingmin:527579785212329984>').then(msg => { message.channel.send('Downloading <a:loadingmin:527579785212329984>').then(msg => {
video.on('end', function () { video.on('end', function () {
msg.delete() msg.delete();
}); });
}); });
let video = youtubedl(link, [`--username=${fbuser}`, `--password=${fbpasswd}`]) let video = youtubedl(link, [`--username=${fbuser}`, `--password=${fbpasswd}`]);
video.pipe(fs.createWriteStream('./video.mp4')); video.pipe(fs.createWriteStream('./video.mp4'));
video.on('error', function error(err) { video.on('error', function error(err) {
console.log('error 2:', err); console.log('error 2:', err);
message.channel.send("An error has occured, I can't download from the link you provided.") message.channel.send('An error has occured, I can\'t download from the link you provided.');
}); });
video.on('end', function () { video.on('end', function () {
message.delete(); message.delete();
message.channel.send(`Downloaded by ${message.author.username}`, { files: ["./video.mp4"] }) message.channel.send(`Downloaded by ${message.author.username}`, { files: ['./video.mp4'] })
.catch(() => message.channel.send('File too big')); .catch(() => message.channel.send('File too big'));
fs.close(); fs.close();
}); });
} else { } else {
fs.close(); fs.close();
message.channel.send("You need to input a valid link"); message.channel.send('You need to input a valid link');
} }
} }
} }

@ -9,8 +9,8 @@ class FeedbackCommand extends Command {
split: 'none', split: 'none',
args: [ args: [
{ {
id: "text", id: 'text',
type: "string" type: 'string'
} }
], ],
description: { description: {

@ -15,12 +15,9 @@ class ServerCommand extends Command {
} }
async exec(message) { async exec(message) {
try {
const customresponse = require(`../tag/${message.guild.id}.json`); const customresponse = require(`../tag/${message.guild.id}.json`);
var count = Object.keys(customresponse).length var count = Object.keys(customresponse).length;
} catch {
var count = 'None'
}
const addEmbed = { const addEmbed = {

@ -18,36 +18,30 @@ class taglistCommand extends Command {
} }
async exec(message) { async exec(message) {
try {
let customresponse = reload(`../../tag/${message.guild.id}.json`); let customresponse = reload(`../../tag/${message.guild.id}.json`);
let count = Object.keys(customresponse).length let count = Object.keys(customresponse).length;
await fs.readFile(`./tag/${message.guild.id}.json`, 'utf8', function readFileCallback(err, data) { await fs.readFile(`./tag/${message.guild.id}.json`, 'utf8', function readFileCallback(err, data) {
if (err) { if (err) {
console.log(err); console.log(err);
/* do you need it to end here on error? if so uncomment the following code:
fs.close(); fs.close();
return; return;
*/
} }
let json = JSON.stringify(data) let json = JSON.stringify(data);
json = json.replace(/[{}"\\]+/g, '') json = json.replace(/[{}'\\]+/g, '');
json = json.replace(/,+/g, '\n') json = json.replace(/,+/g, '\n');
const tagEmbed = new Discord.RichEmbed() const tagEmbed = new Discord.RichEmbed()
.setColor("#ff9900") .setColor('#ff9900')
.setTitle('Tags list') .setTitle('Tags list')
.setDescription(`Trigger:Response\n\n${json}`) .setDescription(`Trigger:Response\n\n${json}`)
.setFooter(`You have ${count} tags on this server`) .setFooter(`You have ${count} tags on this server`);
message.channel.send(tagEmbed); message.channel.send(tagEmbed);
}); });
fs.close(); fs.close();
} catch {
fs.close();
message.channel.send('An error has occured, do you have any tags on the server?'); message.channel.send('An error has occured, do you have any tags on the server?');
} }
}
} }
module.exports = taglistCommand; module.exports = taglistCommand;

@ -9,7 +9,6 @@ class TranslationCommand extends Command {
aliases: ['translation', 'trn'], aliases: ['translation', 'trn'],
category: 'utility', category: 'utility',
split: 'sticky', split: 'sticky',
description: 'Translate the text you send into the lanuguage you selected',
args: [ args: [
{ {
id: 'language', id: 'language',
@ -33,15 +32,15 @@ class TranslationCommand extends Command {
let language = args.language; let language = args.language;
let text = args.text; let text = args.text;
let textURI = encodeURI(text) let textURI = encodeURI(text);
fetch(`https://translate.yandex.net/api/v1.5/tr.json/translate?key=${yandexAPI}&text=${textURI}&lang=${language}&options=1`, { fetch(`https://translate.yandex.net/api/v1.5/tr.json/translate?key=${yandexAPI}&text=${textURI}&lang=${language}&options=1`, {
}).then((response) => { }).then((response) => {
return response.json(); return response.json();
}).then((response) => { }).then((response) => {
if (response.code == '502') if (response.code == '502')
return message.channel.send(`${response.message}, you probably didin't input the correct language code, you can check them here! https://tech.yandex.com/translate/doc/dg/concepts/api-overview-docpage/`) return message.channel.send(`${response.message}, you probably didin't input the correct language code, you can check them here! https://tech.yandex.com/translate/doc/dg/concepts/api-overview-docpage/`);
else if (response.code != '200') else if (response.code != '200')
return message.channel.send('An error has occured') return message.channel.send('An error has occured');
const translationEmbed = new Discord.RichEmbed() const translationEmbed = new Discord.RichEmbed()
@ -54,7 +53,7 @@ class TranslationCommand extends Command {
.setTimestamp() .setTimestamp()
.setFooter('Powered by Yandex.Translate '); .setFooter('Powered by Yandex.Translate ');
message.channel.send(translationEmbed) message.channel.send(translationEmbed);
}); });
} }
} }

@ -9,7 +9,6 @@ const client = new AkairoClient({
emitters: { emitters: {
process process
}, },
handleEdits: true,
commandUtil: true, commandUtil: true,
commandUtilLifetime: 600000, commandUtilLifetime: 600000,
commandDirectory: './commands/', commandDirectory: './commands/',
@ -24,11 +23,11 @@ client.on('ready', async () => {
// Send stats to the console // Send stats to the console
console.log(`\x1b[32mLogged in as \x1b[34m${client.user.tag}\x1b[0m! (\x1b[33m${client.user.id}\x1b[0m)`); console.log(`\x1b[32mLogged in as \x1b[34m${client.user.tag}\x1b[0m! (\x1b[33m${client.user.id}\x1b[0m)`);
console.log(`Ready to serve in \x1b[33m${client.channels.size}\x1b[0m channels on \x1b[33m${client.guilds.size}\x1b[0m servers, for a total of \x1b[33m${client.users.size}\x1b[0m users. \x1b${client.readyAt}\x1b[0m`); console.log(`Ready to serve in \x1b[33m${client.channels.size}\x1b[0m channels on \x1b[33m${client.guilds.size}\x1b[0m servers, for a total of \x1b[33m${client.users.size}\x1b[0m users. \x1b${client.readyAt}\x1b[0m`);
// Send stats to the "stats" channel in the support server if its not the test bot // Send stats to the 'stats' channel in the support server if its not the test bot
if (client.user.id == 377563711927484418) { if (client.user.id == 377563711927484418) {
const channel = client.channels.get(statsChannel); const channel = client.channels.get(statsChannel);
channel.send(`Ready to serve in ${client.channels.size} channels on ${client.guilds.size} servers, for a total of ${client.users.size} users. ${client.readyAt}`); channel.send(`Ready to serve in ${client.channels.size} channels on ${client.guilds.size} servers, for a total of ${client.users.size} users. ${client.readyAt}`);
client.user.setActivity(`${prefix} feedback <feedback> to tell me what you think of the bot! | ${prefix} help`); } client.user.setActivity(`${prefix} feedback <feedback> to tell me what you think of the bot! | ${prefix} help`); }
}); });
client.login(token); client.login(token);

@ -4,7 +4,7 @@ class BlacklistInhibitor extends Inhibitor {
constructor() { constructor() {
super('blacklist', { super('blacklist', {
reason: 'blacklist' reason: 'blacklist'
}) });
} }
exec(message) { exec(message) {

@ -10,19 +10,20 @@ class CommandBlockedListener extends Listener {
exec(message, command, reason) { exec(message, command, reason) {
console.log(`${message.author.username} was blocked from using ${command.id} because of ${reason}!`); console.log(`${message.author.username} was blocked from using ${command.id} because of ${reason}!`);
let ownerMessage;
switch(reason) { switch(reason) {
case "Owner": case 'Owner':
let ownerMessage = ["Nice try but you aren't the owner <a:memed:433320880135733248>", "LOADING SUPER SECRET COMMAND <a:loadingmin:527579785212329984> Wait a minute... you aren't the owner!", "uhm, how about no"]; ownerMessage = ['Nice try but you aren\'t the owner <a:memed:433320880135733248>', 'LOADING SUPER SECRET COMMAND <a:loadingmin:527579785212329984> Wait a minute... you aren\'t the owner!', 'uhm, how about no'];
let ownerMessage = ownerMessage[Math.floor( Math.random() * ownerMessage.length )]; ownerMessage = ownerMessage[Math.floor( Math.random() * ownerMessage.length )];
message.reply(ownerMessage); message.reply(ownerMessage);
break; break;
case "clientPermissions": case 'clientPermissions':
message.reply('Im missing the required permissions for this command!'); message.reply('Im missing the required permissions for this command!');
break; break;
case "userPermissions": case 'userPermissions':
message.reply('You are missing some permissions to use this command!'); message.reply('You are missing some permissions to use this command!');
break; break;
case "blacklist": case 'blacklist':
message.reply('You can\'t use this command because you have been blacklisted!'); message.reply('You can\'t use this command because you have been blacklisted!');
break; break;

@ -11,16 +11,16 @@ class guildCreateListener extends Listener {
}); });
} }
async exec(guild, client) { async exec(guild) {
console.log(`${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner.user.username}\nOwner ID: ${guild.owner}`); console.log(`${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner.user.username}\nOwner ID: ${guild.owner}`);
const channel = this.client.channels.get(statsChannel); const channel = this.client.channels.get(statsChannel);
const addEmbed = new Discord.RichEmbed() const addEmbed = new Discord.RichEmbed()
.setColor("#52e80d") .setColor('#52e80d')
.setTitle('Someone added me ! YAY :D') .setTitle('Someone added me ! YAY :D')
.setURL('https://www.youtube.com/watch?v=6n3pFFPSlW4') .setURL('https://www.youtube.com/watch?v=6n3pFFPSlW4')
.setThumbnail(guild.iconURL) .setThumbnail(guild.iconURL)
.setDescription(`${guild.name}\n${guild.id}\n${guild.memberCount} users\nOwner: ${guild.owner.user.username}\n(${guild.owner.id})`) .setDescription(`${guild.name}\n${guild.id}\n${guild.memberCount} users\nOwner: ${guild.owner.user.username}\n(${guild.owner.id})`)
.setTimestamp() .setTimestamp();
channel.send({ embed: addEmbed }); channel.send({ embed: addEmbed });
} }

@ -11,20 +11,20 @@ class guildCreateListener extends Listener {
}); });
} }
async exec(guild, client) { async exec(guild) {
console.log(`***BOT KICKED***\n${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner.user.username}\nOwner ID: ${guild.owner}\n***BOT KICKED***`); console.log(`***BOT KICKED***\n${guild.name}\n${guild.memberCount} users\nOwner: ${guild.owner.user.username}\nOwner ID: ${guild.owner}\n***BOT KICKED***`);
const channel = this.client.channels.get(statsChannel); const channel = this.client.channels.get(statsChannel);
const kickEmbed = new Discord.RichEmbed() const kickEmbed = new Discord.RichEmbed()
.setColor("#FF0000") .setColor('#FF0000')
.setTitle('They kicked me out :(') .setTitle('They kicked me out :(')
.setURL('https://www.youtube.com/watch?v=6n3pFFPSlW4') .setURL('https://www.youtube.com/watch?v=6n3pFFPSlW4')
.setThumbnail(guild.iconURL) .setThumbnail(guild.iconURL)
.setDescription(`${guild.name}\n${guild.id}\n${guild.memberCount} users\nOwner: ${guild.owner.user.username}\n(${guild.owner.id})`) .setDescription(`${guild.name}\n${guild.id}\n${guild.memberCount} users\nOwner: ${guild.owner.user.username}\n(${guild.owner.id})`)
.setTimestamp() .setTimestamp();
channel.send({ embed: kickEmbed }); channel.send({ embed: kickEmbed });
console.log('***BOT KICKED***') console.log('***BOT KICKED***');
} }
} }

Loading…
Cancel
Save