Browse Source

Changed indent

merge-requests/2/head
Supositware 2 years ago
parent
commit
a64c0a2cc8
54 changed files with 1746 additions and 1759 deletions
  1. +69
    -69
      commands/admin/autoresponse.js
  2. +37
    -37
      commands/admin/ban.js
  3. +38
    -38
      commands/admin/kick.js
  4. +24
    -24
      commands/admin/prune.js
  5. +39
    -39
      commands/admin/shameboard.js
  6. +44
    -44
      commands/admin/slowmode.js
  7. +39
    -39
      commands/admin/starboard.js
  8. +52
    -55
      commands/admin/tag.js
  9. +24
    -24
      commands/admin/unban.js
  10. +49
    -49
      commands/admin/untag.js
  11. +19
    -19
      commands/general/advice.js
  12. +20
    -20
      commands/general/badmeme.js
  13. +19
    -19
      commands/general/clap.js
  14. +23
    -23
      commands/general/emotesay.js
  15. +12
    -12
      commands/general/ib.js
  16. +42
    -41
      commands/general/reddit.js
  17. +68
    -68
      commands/general/say.js
  18. +72
    -72
      commands/general/sayd.js
  19. +12
    -12
      commands/general/token.js
  20. +49
    -49
      commands/general/tts.js
  21. +65
    -65
      commands/general/ttsvc.js
  22. +40
    -40
      commands/images/fetish.js
  23. +41
    -41
      commands/images/god.js
  24. +58
    -59
      commands/images/idubbbz.js
  25. +57
    -58
      commands/images/idubbbzpaint.js
  26. +39
    -39
      commands/images/like.js
  27. +44
    -44
      commands/images/ugly.js
  28. +28
    -27
      commands/owner/botAvatar.js
  29. +32
    -32
      commands/owner/dm.js
  30. +20
    -20
      commands/owner/emit.js
  31. +34
    -34
      commands/owner/eval.js
  32. +13
    -13
      commands/owner/reboot.js
  33. +20
    -20
      commands/owner/status.js
  34. +20
    -20
      commands/owner/username.js
  35. +34
    -34
      commands/reserved/bsespam.js
  36. +19
    -19
      commands/utility/avatar.js
  37. +44
    -44
      commands/utility/download.js
  38. +20
    -20
      commands/utility/feedback.js
  39. +11
    -11
      commands/utility/invite.js
  40. +14
    -14
      commands/utility/ping.js
  41. +25
    -28
      commands/utility/server.js
  42. +17
    -17
      commands/utility/stats.js
  43. +34
    -40
      commands/utility/taglist.js
  44. +47
    -48
      commands/utility/translate.js
  45. +23
    -23
      commands/utility/updoot.js
  46. +10
    -10
      emojiCharacters.js
  47. +22
    -23
      index.js
  48. +9
    -9
      inhibitors/blacklist.js
  49. +9
    -9
      listeners/UnhandledRejection.js
  50. +27
    -26
      listeners/commandblocked.js
  51. +19
    -19
      listeners/guildCreate.js
  52. +19
    -19
      listeners/guildDelete.js
  53. +38
    -38
      listeners/message.js
  54. +43
    -43
      listeners/messageReactionAdd.js

+ 69
- 69
commands/admin/autoresponse.js View File

@ -2,82 +2,82 @@ const fs = require('fs');
const { Command } = require('discord-akairo');
class autoresponseCommand extends Command {
constructor() {
super('autoresponse', {
aliases: ['autoresponse'],
category: 'admin',
args: [
{
id: 'text',
type: 'string'
},
{
id: 'all',
type: 'string'
}
],
userPermissions: ['ADMINISTRATOR'],
channelRestriction: 'guild',
description: {
content: 'enable/disable autoresponse',
usage: '[enable/disable] (optional) [all]',
examples: ['enable all']
}
});
}
constructor() {
super('autoresponse', {
aliases: ['autoresponse'],
category: 'admin',
args: [
{
id: 'text',
type: 'string'
},
{
id: 'all',
type: 'string'
}
],
userPermissions: ['ADMINISTRATOR'],
channelRestriction: 'guild',
description: {
content: 'enable/disable autoresponse',
usage: '[enable/disable] (optional) [all]',
examples: ['enable all']
}
});
}
async exec(message, args) {
let text = args.text;
let all = args.all;
async exec(message, args) {
let text = args.text;
let all = args.all;
let autoresponse = {};
let json = JSON.stringify(autoresponse);
let autoresponse = {};
let json = JSON.stringify(autoresponse);
if (all == 'all') {
const guild = this.client.guilds.get(message.guild.id);
if (all == 'all') {
const guild = this.client.guilds.get(message.guild.id);
fs.readFile('./json/autoresponse.json', 'utf8', function readFileCallback(err, data) {
if (err) {
fs.close();
console.log(err);
} else {
fs.readFile('./json/autoresponse.json', 'utf8', function readFileCallback(err, data) {
if (err) {
fs.close();
console.log(err);
} else {
autoresponse = JSON.parse(data); //now it an object
guild.channels.forEach(channel => autoresponse[channel] = text);
json = JSON.stringify(autoresponse); //convert it back to json
json = json.replace(/[<#>]/g, '');
fs.writeFile('./json/autoresponse.json', json, 'utf8', function (err) {
if (err) {
fs.close();
return console.log(err);
}
})
}
});
autoresponse = JSON.parse(data); //now it an object
guild.channels.forEach(channel => autoresponse[channel] = text);
json = JSON.stringify(autoresponse); //convert it back to json
json = json.replace(/[<#>]/g, '');
fs.writeFile('./json/autoresponse.json', json, 'utf8', function (err) {
if (err) {
fs.close();
return console.log(err);
}
});
}
});
fs.close();
return message.channel.send('Auto response have been disable/enable on every channel');
fs.close();
return message.channel.send('Auto response have been disable/enable on every channel');
} else if (text == 'disable' || 'enable') {
fs.readFile('./json/autoresponse.json', 'utf8', function readFileCallback(err, data) {
if (err) {
console.log(err);
} else {
autoresponse = JSON.parse(data); //now it an object
autoresponse[message.channel.id] = text;
json = JSON.stringify(autoresponse); //convert it back to json
fs.writeFile('./json/autoresponse.json', json, 'utf8', function (err) {
if (err) {
fs.close();
return console.log(err);
}
})
}
})
};
} else if (text == 'disable' || 'enable') {
fs.readFile('./json/autoresponse.json', 'utf8', function readFileCallback(err, data) {
if (err) {
console.log(err);
} else {
autoresponse = JSON.parse(data); //now it an object
autoresponse[message.channel.id] = text;
json = JSON.stringify(autoresponse); //convert it back to json
fs.writeFile('./json/autoresponse.json', json, 'utf8', function (err) {
if (err) {
fs.close();
return console.log(err);
}
});
}
});
}
fs.close();
return message.channel.send(`Autoresponse have been ${text}d`);
}
fs.close();
return message.channel.send(`Autoresponse have been ${text}d`);
}
}
module.exports = autoresponseCommand;

+ 37
- 37
commands/admin/ban.js View File

@ -1,46 +1,46 @@
const { Command } = require('discord-akairo');
class BanCommand extends Command {
constructor() {
super('ban', {
aliases: ['ban'],
category: 'admin',
split: 'quote',
args: [
{
id: 'member',
type: 'member'
},
{
id: 'reasons',
type: 'string'
}
],
clientPermissions: ['BAN_MEMBERS'],
userPermissions: ['BAN_MEMBERS'],
channelRestriction: 'guild',
description: {
content: 'Ban user',
usage: '[@user]',
examples: ['@user big dumb dumb']
}
});
}
constructor() {
super('ban', {
aliases: ['ban'],
category: 'admin',
split: 'quote',
args: [
{
id: 'member',
type: 'member'
},
{
id: 'reasons',
type: 'string'
}
],
clientPermissions: ['BAN_MEMBERS'],
userPermissions: ['BAN_MEMBERS'],
channelRestriction: 'guild',
description: {
content: 'Ban user',
usage: '[@user]',
examples: ['@user big dumb dumb']
}
});
}
async exec(message, args) {
let member = args.member;
let reasons = args.reasons;
async exec(message, args) {
let member = args.member;
let reasons = args.reasons;
if(member == this.client)
return message.channel.send('Cant ban me fool')
if(!reasons)
reasons = 'Nothing have been specified'
if(member.id === message.author.id)
return message.channel.send("Why would you ban yourself ?")
if(member == this.client)
return message.channel.send('Cant ban me fool');
if(!reasons)
reasons = 'Nothing have been specified';
if(member.id === message.author.id)
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}".`))
}
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}".`));
}
}
module.exports = BanCommand;

+ 38
- 38
commands/admin/kick.js View File

@ -1,47 +1,47 @@
const { Command } = require('discord-akairo');
class KickCommand extends Command {
constructor() {
super('kick', {
aliases: ['kick'],
category: 'admin',
split: 'quoted',
args: [
{
id: 'member',
type: 'member'
},
{
id: 'reasons',
type: 'string'
}
],
clientPermissions: ['KICK_MEMBERS'],
userPermissions: ['KICK_MEMBERS'],
channelRestriction: 'guild',
description: {
content: 'Kick user',
usage: '[@user]',
examples: ['@user big dumb dumb']
}
});
}
constructor() {
super('kick', {
aliases: ['kick'],
category: 'admin',
split: 'quoted',
args: [
{
id: 'member',
type: 'member'
},
{
id: 'reasons',
type: 'string'
}
],
clientPermissions: ['KICK_MEMBERS'],
userPermissions: ['KICK_MEMBERS'],
channelRestriction: 'guild',
description: {
content: 'Kick user',
usage: '[@user]',
examples: ['@user big dumb dumb']
}
});
}
async exec(message, args) {
let member = args.member;
let reasons = args.reasons;
async exec(message, args) {
let member = args.member;
let reasons = args.reasons;
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 ?";);
if(!reasons)
reasons = 'Nothing have been specified.';
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 ?';);
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))
}
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));
}
}
module.exports = KickCommand;

+ 24
- 24
commands/admin/prune.js View File

@ -1,31 +1,31 @@
const { Command } = require('discord-akairo');
class PruneCommand extends Command {
constructor() {
super('Prune', {
aliases: ['Prune', 'clean', 'purge'],
category: 'admin',
args: [
{
id: "amount";,
type: "integer";
}
],
clientPermissions: ['MANAGE_MESSAGES'],
userPermissions: ['MANAGE_MESSAGES'],
channelRestriction: 'guild',
description: {
content: 'Bulk delete messages',
usage: '[amount]',
examples: ['50']
}
});
}
constructor() {
super('Prune', {
aliases: ['Prune', 'clean', 'purge'],
category: 'admin',
args: [
{
id: 'amount';,
type: 'integer';
}
],
clientPermissions: ['MANAGE_MESSAGES'],
userPermissions: ['MANAGE_MESSAGES'],
channelRestriction: 'guild',
description: {
content: 'Bulk delete messages',
usage: '[amount]',
examples: ['50']
}
});
}
async exec(message,args) {
if (args.amount >= 100) return;
message.channel.bulkDelete(args.amount + 1, true);
}
async exec(message,args) {
if (args.amount >= 100) return;
message.channel.bulkDelete(args.amount + 1, true);
}
}
module.exports = PruneCommand;

+ 39
- 39
commands/admin/shameboard.js View File

@ -2,47 +2,47 @@ const { Command } = require('discord-akairo');
const fs = require('fs');
class shameboardCommand extends Command {
constructor() {
super('shameboard', {
aliases: ['shameboard'],
category: 'admin',
channelRestriction: 'guild',
userPermissions: ['ADMINISTRATOR'],
description: {
content: 'Set shameboard',
usage: '[]',
examples: ['']
}
});
}
constructor() {
super('shameboard', {
aliases: ['shameboard'],
category: 'admin',
channelRestriction: 'guild',
userPermissions: ['ADMINISTRATOR'],
description: {
content: 'Set shameboard',
usage: '[]',
examples: ['']
}
});
}
async exec(message) {
let shameboardChannel = message.channel.id;
async exec(message) {
let shameboardChannel = message.channel.id;
fs.readFile(`./starboard/${message.guild.id}.json`, 'utf8', function readFileCallback(err, data) {
if (err) {
fs.writeFile(`./starboard/${message.guild.id}.json`, `{"shameboard": "${shameboardChannel}"}`, function (err) {
if (err) {
console.log(err);
}
fs.close();
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;
var json = JSON.stringify(shameboard); //convert it back to json
fs.writeFile(`./starboard/${message.guild.id}.json`, json, 'utf8', function (err) {
if (err) {
fs.close();
return console.log(err);
}
})
}
});
fs.close();
return message.channel.send(`This channel have been set as the shameboard`);
}
fs.readFile(`./starboard/${message.guild.id}.json`, 'utf8', function readFileCallback(err, data) {
if (err) {
fs.writeFile(`./starboard/${message.guild.id}.json`, `{"shameboard": "${shameboardChannel}"}`, function (err) {
if (err) {
console.log(err);
}
fs.close();
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;
var json = JSON.stringify(shameboard); //convert it back to json
fs.writeFile(`./starboard/${message.guild.id}.json`, json, 'utf8', function (err) {
if (err) {
fs.close();
return console.log(err);
}
});
}
});
fs.close();
return message.channel.send('This channel have been set as the shameboard');
}
}
module.exports = shameboardCommand;

+ 44
- 44
commands/admin/slowmode.js View File

@ -1,54 +1,54 @@
const { Command } = require('discord-akairo');
class PruneCommand extends Command {
constructor() {
super('Slowmode', {
aliases: ['slowmode', 'slow'],
category: 'admin',
args: [
{
id: "slowmodeNumber";,
type: "integer";
},
{
id: "realtime";,
type: "integer";,
optional: true,
}
],
clientPermissions: ['MANAGE_CHANNELS'],
userPermissions: ['MANAGE_CHANNELS'],
channelRestriction: 'guild',
description: {
content: 'Put a channel in slowmode',
usage: '[1-120 slowmode] [time it stays on]',
examples: ['267065637183029248']
}
});
}
constructor() {
super('Slowmode', {
aliases: ['slowmode', 'slow'],
category: 'admin',
args: [
{
id: 'slowmodeNumber';,
type: 'integer';
},
{
id: 'realtime';,
type: 'integer';,
optional: true,
}
],
clientPermissions: ['MANAGE_CHANNELS'],
userPermissions: ['MANAGE_CHANNELS'],
channelRestriction: 'guild',
description: {
content: 'Put a channel in slowmode',
usage: '[1-120 slowmode] [time it stays on]',
examples: ['267065637183029248']
}
});
}
async exec(message,args) {
let slowmodeNumber = args.slowmodeNumber;
let realtime = args.realtime;
async exec(message,args) {
let slowmodeNumber = args.slowmodeNumber;
let realtime = args.realtime;
if (slowmodeNumber > 120)
return message.channel.send("Slowmode can only be set to 120 seconds or lower!";);
if (slowmodeNumber > 120)
return message.channel.send('Slowmode can only be set to 120 seconds or lower!';);
message.channel.setRateLimitPerUser(slowmodeNumber);
message.channel.setRateLimitPerUser(slowmodeNumber);
if (realtime) {
let time = 60000 * realtime;
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!")
}, time);
} else {
if (slowmodeNumber == 0)
return message.channel.send("Slowmode have been disabled!")
return message.channel.send(`Slowmode have been set to ${slowmodeNumber} seconds!`);
}
}
if (realtime) {
let time = 60000 * realtime;
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!');
}, time);
} else {
if (slowmodeNumber == 0)
return message.channel.send('Slowmode have been disabled!');
return message.channel.send(`Slowmode have been set to ${slowmodeNumber} seconds!`);
}
}
}
module.exports = PruneCommand;

+ 39
- 39
commands/admin/starboard.js View File

@ -2,47 +2,47 @@ const { Command } = require('discord-akairo');
const fs = require('fs');
class StarBoardCommand extends Command {
constructor() {
super('starboard', {
aliases: ['starboard'],
category: 'admin',
channelRestriction: 'guild',
userPermissions: ['ADMINISTRATOR'],
description: {
content: 'Set starboard',
usage: '[]',
examples: ['']
}
});
}
constructor() {
super('starboard', {
aliases: ['starboard'],
category: 'admin',
channelRestriction: 'guild',
userPermissions: ['ADMINISTRATOR'],
description: {
content: 'Set starboard',
usage: '[]',
examples: ['']
}
});
}
async exec(message) {
let starboardChannel = message.channel.id;
async exec(message) {
let starboardChannel = message.channel.id;
fs.readFile(`./starboard/${message.guild.id}.json`, 'utf8', function readFileCallback(err, data) {
if (err) {
fs.writeFile(`./starboard/${message.guild.id}.json`, `{"starboard": "${starboardChannel}"}`, function (err) {
if (err) {
console.log(err);
}
fs.close();
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;
var json = JSON.stringify(starboard); //convert it back to json
fs.writeFile(`./starboard/${message.guild.id}.json`, json, 'utf8', function (err) {
if (err) {
fs.close();
return console.log(err);
}
})
}
});
fs.close();
return message.channel.send(`This channel have been set as the starboard`);
}
fs.readFile(`./starboard/${message.guild.id}.json`, 'utf8', function readFileCallback(err, data) {
if (err) {
fs.writeFile(`./starboard/${message.guild.id}.json`, `{"starboard": "${starboardChannel}"}`, function (err) {
if (err) {
console.log(err);
}
fs.close();
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;
var json = JSON.stringify(starboard); //convert it back to json
fs.writeFile(`./starboard/${message.guild.id}.json`, json, 'utf8', function (err) {
if (err) {
fs.close();
return console.log(err);
}
});
}
});
fs.close();
return message.channel.send('This channel have been set as the starboard');
}
}
module.exports = StarBoardCommand;

+ 52
- 55
commands/admin/tag.js View File

@ -2,66 +2,63 @@ const { Command } = require('discord-akairo');
const fs = require('fs');
class TagCommand extends Command {
constructor() {
super('tag', {
aliases: ['tag'],
category: 'admin',
split: 'quoted',
args: [
{
id: "trigger";,
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"']
}
});
}
constructor() {
super('tag', {
aliases: ['tag'],
category: 'admin',
split: 'quoted',
args: [
{
id: 'trigger';,
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']
}
});
}
async exec(message, args) {
let trigger = args.trigger;
let response = args.response;
async exec(message, args) {
let trigger = args.trigger;
let response = args.response;
trigger = trigger.toLowerCase();
do {
trigger = trigger.replace('--', ' ');
} while (trigger.includes('--'))
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) {
if (err) {
fs.writeFile(`./tag/${message.guild.id}.json`, `{4;${trigger}4;:";${response}4;}`, function (err) {
if (err) {
fs.close();
console.log(err);
}
})
} else {
customresponse = JSON.parse(data); //now it an object
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);
}
})
}
});
fs.readFile(`./tag/${message.guild.id}.json`, 'utf8', function readFileCallback(err, data) {
if (err) {
fs.writeFile(`./tag/${message.guild.id}.json`, `{9;${trigger}9;:';${response}9;}`, function (err) {
if (err) {
fs.close();
console.log(err);
}
});
} else {
customresponse = JSON.parse(data); //now it an object
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);
}
});
}
});
fs.close();
return message.channel.send(`autoresponse have been set to ${trigger} : ${response}`);
}
fs.close();
return message.channel.send(`autoresponse have been set to ${trigger} : ${response}`);
}
}
module.exports = TagCommand;

+ 24
- 24
commands/admin/unban.js View File

@ -1,31 +1,31 @@
const { Command } = require('discord-akairo');
class UnbanCommand extends Command {
constructor() {
super('unban', {
aliases: ['unban'],
category: 'admin',
args: [
{
id: 'member',
type: 'user'
}
],
clientPermissions: ['BAN_MEMBERS'],
userPermissions: ['BAN_MEMBERS'],
channelRestriction: 'guild',
description: {
content: 'unban users',
usage: '[user id]',
examples: ['267065637183029248']
}
});
}
constructor() {
super('unban', {
aliases: ['unban'],
category: 'admin',
args: [
{
id: 'member',
type: 'user'
}
],
clientPermissions: ['BAN_MEMBERS'],
userPermissions: ['BAN_MEMBERS'],
channelRestriction: 'guild',
description: {
content: 'unban users',
usage: '[user id]',
examples: ['267065637183029248']
}
});
}
async exec(message, args) {
message.guild.unban(args.member)
.then(() => message.reply(`user was succesfully unbanned.`));
}
async exec(message, args) {
message.guild.unban(args.member)
.then(() => message.reply('user was succesfully unbanned.'));
}
}
module.exports = UnbanCommand;

+ 49
- 49
commands/admin/untag.js View File

@ -2,55 +2,55 @@ const { Command } = require('discord-akairo');
const fs = require('fs');
class UnTagCommand extends Command {
constructor() {
super('untag', {
aliases: ['untag'],
category: 'admin',
split: 'none',
args: [
{
id: "trigger";,
type: "string";
}
],
channelRestriction: 'guild',
description: {
content: 'Remove created custom autoresponse',
usage: '[trigger]',
examples: ['"do you know da wea"']
}
});
}
async exec(message, args) {
let trigger = args.trigger;
trigger = trigger.toLowerCase();
let customresponse = {}
let json = JSON.stringify(customresponse)
fs.readFile(`./tag/${message.guild.id}.json`, 'utf8', function readFileCallback(err, data) {
if (err) {
console.log(err);
} else {
customresponse = JSON.parse(data); //now it an object
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);
}
})
}
});
fs.close();
return message.channel.send(`The following autoresponse have been deleted: ${trigger}`);
}
constructor() {
super('untag', {
aliases: ['untag'],
category: 'admin',
split: 'none',
args: [
{
id: 'trigger';,
type: 'string';
}
],
channelRestriction: 'guild',
description: {
content: 'Remove created custom autoresponse',
usage: '[trigger]',
examples: ['do you know da wea']
}
});
}
async exec(message, args) {
let trigger = args.trigger;
trigger = trigger.toLowerCase();
let customresponse = {};
let json = JSON.stringify(customresponse);
fs.readFile(`./tag/${message.guild.id}.json`, 'utf8', function readFileCallback(err, data) {
if (err) {
console.log(err);
} else {
customresponse = JSON.parse(data); //now it an object
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);
}
});
}
});
fs.close();
return message.channel.send(`The following autoresponse have been deleted: ${trigger}`);
}
}
module.exports = UnTagCommand;

+ 19
- 19
commands/general/advice.js View File

@ -3,31 +3,31 @@ const Discord = require('discord.js');
const fetch = require('node-fetch');
class AdviceCommand extends Command {
constructor() {
super('advice', {
aliases: ['advice'],
category: 'general',
description: {
constructor() {
super('advice', {
aliases: ['advice'],
category: 'general',
description: {
content: 'Send some random advices',
usage: '',
examples: ['']
}
});
}
});
}
async exec(message) {
fetch("http://api.adviceslip.com/advice";).then((response) => {
return response.json();
}).then((response) => {
const adviceEmbed = new Discord.RichEmbed()
.setColor("#ff9900";)
.setTitle(response.slip.slip_id)
.setDescription(response.slip.advice)
async exec(message) {
fetch('http://api.adviceslip.com/advice';).then((response) => {
return response.json();
}).then((response) => {
const adviceEmbed = new Discord.RichEmbed()
.setColor('#ff9900';)
.setTitle(response.slip.slip_id)
.setDescription(response.slip.advice);
message.channel.send(adviceEmbed);
})}
message.channel.send(adviceEmbed);
});
}
}
module.exports = AdviceCommand;

+ 20
- 20
commands/general/badmeme.js View File

@ -1,33 +1,33 @@
const { Command } = require('discord-akairo');
const fetch = require('node-fetch')
const fetch = require('node-fetch');
class ImgurCommand extends Command {
constructor() {
super('imgur', {
aliases: ['badmeme', 'imgur'],
category: 'general',
description: {
constructor() {
super('imgur', {
aliases: ['badmeme', 'imgur'],
category: 'general',
description: {
content: 'Send some random images from imgur',
usage: '',
examples: ['']
}
});
}
});
}
async exec(message) {
fetch(";https://api.imgur.com/3/gallery/hot/day?showViral=true&mature=false&perPage=100&album_previews=true4;, {
headers: { "Authorization": "Client-ID e4cb6948f80f295"; },
}).then((response) => {
return response.json();
}).then((response) => {
if (response.success == 'false')
return message.channel.send('An error has occured')
async exec(message) {
fetch(';https://api.imgur.com/3/gallery/hot/day?showViral=true&mature=false&perPage=100&album_previews=true9;, {
headers: { 'Authorization': 'Client-ID e4cb6948f80f295'; },
}).then((response) => {
return response.json();
}).then((response) => {
if (response.success == 'false')
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));
message.channel.send(`**${response.data[i].title}**\n${response.data[i].link}`);
});
}
message.channel.send(`**${response.data[i].title}**\n${response.data[i].link}`);
});
}
}
module.exports = ImgurCommand;

+ 19
- 19
commands/general/clap.js View File

@ -1,30 +1,30 @@
const { Command } = require('discord-akairo');
class ClapCommand extends Command {
constructor() {
super('clap', {
aliases: ['clap'],
category: 'general',
split: 'none',
args: [
{
id: "text";,
type: "string";
}
],
description: {
constructor() {
super('clap', {
aliases: ['clap'],
category: 'general',
split: 'none',
args: [
{
id: 'text';,
type: 'string';
}
],
description: {
content: 'replace ๐Ÿ‘ the ๐Ÿ‘ spaces ๐Ÿ‘ with ๐Ÿ‘ clap ๐Ÿ‘',
usage: '[text]',
examples: ['replace the spaces with clap']
}
});
}
});
}
async exec(message, args) {
let clap = args.text.replace(/ /g, ' ๐Ÿ‘ ');
message.delete();
message.channel.send(`${clap} ๐Ÿ‘`);
}
async exec(message, args) {
let clap = args.text.replace(/ /g, ' ๐Ÿ‘ ');
message.delete();
message.channel.send(`${clap} ๐Ÿ‘`);
}
}
module.exports = ClapCommand;

+ 23
- 23
commands/general/emotesay.js View File

@ -2,34 +2,34 @@ const { Command } = require('discord-akairo');
const emojiCharacters = require('../../emojiCharacters');
class EmotesayCommand extends Command {
constructor() {
super('emotesay', {
aliases: ['emotesay', 'esay'],
category: 'general',
split: 'none',
args: [
{
id: "text";,
type: "string";
}
],
description: {
constructor() {
super('emotesay', {
aliases: ['emotesay', 'esay'],
category: 'general',
split: 'none',
args: [
{
id: 'text';,
type: 'string';
}
],
description: {
content: 'Replace the text you send with dancing letters',
usage: '[text]',
examples: ['Hello']
}
});
}
});
}
async exec(message, args) {
let text = args.text;
message.delete();
let emojiArray = [];
for (let i = 0; i < text.length; i++)
emojiArray[i] = emojiCharacters[text.toLowerCase().split('')[i]];
message.channel.send(emojiArray.join("";))
}
async exec(message, args) {
let text = args.text;
message.delete();
let emojiArray = [];
for (let i = 0; i < text.length; i++)
emojiArray[i] = emojiCharacters[text.toLowerCase().split('')[i]];
message.channel.send(emojiArray.join('';));
}
}
module.exports = EmotesayCommand;

+ 12
- 12
commands/general/ib.js View File

@ -2,22 +2,22 @@ const { Command } = require('discord-akairo');
const fetch = require('node-fetch');
class InspiroBotCommand extends Command {
constructor() {
super('InspiroBot', {
aliases: ['inspirobot', 'ib'],
category: 'general',
description: {
constructor() {
super('InspiroBot', {
aliases: ['inspirobot', 'ib'],
category: 'general',
description: {
content: 'Send images from Inspirobot',
usage: '',
examples: ['']
}
});
}
});
}
async exec(message) {
fetch('http://inspirobot.me/api?generate=true')
.then(res => res.text())
.then(body => message.channel.send({files: [body]}))
}
async exec(message) {
fetch('http://inspirobot.me/api?generate=true')
.then(res => res.text())
.then(body => message.channel.send({files: [body]}));
}
}
module.exports = InspiroBotCommand;

+ 42
- 41
commands/general/reddit.js View File

@ -1,52 +1,53 @@
const { Command } = require('discord-akairo');
const Discord = require('discord.js');
const fetch = require('node-fetch');
class RedditCommand extends Command {
constructor() {
super('reddit', {
aliases: ['reddit'],
category: 'general',
split: 'none',
args: [
{
id: 'sub',
type: 'string'
}
],
description: {
constructor() {
super('reddit', {
aliases: ['reddit'],
category: 'general',
split: 'none',
args: [
{
id: 'sub',
type: 'string'
}
],
description: {
content: 'Send random images from the subreddit you choose',
usage: '[subreddit]',
examples: ['2meirl4meirl']
}
});
}
});
}
async exec(message, args) {
let sub = args.sub;
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')
while (response.data.children[i].data.post_hint !== 'image') {
i = Math.floor((Math.random() * response.data.children.length));
a++
if (a == 5)
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>")`)
const redditEmbed = new Discord.RichEmbed()
.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}`)
message.channel.send(redditEmbed);
})
}
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');
while (response.data.children[i].data.post_hint !== 'image') {
i = Math.floor((Math.random() * response.data.children.length));
a++;
if (a == 5)
return message.channel.send('Could not find any images');
}
if (response.data.children[i].data.over_18 == true)
return message.channel.send('No nsfw');
const redditEmbed = new Discord.RichEmbed()
.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}`);
message.channel.send(redditEmbed);
});
}
}
module.exports = RedditCommand;

+ 68
- 68
commands/general/say.js View File

@ -1,79 +1,79 @@
const { Command } = require('discord-akairo');
class SayCommand extends Command {
constructor() {
super('say', {
aliases: ['say'],
category: 'general',
split: 'none',
args: [
{
id: 'text',
type: 'string',
}
],
description: {
content: 'Repeat what you say but can also replace ',
usage: '[text]',
examples: ['[member] is a big [adverbs] [verb]']
}
});
}
constructor() {
super('say', {
aliases: ['say'],
category: 'general',
split: 'none',
args: [
{
id: 'text',
type: 'string',
}
],
description: {
content: 'Repeat what you say but can also replace ',
usage: '[text]',
examples: ['[member] is a big [adverbs] [verb]']
}
});
}
async exec(message, args) {
let text = args.text;
async exec(message, args) {
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')
// 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');
// Generate a random number
function randNumber(file) {
let Rand = Math.floor((Math.random() * file.length) + 1);
return Rand;
}
// 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))
// 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]'))
// Generate a random number
function randNumber(file) {
let Rand = Math.floor((Math.random() * file.length) + 1);
return Rand;
}
// 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));
// 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]'));
// Send the final text
return message.channel.send(text);
}
// Send the final text
return message.channel.send(text);
}
}
module.exports = SayCommand;

+ 72
- 72
commands/general/sayd.js View File

@ -1,81 +1,81 @@
const { Command } = require('discord-akairo');
class SayCommand extends Command {
constructor() {
super('sayd', {
aliases: ['sayd'],
category: 'general',
split: 'none',
clientPermissions: 'MANAGE_MESSAGES',
args: [
{
id: 'text',
type: 'string'
}
],
description: {
content: 'Repeat what you say but delete the text you sent',
usage: '[text]',
examples: ['[member] is a big [adverbs] [verb]']
}
});
}
class SaydCommand extends Command {
constructor() {
super('sayd', {
aliases: ['sayd'],
category: 'general',
split: 'none',
clientPermissions: 'MANAGE_MESSAGES',
args: [
{
id: 'text',
type: 'string'