forked from Supositware/Haha-Yes
Changed indent
This commit is contained in:
parent
e8ce566c4b
commit
a64c0a2cc8
54 changed files with 1727 additions and 1740 deletions
|
@ -51,7 +51,7 @@ class autoresponseCommand extends Command {
|
|||
fs.close();
|
||||
return console.log(err);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -71,10 +71,10 @@ class autoresponseCommand extends Command {
|
|||
fs.close();
|
||||
return console.log(err);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
fs.close();
|
||||
return message.channel.send(`Autoresponse have been ${text}d`);
|
||||
|
|
|
@ -32,14 +32,14 @@ class BanCommand extends Command {
|
|||
let reasons = args.reasons;
|
||||
|
||||
if(member == this.client)
|
||||
return message.channel.send('Cant ban me fool')
|
||||
return message.channel.send('Cant ban me fool');
|
||||
if(!reasons)
|
||||
reasons = 'Nothing have been specified'
|
||||
reasons = 'Nothing have been specified';
|
||||
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}`)
|
||||
.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)
|
||||
return message.channel.say('Cant kick me fool');
|
||||
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)
|
||||
reasons = 'Nothing have been specified.';
|
||||
|
||||
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}".`))
|
||||
.catch(err => console.error(err))
|
||||
.catch(err => console.error(err));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ class PruneCommand extends Command {
|
|||
category: 'admin',
|
||||
args: [
|
||||
{
|
||||
id: "amount",
|
||||
type: "integer"
|
||||
id: 'amount',
|
||||
type: 'integer'
|
||||
}
|
||||
],
|
||||
clientPermissions: ['MANAGE_MESSAGES'],
|
||||
|
|
|
@ -26,8 +26,8 @@ class shameboardCommand extends Command {
|
|||
console.log(err);
|
||||
}
|
||||
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 {
|
||||
let shameboard = JSON.parse(data); //now it an object
|
||||
shameboard['shameboard'] = shameboardChannel;
|
||||
|
@ -37,11 +37,11 @@ class shameboardCommand extends Command {
|
|||
fs.close();
|
||||
return console.log(err);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
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',
|
||||
args: [
|
||||
{
|
||||
id: "slowmodeNumber",
|
||||
type: "integer"
|
||||
id: 'slowmodeNumber',
|
||||
type: 'integer'
|
||||
},
|
||||
{
|
||||
id: "realtime",
|
||||
type: "integer",
|
||||
id: 'realtime',
|
||||
type: 'integer',
|
||||
optional: true,
|
||||
}
|
||||
],
|
||||
|
@ -32,7 +32,7 @@ class PruneCommand extends Command {
|
|||
let realtime = args.realtime;
|
||||
|
||||
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);
|
||||
|
||||
|
@ -41,11 +41,11 @@ class PruneCommand extends Command {
|
|||
message.channel.send(`Slowmode have been set to ${slowmodeNumber} seconds and will end in ${realtime} minutes!`);
|
||||
setTimeout (function (){
|
||||
message.channel.setRateLimitPerUser(0);
|
||||
return message.channel.send("Slowmode is now disabled!")
|
||||
return message.channel.send('Slowmode is now disabled!');
|
||||
}, time);
|
||||
} else {
|
||||
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!`);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,8 +26,8 @@ class StarBoardCommand extends Command {
|
|||
console.log(err);
|
||||
}
|
||||
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 {
|
||||
let starboard = JSON.parse(data); //now it an object
|
||||
starboard['starboard'] = starboardChannel;
|
||||
|
@ -37,11 +37,11 @@ class StarBoardCommand extends Command {
|
|||
fs.close();
|
||||
return console.log(err);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
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',
|
||||
args: [
|
||||
{
|
||||
id: "trigger",
|
||||
type: "string"
|
||||
id: 'trigger',
|
||||
type: 'string'
|
||||
},
|
||||
{
|
||||
id: "response",
|
||||
type: "string"
|
||||
id: 'response',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
channelRestriction: 'guild',
|
||||
description: {
|
||||
content: 'Create custom autoresponse',
|
||||
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;
|
||||
|
||||
trigger = trigger.toLowerCase();
|
||||
do {
|
||||
trigger = trigger.replace('--', ' ');
|
||||
} while (trigger.includes('--'))
|
||||
|
||||
let customresponse = {};
|
||||
let json = JSON.stringify(customresponse);
|
||||
|
||||
fs.readFile(`./tag/${message.guild.id}.json`, 'utf8', function readFileCallback(err, data) {
|
||||
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) {
|
||||
fs.close();
|
||||
console.log(err);
|
||||
}
|
||||
})
|
||||
});
|
||||
} else {
|
||||
customresponse = JSON.parse(data); //now it an object
|
||||
customresponse[trigger] = response
|
||||
customresponse[trigger] = response;
|
||||
json = JSON.stringify(customresponse); //convert it back to json
|
||||
fs.writeFile(`./tag/${message.guild.id}.json`, json, 'utf8', function (err) {
|
||||
if (err) {
|
||||
fs.close();
|
||||
return console.log(err);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ class UnbanCommand extends Command {
|
|||
|
||||
async exec(message, args) {
|
||||
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',
|
||||
args: [
|
||||
{
|
||||
id: "trigger",
|
||||
type: "string"
|
||||
id: 'trigger',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
channelRestriction: 'guild',
|
||||
description: {
|
||||
content: 'Remove created custom autoresponse',
|
||||
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();
|
||||
|
||||
let customresponse = {}
|
||||
let json = JSON.stringify(customresponse)
|
||||
let customresponse = {};
|
||||
let json = JSON.stringify(customresponse);
|
||||
|
||||
|
||||
fs.readFile(`./tag/${message.guild.id}.json`, 'utf8', function readFileCallback(err, data) {
|
||||
|
@ -36,14 +36,14 @@ class UnTagCommand extends Command {
|
|||
console.log(err);
|
||||
} else {
|
||||
customresponse = JSON.parse(data); //now it an object
|
||||
delete customresponse[trigger]
|
||||
delete customresponse[trigger];
|
||||
json = JSON.stringify(customresponse); //convert it back to json
|
||||
fs.writeFile(`./tag/${message.guild.id}.json`, json, 'utf8', function (err) {
|
||||
if (err) {
|
||||
fs.close();
|
||||
return console.log(err);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -16,18 +16,18 @@ class AdviceCommand extends Command {
|
|||
}
|
||||
|
||||
async exec(message) {
|
||||
fetch("http://api.adviceslip.com/advice").then((response) => {
|
||||
fetch('http://api.adviceslip.com/advice').then((response) => {
|
||||
return response.json();
|
||||
}).then((response) => {
|
||||
const adviceEmbed = new Discord.RichEmbed()
|
||||
.setColor("#ff9900")
|
||||
.setColor('#ff9900')
|
||||
.setTitle(response.slip.slip_id)
|
||||
.setDescription(response.slip.advice)
|
||||
.setDescription(response.slip.advice);
|
||||
|
||||
|
||||
message.channel.send(adviceEmbed);
|
||||
|
||||
})}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
module.exports = AdviceCommand;
|
|
@ -1,5 +1,5 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
const fetch = require('node-fetch')
|
||||
const fetch = require('node-fetch');
|
||||
|
||||
class ImgurCommand extends Command {
|
||||
constructor() {
|
||||
|
@ -15,13 +15,13 @@ class ImgurCommand extends Command {
|
|||
}
|
||||
|
||||
async exec(message) {
|
||||
fetch("https://api.imgur.com/3/gallery/hot/day?showViral=true&mature=false&perPage=100&album_previews=true", {
|
||||
headers: { "Authorization": "Client-ID e4cb6948f80f295" },
|
||||
fetch('https://api.imgur.com/3/gallery/hot/day?showViral=true&mature=false&perPage=100&album_previews=true', {
|
||||
headers: { 'Authorization': 'Client-ID e4cb6948f80f295' },
|
||||
}).then((response) => {
|
||||
return response.json();
|
||||
}).then((response) => {
|
||||
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));
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@ class ClapCommand extends Command {
|
|||
split: 'none',
|
||||
args: [
|
||||
{
|
||||
id: "text",
|
||||
type: "string"
|
||||
id: 'text',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
description: {
|
||||
|
|
|
@ -9,8 +9,8 @@ class EmotesayCommand extends Command {
|
|||
split: 'none',
|
||||
args: [
|
||||
{
|
||||
id: "text",
|
||||
type: "string"
|
||||
id: 'text',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
description: {
|
||||
|
@ -28,7 +28,7 @@ class EmotesayCommand extends Command {
|
|||
let emojiArray = [];
|
||||
for (let i = 0; i < text.length; 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) {
|
||||
fetch('http://inspirobot.me/api?generate=true')
|
||||
.then(res => res.text())
|
||||
.then(body => message.channel.send({files: [body]}))
|
||||
.then(body => message.channel.send({files: [body]}));
|
||||
}
|
||||
}
|
||||
module.exports = InspiroBotCommand;
|
|
@ -1,4 +1,5 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
const Discord = require('discord.js');
|
||||
const fetch = require('node-fetch');
|
||||
|
||||
class RedditCommand extends Command {
|
||||
|
@ -23,30 +24,30 @@ class RedditCommand extends Command {
|
|||
|
||||
async exec(message, args) {
|
||||
let sub = args.sub;
|
||||
let i, a;
|
||||
|
||||
fetch('https://www.reddit.com/r/' + sub + '.json?limit=100').then((response) => {
|
||||
return response.json();
|
||||
}).then((response) => {
|
||||
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') {
|
||||
i = Math.floor((Math.random() * response.data.children.length));
|
||||
|
||||
a++
|
||||
a++;
|
||||
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)
|
||||
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()
|
||||
.setColor("#ff9900")
|
||||
.setColor('#ff9900')
|
||||
.setTitle(response.data.children[i].data.title)
|
||||
.setImage(response.data.children[i].data.url)
|
||||
.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);
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
module.exports = RedditCommand;
|
|
@ -24,22 +24,22 @@ class SayCommand extends Command {
|
|||
let text = args.text;
|
||||
|
||||
// Load all the different files
|
||||
const verb = require('../../dictionary/verbs.json')
|
||||
const noun = require('../../dictionary/noun.json')
|
||||
const adjective = require('../../dictionary/adjectives.json')
|
||||
const adverbs = require('../../dictionary/adverbs.json')
|
||||
const activities = require('../../dictionary/activities.json')
|
||||
const celebreties = require('../../dictionary/celebreties.json')
|
||||
const countries = require('../../dictionary/countries.json')
|
||||
const diseases = require('../../dictionary/diseases.json')
|
||||
const elements = require('../../dictionary/elements.json')
|
||||
const hobbies = require('../../dictionary/hobbies.json')
|
||||
const music = require('../../dictionary/music.json')
|
||||
const prefixes = require('../../dictionary/prefixes.json')
|
||||
const pronouns = require('../../dictionary/pronouns.json')
|
||||
const states = require('../../dictionary/states.json')
|
||||
const titles = require('../../dictionary/titles.json')
|
||||
const units = require('../../dictionary/units.json')
|
||||
const verb = require('../../dictionary/verbs.json');
|
||||
const noun = require('../../dictionary/noun.json');
|
||||
const adjective = require('../../dictionary/adjectives.json');
|
||||
const adverbs = require('../../dictionary/adverbs.json');
|
||||
const activities = require('../../dictionary/activities.json');
|
||||
const celebreties = require('../../dictionary/celebreties.json');
|
||||
const countries = require('../../dictionary/countries.json');
|
||||
const diseases = require('../../dictionary/diseases.json');
|
||||
const elements = require('../../dictionary/elements.json');
|
||||
const hobbies = require('../../dictionary/hobbies.json');
|
||||
const music = require('../../dictionary/music.json');
|
||||
const prefixes = require('../../dictionary/prefixes.json');
|
||||
const pronouns = require('../../dictionary/pronouns.json');
|
||||
const states = require('../../dictionary/states.json');
|
||||
const titles = require('../../dictionary/titles.json');
|
||||
const units = require('../../dictionary/units.json');
|
||||
|
||||
|
||||
|
||||
|
@ -50,26 +50,26 @@ class SayCommand extends Command {
|
|||
}
|
||||
// Replace with a random word from the json
|
||||
do {
|
||||
text = text.replace(/\[verb\]/, verb[randNumber(verb)])
|
||||
text = text.replace(/\[adverb\]/, adverbs[randNumber(adverbs)])
|
||||
text = text.replace(/\[noun\]/, noun[randNumber(noun)])
|
||||
text = text.replace(/\[adjective\]/, adjective[randNumber(adjective)])
|
||||
text = text.replace(/\[activity\]/, activities[randNumber(activities)])
|
||||
text = text.replace(/\[celebrity\]/, celebreties[randNumber(celebreties)])
|
||||
text = text.replace(/\[country\]/, countries[randNumber(countries)])
|
||||
text = text.replace(/\[diseases\]/, diseases[randNumber(diseases)])
|
||||
text = text.replace(/\[elements\]/, elements[randNumber(elements)])
|
||||
text = text.replace(/\[hobbies\]/, hobbies[randNumber(hobbies)])
|
||||
text = text.replace(/\[music\]/, music[randNumber(music)])
|
||||
text = text.replace(/\[prefixes\]/, prefixes[randNumber(prefixes)])
|
||||
text = text.replace(/\[pronoun\]/, pronouns[randNumber(pronouns)])
|
||||
text = text.replace(/\[state\]/, states[randNumber(states)])
|
||||
text = text.replace(/\[title\]/, titles[randNumber(titles)])
|
||||
text = text.replace(/\[unit\]/, units[randNumber(units)])
|
||||
text = text.replace(/\[member\]/, message.guild.members.random().user.username)
|
||||
text = text.replace(/\[number\]/, Math.floor((Math.random() * 9) + 1))
|
||||
text = text.replace(/\[verb\]/, verb[randNumber(verb)]);
|
||||
text = text.replace(/\[adverb\]/, adverbs[randNumber(adverbs)]);
|
||||
text = text.replace(/\[noun\]/, noun[randNumber(noun)]);
|
||||
text = text.replace(/\[adjective\]/, adjective[randNumber(adjective)]);
|
||||
text = text.replace(/\[activity\]/, activities[randNumber(activities)]);
|
||||
text = text.replace(/\[celebrity\]/, celebreties[randNumber(celebreties)]);
|
||||
text = text.replace(/\[country\]/, countries[randNumber(countries)]);
|
||||
text = text.replace(/\[diseases\]/, diseases[randNumber(diseases)]);
|
||||
text = text.replace(/\[elements\]/, elements[randNumber(elements)]);
|
||||
text = text.replace(/\[hobbies\]/, hobbies[randNumber(hobbies)]);
|
||||
text = text.replace(/\[music\]/, music[randNumber(music)]);
|
||||
text = text.replace(/\[prefixes\]/, prefixes[randNumber(prefixes)]);
|
||||
text = text.replace(/\[pronoun\]/, pronouns[randNumber(pronouns)]);
|
||||
text = text.replace(/\[state\]/, states[randNumber(states)]);
|
||||
text = text.replace(/\[title\]/, titles[randNumber(titles)]);
|
||||
text = text.replace(/\[unit\]/, units[randNumber(units)]);
|
||||
text = text.replace(/\[member\]/, message.guild.members.random().user.username);
|
||||
text = text.replace(/\[number\]/, Math.floor((Math.random() * 9) + 1));
|
||||
// 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
|
||||
return message.channel.send(text);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
|
||||
class SayCommand extends Command {
|
||||
class SaydCommand extends Command {
|
||||
constructor() {
|
||||
super('sayd', {
|
||||
aliases: ['sayd'],
|
||||
|
@ -25,22 +25,22 @@ class SayCommand extends Command {
|
|||
let text = args.text;
|
||||
|
||||
// Load all the different files
|
||||
const verb = require('../../dictionary/verbs.json')
|
||||
const noun = require('../../dictionary/noun.json')
|
||||
const adjective = require('../../dictionary/adjectives.json')
|
||||
const adverbs = require('../../dictionary/adverbs.json')
|
||||
const activities = require('../../dictionary/activities.json')
|
||||
const celebreties = require('../../dictionary/celebreties.json')
|
||||
const countries = require('../../dictionary/countries.json')
|
||||
const diseases = require('../../dictionary/diseases.json')
|
||||
const elements = require('../../dictionary/elements.json')
|
||||
const hobbies = require('../../dictionary/hobbies.json')
|
||||
const music = require('../../dictionary/music.json')
|
||||
const prefixes = require('../../dictionary/prefixes.json')
|
||||
const pronouns = require('../../dictionary/pronouns.json')
|
||||
const states = require('../../dictionary/states.json')
|
||||
const titles = require('../../dictionary/titles.json')
|
||||
const units = require('../../dictionary/units.json')
|
||||
const verb = require('../../dictionary/verbs.json');
|
||||
const noun = require('../../dictionary/noun.json');
|
||||
const adjective = require('../../dictionary/adjectives.json');
|
||||
const adverbs = require('../../dictionary/adverbs.json');
|
||||
const activities = require('../../dictionary/activities.json');
|
||||
const celebreties = require('../../dictionary/celebreties.json');
|
||||
const countries = require('../../dictionary/countries.json');
|
||||
const diseases = require('../../dictionary/diseases.json');
|
||||
const elements = require('../../dictionary/elements.json');
|
||||
const hobbies = require('../../dictionary/hobbies.json');
|
||||
const music = require('../../dictionary/music.json');
|
||||
const prefixes = require('../../dictionary/prefixes.json');
|
||||
const pronouns = require('../../dictionary/pronouns.json');
|
||||
const states = require('../../dictionary/states.json');
|
||||
const titles = require('../../dictionary/titles.json');
|
||||
const units = require('../../dictionary/units.json');
|
||||
|
||||
|
||||
|
||||
|
@ -51,26 +51,26 @@ class SayCommand extends Command {
|
|||
}
|
||||
// Replace with a random word from the json
|
||||
do {
|
||||
text = text.replace(/\[verb\]/, verb[randNumber(verb)])
|
||||
text = text.replace(/\[adverb\]/, adverbs[randNumber(adverbs)])
|
||||
text = text.replace(/\[noun\]/, noun[randNumber(noun)])
|
||||
text = text.replace(/\[adjective\]/, adjective[randNumber(adjective)])
|
||||
text = text.replace(/\[activity\]/, activities[randNumber(activities)])
|
||||
text = text.replace(/\[celebrity\]/, celebreties[randNumber(celebreties)])
|
||||
text = text.replace(/\[country\]/, countries[randNumber(countries)])
|
||||
text = text.replace(/\[diseases\]/, diseases[randNumber(diseases)])
|
||||
text = text.replace(/\[elements\]/, elements[randNumber(elements)])
|
||||
text = text.replace(/\[hobbies\]/, hobbies[randNumber(hobbies)])
|
||||
text = text.replace(/\[music\]/, music[randNumber(music)])
|
||||
text = text.replace(/\[prefixes\]/, prefixes[randNumber(prefixes)])
|
||||
text = text.replace(/\[pronoun\]/, pronouns[randNumber(pronouns)])
|
||||
text = text.replace(/\[state\]/, states[randNumber(states)])
|
||||
text = text.replace(/\[title\]/, titles[randNumber(titles)])
|
||||
text = text.replace(/\[unit\]/, units[randNumber(units)])
|
||||
text = text.replace(/\[member\]/, message.guild.members.random().user.username)
|
||||
text = text.replace(/\[number\]/, Math.floor((Math.random() * 9) + 1))
|
||||
text = text.replace(/\[verb\]/, verb[randNumber(verb)]);
|
||||
text = text.replace(/\[adverb\]/, adverbs[randNumber(adverbs)]);
|
||||
text = text.replace(/\[noun\]/, noun[randNumber(noun)]);
|
||||
text = text.replace(/\[adjective\]/, adjective[randNumber(adjective)]);
|
||||
text = text.replace(/\[activity\]/, activities[randNumber(activities)]);
|
||||
text = text.replace(/\[celebrity\]/, celebreties[randNumber(celebreties)]);
|
||||
text = text.replace(/\[country\]/, countries[randNumber(countries)]);
|
||||
text = text.replace(/\[diseases\]/, diseases[randNumber(diseases)]);
|
||||
text = text.replace(/\[elements\]/, elements[randNumber(elements)]);
|
||||
text = text.replace(/\[hobbies\]/, hobbies[randNumber(hobbies)]);
|
||||
text = text.replace(/\[music\]/, music[randNumber(music)]);
|
||||
text = text.replace(/\[prefixes\]/, prefixes[randNumber(prefixes)]);
|
||||
text = text.replace(/\[pronoun\]/, pronouns[randNumber(pronouns)]);
|
||||
text = text.replace(/\[state\]/, states[randNumber(states)]);
|
||||
text = text.replace(/\[title\]/, titles[randNumber(titles)]);
|
||||
text = text.replace(/\[unit\]/, units[randNumber(units)]);
|
||||
text = text.replace(/\[member\]/, message.guild.members.random().user.username);
|
||||
text = text.replace(/\[number\]/, Math.floor((Math.random() * 9) + 1));
|
||||
// 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
|
||||
message.delete();
|
||||
|
@ -78,4 +78,4 @@ class SayCommand extends Command {
|
|||
}
|
||||
}
|
||||
|
||||
module.exports = SayCommand;
|
||||
module.exports = SaydCommand;
|
|
@ -14,7 +14,7 @@ class tokenCommand extends Command {
|
|||
}
|
||||
|
||||
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 )];
|
||||
message.channel.send(trollMessage);
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ class TtsCommand extends Command {
|
|||
return;
|
||||
}
|
||||
console.log('Audio content written to file: tts.mp3');
|
||||
message.channel.send({ files: ['./tts.mp3'] })
|
||||
message.channel.send({ files: ['./tts.mp3'] });
|
||||
});
|
||||
fs.close();
|
||||
});
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
const Discord = require('discord.js');
|
||||
const { createCanvas, loadImage, getContext } = require('canvas');
|
||||
const { createCanvas, loadImage } = require('canvas');
|
||||
const superagent = require('superagent');
|
||||
|
||||
class FetishCommand extends Command {
|
||||
|
@ -21,20 +21,20 @@ class FetishCommand extends Command {
|
|||
let Attachment = (message.attachments).array();
|
||||
let image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
image = message.author.displayAvatarURL
|
||||
image = message.author.displayAvatarURL;
|
||||
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)
|
||||
image = Attachment[0].url
|
||||
image = Attachment[0].url;
|
||||
|
||||
message.channel.send('Processing <a:loadingmin:527579785212329984>')
|
||||
.then(loadingmsg => loadingmsg.delete(1000))
|
||||
.then(loadingmsg => loadingmsg.delete(1000));
|
||||
|
||||
const canvas = createCanvas(528, 559)
|
||||
const ctx = canvas.getContext('2d')
|
||||
const background = await loadImage('https://image.noelshack.com/fichiers/2018/42/2/1539644291-my-fetish-5910119d988512.png').catch(error => {
|
||||
return message.channel.send('An error as occured, please try again')
|
||||
})
|
||||
const canvas = createCanvas(528, 559);
|
||||
const ctx = canvas.getContext('2d');
|
||||
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');
|
||||
});
|
||||
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
|
||||
const { body: buffer } = await superagent.get(image);
|
||||
const bg = await loadImage(buffer);
|
||||
|
@ -44,8 +44,8 @@ class FetishCommand extends Command {
|
|||
|
||||
|
||||
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 Discord = require('discord.js');
|
||||
const { createCanvas, loadImage, getContext } = require('canvas');
|
||||
const { createCanvas, loadImage } = require('canvas');
|
||||
const superagent = require('superagent');
|
||||
|
||||
|
||||
|
@ -22,22 +22,22 @@ class GodCommand extends Command {
|
|||
let Attachment = (message.attachments).array();
|
||||
let image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
image = message.author.displayAvatarURL
|
||||
image = message.author.displayAvatarURL;
|
||||
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)
|
||||
image = Attachment[0].url
|
||||
image = Attachment[0].url;
|
||||
|
||||
message.channel.send('Processing <a:loadingmin:527579785212329984>')
|
||||
.then(loadingmsg => loadingmsg.delete(1000))
|
||||
.then(loadingmsg => loadingmsg.delete(1000));
|
||||
|
||||
const canvas = createCanvas(310, 400)
|
||||
const ctx = canvas.getContext('2d')
|
||||
const canvas = createCanvas(310, 400);
|
||||
const ctx = canvas.getContext('2d');
|
||||
const background = await loadImage(image);
|
||||
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(() => {
|
||||
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);
|
||||
ctx.drawImage(bg, 0, 0, canvas.width, canvas.height);
|
||||
|
||||
|
@ -46,8 +46,8 @@ class GodCommand extends Command {
|
|||
message.delete();
|
||||
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 Discord = require('discord.js');
|
||||
const { createCanvas, loadImage, getContext } = require('canvas');
|
||||
const { createCanvas, loadImage } = require('canvas');
|
||||
const superagent = require('superagent');
|
||||
|
||||
class IdubbbzCommand extends Command {
|
||||
|
@ -27,16 +27,16 @@ class IdubbbzCommand extends Command {
|
|||
let Attachment = (message.attachments).array();
|
||||
let image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
image = message.author.displayAvatarURL
|
||||
image = message.author.displayAvatarURL;
|
||||
else if (Attachment[0] && Attachment[0].url.endsWith('gif'))
|
||||
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 {}
|
||||
return message.channel.send('Gif dosent work, sorry');
|
||||
else if (!image)
|
||||
image = Attachment[0].url;
|
||||
|
||||
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 ctx = canvas.getContext('2d');
|
||||
|
||||
|
@ -51,25 +51,24 @@ class IdubbbzCommand extends Command {
|
|||
// Return the result to use in the actual canvas
|
||||
return ctx.font;
|
||||
};
|
||||
}
|
||||
|
||||
const ctx = canvas.getContext('2d')
|
||||
const ctx = canvas.getContext('2d');
|
||||
const background = await loadImage(image);
|
||||
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 => {
|
||||
return message.channel.send('An error as occured, please try again')
|
||||
})
|
||||
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');
|
||||
});
|
||||
const bg = await loadImage(buffer);
|
||||
ctx.drawImage(bg, 0, 0, canvas.width, canvas.height);
|
||||
ctx.font = applyText(canvas, text)
|
||||
ctx.font = applyText(canvas, text);
|
||||
ctx.fillStyle = '#000000';
|
||||
ctx.fillText(text, canvas.width / 2.1, canvas.height / 1.5);
|
||||
|
||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'edups.png');
|
||||
|
||||
message.channel.send(attachment).catch(error => {
|
||||
message.channel.send('an error as occured. Check the bot/channel permissions')
|
||||
})
|
||||
message.channel.send(attachment).catch(() => {
|
||||
message.channel.send('an error as occured. Check the bot/channel permissions');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
const Discord = require('discord.js');
|
||||
const { createCanvas, loadImage, getContext } = require('canvas');
|
||||
const { createCanvas, loadImage } = require('canvas');
|
||||
const superagent = require('superagent');
|
||||
|
||||
class IdubbbzPaintCommand extends Command {
|
||||
|
@ -26,16 +26,16 @@ class IdubbbzPaintCommand extends Command {
|
|||
let Attachment = (message.attachments).array();
|
||||
let image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
image = message.author.displayAvatarURL
|
||||
image = message.author.displayAvatarURL;
|
||||
else if (Attachment[0] && Attachment[0].url.endsWith('gif'))
|
||||
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 {}
|
||||
return message.channel.send('Gif dosent work, sorry');
|
||||
else if (!image)
|
||||
image = Attachment[0].url;
|
||||
|
||||
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 ctx = canvas.getContext('2d');
|
||||
|
||||
|
@ -50,25 +50,24 @@ class IdubbbzPaintCommand extends Command {
|
|||
// Return the result to use in the actual canvas
|
||||
return ctx.font;
|
||||
};
|
||||
}
|
||||
|
||||
const ctx = canvas.getContext('2d')
|
||||
const ctx = canvas.getContext('2d');
|
||||
const background = await loadImage(image);
|
||||
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 => {
|
||||
return message.channel.send('An error as occured, please try again')
|
||||
})
|
||||
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');
|
||||
});
|
||||
const bg = await loadImage(buffer);
|
||||
ctx.drawImage(bg, 0, 0, canvas.width, canvas.height);
|
||||
ctx.font = applyText(canvas, text)
|
||||
ctx.font = applyText(canvas, text);
|
||||
ctx.fillStyle = '#ffffff';
|
||||
ctx.fillText(text, canvas.width / 3, canvas.height / 1.1);
|
||||
|
||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'edupspaint.png');
|
||||
|
||||
message.channel.send(attachment).catch(error => {
|
||||
message.channel.send('an error as occured. Check the bot/channel permissions')
|
||||
})
|
||||
message.channel.send(attachment).catch(() => {
|
||||
message.channel.send('an error as occured. Check the bot/channel permissions');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
const Discord = require('discord.js');
|
||||
const { createCanvas, loadImage, getContext } = require('canvas');
|
||||
const { createCanvas, loadImage } = require('canvas');
|
||||
const superagent = require('superagent');
|
||||
|
||||
class LikeCommand extends Command {
|
||||
|
@ -21,31 +21,31 @@ class LikeCommand extends Command {
|
|||
let Attachment = (message.attachments).array();
|
||||
let image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
image = message.author.displayAvatarURL
|
||||
image = message.author.displayAvatarURL;
|
||||
else if (Attachment[0] && Attachment[0].url.endsWith('gif'))
|
||||
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 {}
|
||||
return message.channel.send('Gif dosent work, sorry');
|
||||
else if (!image)
|
||||
image = Attachment[0].url;
|
||||
|
||||
message.channel.send('Processing <a:loadingmin:527579785212329984>')
|
||||
.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);
|
||||
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 => {
|
||||
return message.channel.send('An error as occured, please try again')
|
||||
})
|
||||
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');
|
||||
});
|
||||
const bg = await loadImage(buffer);
|
||||
ctx.drawImage(bg, 0, 0, canvas.width, canvas.height);
|
||||
|
||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'like.png');
|
||||
|
||||
message.channel.send(attachment).catch(error => {
|
||||
message.channel.send('an error as occured. Check the bot/channel permissions')
|
||||
})
|
||||
message.channel.send(attachment).catch(() => {
|
||||
message.channel.send('an error as occured. Check the bot/channel permissions');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
const Discord = require('discord.js');
|
||||
const { createCanvas, loadImage, getContext } = require('canvas');
|
||||
const { createCanvas, loadImage } = require('canvas');
|
||||
const superagent = require('superagent');
|
||||
|
||||
class UglyCommand extends Command {
|
||||
|
@ -21,21 +21,21 @@ class UglyCommand extends Command {
|
|||
let Attachment = (message.attachments).array();
|
||||
let image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
image = message.author.displayAvatarURL
|
||||
image = message.author.displayAvatarURL;
|
||||
else if (Attachment[0] && Attachment[0].url.endsWith('gif'))
|
||||
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 {}
|
||||
return message.channel.send('Gif dosent work, sorry');
|
||||
else if (!image)
|
||||
image = Attachment[0].url;
|
||||
|
||||
message.channel.send('Processing <a:loadingmin:527579785212329984>')
|
||||
.then(loadingmsg => loadingmsg.delete(1000));
|
||||
}
|
||||
|
||||
const canvas = createCanvas(323, 400)
|
||||
const ctx = canvas.getContext('2d')
|
||||
const background = await loadImage('https://image.noelshack.com/fichiers/2018/42/1/1539598678-untitled.png').catch(error => {
|
||||
return message.channel.send('An error as occured, please try again')
|
||||
})
|
||||
|
||||
const canvas = createCanvas(323, 400);
|
||||
const ctx = canvas.getContext('2d');
|
||||
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);
|
||||
const { body: buffer } = await superagent.get(image);
|
||||
const bg = await loadImage(buffer);
|
||||
|
@ -43,9 +43,9 @@ class UglyCommand extends Command {
|
|||
|
||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'ugly.png');
|
||||
|
||||
message.channel.send(attachment).catch(error => {
|
||||
message.channel.send('an error as occured. Check the bot/channel permissions')
|
||||
})
|
||||
message.channel.send(attachment).catch(() => {
|
||||
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 image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
return message.say('You didint provide any images')
|
||||
return message.say('You didint provide any images');
|
||||
else
|
||||
image = Attachment[0].url
|
||||
image = Attachment[0].url;
|
||||
|
||||
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');
|
||||
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ class EvalCommand extends Command {
|
|||
type: 'user'
|
||||
},
|
||||
{
|
||||
id: 'message',
|
||||
id: 'text',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
|
@ -27,16 +27,16 @@ class EvalCommand extends Command {
|
|||
|
||||
async exec(message, args) {
|
||||
let user = args.user;
|
||||
let message = args.message;
|
||||
let text = args.text;
|
||||
|
||||
let Attachment = (message.attachments).array();
|
||||
if (Attachment[0]) {
|
||||
user.send(`**Message from the dev:**\n${message}\n${Attachment[0].url}`)
|
||||
message.channel.send(`DM sent to ${user.username}`)
|
||||
user.send(`**Message from the dev:**\n${text}\n${Attachment[0].url}`);
|
||||
message.channel.send(`DM sent to ${user.username}`);
|
||||
}
|
||||
else {
|
||||
user.send(`**Message from the dev:**\n${message}`)
|
||||
message.channel.send(`DM sent to ${user.username}`)
|
||||
user.send(`**Message from the dev:**\n${text}`);
|
||||
message.channel.send(`DM sent to ${user.username}`);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ class emitCommand extends Command {
|
|||
|
||||
async exec(message, args) {
|
||||
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) {
|
||||
const clean = text => {
|
||||
if (typeof(text) === "string")
|
||||
return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
|
||||
if (typeof(text) === 'string')
|
||||
return text.replace(/`/g, '`' + String.fromCharCode(8203)).replace(/@/g, '@' + String.fromCharCode(8203));
|
||||
else
|
||||
return text;
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
const code = args.eval
|
||||
const code = args.eval;
|
||||
let evaled = eval(code);
|
||||
|
||||
if (typeof evaled !== "string")
|
||||
evaled = require("util").inspect(evaled);
|
||||
if (typeof evaled !== 'string')
|
||||
evaled = require('util').inspect(evaled);
|
||||
|
||||
message.channel.send(clean(evaled), {code:"xl"});
|
||||
message.channel.send(clean(evaled), {code:'xl'});
|
||||
} catch (err) {
|
||||
message.channel.send(`\`ERROR\` \`\`\`xl\n${clean(err)}\n\`\`\``);
|
||||
}
|
||||
|
|
|
@ -25,15 +25,15 @@ class bsespamCommand extends Command {
|
|||
}
|
||||
|
||||
async exec(message, args) {
|
||||
if (message.author.id != "428387534842626048")
|
||||
return message.say('Command only available to **Big Snow Energy**')
|
||||
if (message.author.id != '428387534842626048')
|
||||
return message.say('Command only available to **Big Snow Energy**');
|
||||
if (args.number <= 10) {
|
||||
for(let i = 0; i < args.number; i++) {
|
||||
message.channel.send(args.text);
|
||||
}
|
||||
return message.channel.send('Finished :)');
|
||||
} 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',
|
||||
args: [
|
||||
{
|
||||
id: "link",
|
||||
type: "string",
|
||||
default: "https://www.youtube.com/watch?v=6n3pFFPSlW4"
|
||||
id: 'link',
|
||||
type: 'string',
|
||||
default: 'https://www.youtube.com/watch?v=6n3pFFPSlW4'
|
||||
}
|
||||
],
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
|
@ -27,27 +27,27 @@ class DownloadCommand extends Command {
|
|||
async exec(message, args) {
|
||||
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 => {
|
||||
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.on('error', function error(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 () {
|
||||
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'));
|
||||
fs.close();
|
||||
});
|
||||
} else {
|
||||
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',
|
||||
args: [
|
||||
{
|
||||
id: "text",
|
||||
type: "string"
|
||||
id: 'text',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
description: {
|
||||
|
|
|
@ -15,12 +15,9 @@ class ServerCommand extends Command {
|
|||
}
|
||||
|
||||
async exec(message) {
|
||||
try {
|
||||
const customresponse = require(`../tag/${message.guild.id}.json`);
|
||||
var count = Object.keys(customresponse).length
|
||||
} catch {
|
||||
var count = 'None'
|
||||
}
|
||||
var count = Object.keys(customresponse).length;
|
||||
|
||||
|
||||
|
||||
const addEmbed = {
|
||||
|
|
|
@ -18,36 +18,30 @@ class taglistCommand extends Command {
|
|||
}
|
||||
|
||||
async exec(message) {
|
||||
try {
|
||||
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) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
/* do you need it to end here on error? if so uncomment the following code:
|
||||
fs.close();
|
||||
return;
|
||||
*/
|
||||
}
|
||||
let json = JSON.stringify(data)
|
||||
json = json.replace(/[{}"\\]+/g, '')
|
||||
json = json.replace(/,+/g, '\n')
|
||||
let json = JSON.stringify(data);
|
||||
json = json.replace(/[{}'\\]+/g, '');
|
||||
json = json.replace(/,+/g, '\n');
|
||||
const tagEmbed = new Discord.RichEmbed()
|
||||
.setColor("#ff9900")
|
||||
.setColor('#ff9900')
|
||||
.setTitle('Tags list')
|
||||
.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);
|
||||
});
|
||||
fs.close();
|
||||
} catch {
|
||||
fs.close();
|
||||
message.channel.send('An error has occured, do you have any tags on the server?');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = taglistCommand;
|
|
@ -9,7 +9,6 @@ class TranslationCommand extends Command {
|
|||
aliases: ['translation', 'trn'],
|
||||
category: 'utility',
|
||||
split: 'sticky',
|
||||
description: 'Translate the text you send into the lanuguage you selected',
|
||||
args: [
|
||||
{
|
||||
id: 'language',
|
||||
|
@ -33,15 +32,15 @@ class TranslationCommand extends Command {
|
|||
let language = args.language;
|
||||
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`, {
|
||||
}).then((response) => {
|
||||
return response.json();
|
||||
}).then((response) => {
|
||||
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')
|
||||
return message.channel.send('An error has occured')
|
||||
return message.channel.send('An error has occured');
|
||||
|
||||
|
||||
const translationEmbed = new Discord.RichEmbed()
|
||||
|
@ -54,7 +53,7 @@ class TranslationCommand extends Command {
|
|||
.setTimestamp()
|
||||
.setFooter('Powered by Yandex.Translate ');
|
||||
|
||||
message.channel.send(translationEmbed)
|
||||
message.channel.send(translationEmbed);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
3
index.js
3
index.js
|
@ -9,7 +9,6 @@ const client = new AkairoClient({
|
|||
emitters: {
|
||||
process
|
||||
},
|
||||
handleEdits: true,
|
||||
commandUtil: true,
|
||||
commandUtilLifetime: 600000,
|
||||
commandDirectory: './commands/',
|
||||
|
@ -24,7 +23,7 @@ client.on('ready', async () => {
|
|||
// 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(`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) {
|
||||
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}`);
|
||||
|
|
|
@ -4,7 +4,7 @@ class BlacklistInhibitor extends Inhibitor {
|
|||
constructor() {
|
||||
super('blacklist', {
|
||||
reason: 'blacklist'
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
exec(message) {
|
||||
|
|
|
@ -10,19 +10,20 @@ class CommandBlockedListener extends Listener {
|
|||
|
||||
exec(message, command, reason) {
|
||||
console.log(`${message.author.username} was blocked from using ${command.id} because of ${reason}!`);
|
||||
let ownerMessage;
|
||||
switch(reason) {
|
||||
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"];
|
||||
let ownerMessage = ownerMessage[Math.floor( Math.random() * ownerMessage.length )];
|
||||
case 'Owner':
|
||||
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 = ownerMessage[Math.floor( Math.random() * ownerMessage.length )];
|
||||
message.reply(ownerMessage);
|
||||
break;
|
||||
case "clientPermissions":
|
||||
case 'clientPermissions':
|
||||
message.reply('Im missing the required permissions for this command!');
|
||||
break;
|
||||
case "userPermissions":
|
||||
case 'userPermissions':
|
||||
message.reply('You are missing some permissions to use this command!');
|
||||
break;
|
||||
case "blacklist":
|
||||
case 'blacklist':
|
||||
message.reply('You can\'t use this command because you have been blacklisted!');
|
||||
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}`);
|
||||
const channel = this.client.channels.get(statsChannel);
|
||||
const addEmbed = new Discord.RichEmbed()
|
||||
.setColor("#52e80d")
|
||||
.setColor('#52e80d')
|
||||
.setTitle('Someone added me ! YAY :D')
|
||||
.setURL('https://www.youtube.com/watch?v=6n3pFFPSlW4')
|
||||
.setThumbnail(guild.iconURL)
|
||||
.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 });
|
||||
}
|
||||
|
|
|
@ -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***`);
|
||||
const channel = this.client.channels.get(statsChannel);
|
||||
|
||||
const kickEmbed = new Discord.RichEmbed()
|
||||
.setColor("#FF0000")
|
||||
.setColor('#FF0000')
|
||||
.setTitle('They kicked me out :(')
|
||||
.setURL('https://www.youtube.com/watch?v=6n3pFFPSlW4')
|
||||
.setThumbnail(guild.iconURL)
|
||||
.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 });
|
||||
console.log('***BOT KICKED***')
|
||||
console.log('***BOT KICKED***');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue