Changed indent
This commit is contained in:
parent
e8ce566c4b
commit
a64c0a2cc8
54 changed files with 1727 additions and 1740 deletions
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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`, `{"${trigger}":"${response}"}`, 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`, `{'${trigger}':'${response}'}`, 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;
|
|
@ -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;
|
|
@ -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"']
|
||||
}
|
||||
});
|
||||
}
|
||||
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;
|
||||
async exec(message, args) {
|
||||
let trigger = args.trigger;
|
||||
|
||||
trigger = trigger.toLowerCase();
|
||||
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) {
|
||||
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.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}`);
|
||||
fs.close();
|
||||
return message.channel.send(`The following autoresponse have been deleted: ${trigger}`);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = UnTagCommand;
|
|
@ -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;
|
|
@ -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=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')
|
||||
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' },
|
||||
}).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;
|
|
@ -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;
|
|
@ -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;
|
||||
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(""))
|
||||
}
|
||||
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;
|
|
@ -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;
|
|
@ -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;
|
||||
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));
|
||||
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}`);
|
||||
|
||||
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);
|
||||
})
|
||||
}
|
||||
message.channel.send(redditEmbed);
|
||||
});
|
||||
}
|
||||
}
|
||||
module.exports = RedditCommand;
|
|
@ -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;
|
|
@ -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'
|
||||
}
|
||||
],
|
||||
description: {
|
||||
content: 'Repeat what you say but delete the text you sent',
|
||||
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
|
||||
message.delete();
|
||||
return message.channel.send(text);
|
||||
}
|
||||
// Send the final text
|
||||
message.delete();
|
||||
return message.channel.send(text);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = SayCommand;
|
||||
module.exports = SaydCommand;
|
|
@ -1,22 +1,22 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
|
||||
class tokenCommand extends Command {
|
||||
constructor() {
|
||||
super('token', {
|
||||
aliases: ['token'],
|
||||
category: 'general',
|
||||
description: {
|
||||
constructor() {
|
||||
super('token', {
|
||||
aliases: ['token'],
|
||||
category: 'general',
|
||||
description: {
|
||||
content: 'Send the token of the bot',
|
||||
usage: '',
|
||||
examples: ['']
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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?"];
|
||||
trollMessage = trollMessage[Math.floor( Math.random() * trollMessage.length )];
|
||||
message.channel.send(trollMessage);
|
||||
}
|
||||
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?'];
|
||||
trollMessage = trollMessage[Math.floor( Math.random() * trollMessage.length )];
|
||||
message.channel.send(trollMessage);
|
||||
}
|
||||
}
|
||||
module.exports = tokenCommand;
|
|
@ -4,58 +4,58 @@ const gclient = new textToSpeech.TextToSpeechClient();
|
|||
const fs = require('fs');
|
||||
|
||||
class TtsCommand extends Command {
|
||||
constructor() {
|
||||
super('tts', {
|
||||
aliases: ['tts'],
|
||||
category: 'general',
|
||||
split: 'none',
|
||||
args: [
|
||||
{
|
||||
id: 'text',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
description: {
|
||||
content: 'Send a mp3 of what you wrote in tts',
|
||||
usage: '[text]',
|
||||
examples: ['hello']
|
||||
}
|
||||
});
|
||||
}
|
||||
constructor() {
|
||||
super('tts', {
|
||||
aliases: ['tts'],
|
||||
category: 'general',
|
||||
split: 'none',
|
||||
args: [
|
||||
{
|
||||
id: 'text',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
description: {
|
||||
content: 'Send a mp3 of what you wrote in tts',
|
||||
usage: '[text]',
|
||||
examples: ['hello']
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message, args) {
|
||||
let text = args.text;
|
||||
async exec(message, args) {
|
||||
let text = args.text;
|
||||
|
||||
// Construct the request
|
||||
const request = {
|
||||
input: { text: text },
|
||||
// Select the language and SSML Voice Gender (optional)
|
||||
voice: { languageCode: 'en-US', ssmlGender: 'NEUTRAL' },
|
||||
// Select the type of audio encoding
|
||||
audioConfig: { audioEncoding: 'MP3' },
|
||||
};
|
||||
// Construct the request
|
||||
const request = {
|
||||
input: { text: text },
|
||||
// Select the language and SSML Voice Gender (optional)
|
||||
voice: { languageCode: 'en-US', ssmlGender: 'NEUTRAL' },
|
||||
// Select the type of audio encoding
|
||||
audioConfig: { audioEncoding: 'MP3' },
|
||||
};
|
||||
|
||||
// Performs the Text-to-Speech request
|
||||
gclient.synthesizeSpeech(request, (err, response) => {
|
||||
if (err) {
|
||||
fs.close();
|
||||
console.error('ERROR:', err);
|
||||
return;
|
||||
}
|
||||
// Performs the Text-to-Speech request
|
||||
gclient.synthesizeSpeech(request, (err, response) => {
|
||||
if (err) {
|
||||
fs.close();
|
||||
console.error('ERROR:', err);
|
||||
return;
|
||||
}
|
||||
|
||||
// Write the binary audio content to a local file
|
||||
fs.writeFile('tts.mp3', response.audioContent, 'binary', err => {
|
||||
if (err) {
|
||||
console.error('ERROR:', err);
|
||||
message.channel.send('An error has occured, the message is probably too long');
|
||||
fs.close();
|
||||
return;
|
||||
}
|
||||
console.log('Audio content written to file: tts.mp3');
|
||||
message.channel.send({ files: ['./tts.mp3'] })
|
||||
});
|
||||
fs.close();
|
||||
});
|
||||
}
|
||||
// Write the binary audio content to a local file
|
||||
fs.writeFile('tts.mp3', response.audioContent, 'binary', err => {
|
||||
if (err) {
|
||||
console.error('ERROR:', err);
|
||||
message.channel.send('An error has occured, the message is probably too long');
|
||||
fs.close();
|
||||
return;
|
||||
}
|
||||
console.log('Audio content written to file: tts.mp3');
|
||||
message.channel.send({ files: ['./tts.mp3'] });
|
||||
});
|
||||
fs.close();
|
||||
});
|
||||
}
|
||||
}
|
||||
module.exports = TtsCommand;
|
|
@ -4,78 +4,78 @@ const gclient = new textToSpeech.TextToSpeechClient();
|
|||
const fs = require('fs');
|
||||
|
||||
class TtsvcCommand extends Command {
|
||||
constructor() {
|
||||
super('ttsvc', {
|
||||
aliases: ['ttsvc'],
|
||||
category: 'general',
|
||||
split: 'none',
|
||||
args: [
|
||||
{
|
||||
id: 'text',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
description: {
|
||||
content: 'Say what you wrote in voice channel',
|
||||
usage: '[text]',
|
||||
examples: ['hello']
|
||||
}
|
||||
});
|
||||
}
|
||||
constructor() {
|
||||
super('ttsvc', {
|
||||
aliases: ['ttsvc'],
|
||||
category: 'general',
|
||||
split: 'none',
|
||||
args: [
|
||||
{
|
||||
id: 'text',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
description: {
|
||||
content: 'Say what you wrote in voice channel',
|
||||
usage: '[text]',
|
||||
examples: ['hello']
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message, args) {
|
||||
let text = args.text;
|
||||
async exec(message, args) {
|
||||
let text = args.text;
|
||||
|
||||
const { voiceChannel } = message.member;
|
||||
const { voiceChannel } = message.member;
|
||||
|
||||
|
||||
// Construct the request
|
||||
const request = {
|
||||
input: { text: text },
|
||||
// Select the language and SSML Voice Gender (optional)
|
||||
voice: { languageCode: 'en-US', ssmlGender: 'NEUTRAL' },
|
||||
// Select the type of audio encoding
|
||||
audioConfig: { audioEncoding: 'MP3' },
|
||||
};
|
||||
// Construct the request
|
||||
const request = {
|
||||
input: { text: text },
|
||||
// Select the language and SSML Voice Gender (optional)
|
||||
voice: { languageCode: 'en-US', ssmlGender: 'NEUTRAL' },
|
||||
// Select the type of audio encoding
|
||||
audioConfig: { audioEncoding: 'MP3' },
|
||||
};
|
||||
|
||||
// Performs the Text-to-Speech request
|
||||
gclient.synthesizeSpeech(request, (err, response) => {
|
||||
if (err) {
|
||||
console.error('ERROR:', err);
|
||||
return;
|
||||
}
|
||||
// Performs the Text-to-Speech request
|
||||
gclient.synthesizeSpeech(request, (err, response) => {
|
||||
if (err) {
|
||||
console.error('ERROR:', err);
|
||||
return;
|
||||
}
|
||||
|
||||
// Write the binary audio content to a local file
|
||||
fs.writeFile('ttsvc.mp3', response.audioContent, 'binary', err => {
|
||||
if (err) {
|
||||
console.error('ERROR:', err);
|
||||
message.channel.send('An error has occured, the message is probably too long');
|
||||
fs.close();
|
||||
return;
|
||||
}
|
||||
console.log('Audio content written to file: ttsvc.mp3');
|
||||
// Write the binary audio content to a local file
|
||||
fs.writeFile('ttsvc.mp3', response.audioContent, 'binary', err => {
|
||||
if (err) {
|
||||
console.error('ERROR:', err);
|
||||
message.channel.send('An error has occured, the message is probably too long');
|
||||
fs.close();
|
||||
return;
|
||||
}
|
||||
console.log('Audio content written to file: ttsvc.mp3');
|
||||
|
||||
// If not in voice channel ask user to join
|
||||
if (!voiceChannel) {
|
||||
return message.reply('please join a voice channel first!');
|
||||
// If not in voice channel ask user to join
|
||||
if (!voiceChannel) {
|
||||
return message.reply('please join a voice channel first!');
|
||||
|
||||
} else { // you should be careful in what is included in your scopes, you didn't use the {}
|
||||
// If user say "stop" make the bot leave voice channel
|
||||
if (text == 'stop') {
|
||||
voiceChannel.leave();
|
||||
message.channel.send('I leaved the channel');
|
||||
} else { // you should be careful in what is included in your scopes, you didn't use the {}
|
||||
voiceChannel.join().then(connection => {
|
||||
const dispatcher = connection.playStream('./ttsvc.mp3');
|
||||
// End at then end of the audio stream
|
||||
dispatcher.on('end', () => setTimeout(function () {
|
||||
voiceChannel.leave();
|
||||
}, 2000));
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
} else { // you should be careful in what is included in your scopes, you didn't use the {}
|
||||
// If user say "stop" make the bot leave voice channel
|
||||
if (text == 'stop') {
|
||||
voiceChannel.leave();
|
||||
message.channel.send('I leaved the channel');
|
||||
} else { // you should be careful in what is included in your scopes, you didn't use the {}
|
||||
voiceChannel.join().then(connection => {
|
||||
const dispatcher = connection.playStream('./ttsvc.mp3');
|
||||
// End at then end of the audio stream
|
||||
dispatcher.on('end', () => setTimeout(function () {
|
||||
voiceChannel.leave();
|
||||
}, 2000));
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
module.exports = TtsvcCommand;
|
|
@ -1,52 +1,52 @@
|
|||
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 {
|
||||
constructor() {
|
||||
super('fetish', {
|
||||
aliases: ['fetish'],
|
||||
category: 'images',
|
||||
args: [
|
||||
{
|
||||
id: 'image',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
constructor() {
|
||||
super('fetish', {
|
||||
aliases: ['fetish'],
|
||||
category: 'images',
|
||||
args: [
|
||||
{
|
||||
id: 'image',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message, args) {
|
||||
let Attachment = (message.attachments).array();
|
||||
let image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
image = message.author.displayAvatarURL
|
||||
else if(Attachment[0] && Attachment[0].url.endsWith('gif'))
|
||||
return message.channel.send('Gif dosent work, sorry')
|
||||
else if (!image)
|
||||
image = Attachment[0].url
|
||||
async exec(message, args) {
|
||||
let Attachment = (message.attachments).array();
|
||||
let image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
image = message.author.displayAvatarURL;
|
||||
else if(Attachment[0] && Attachment[0].url.endsWith('gif'))
|
||||
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))
|
||||
message.channel.send('Processing <a:loadingmin:527579785212329984>')
|
||||
.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')
|
||||
})
|
||||
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
|
||||
const { body: buffer } = await superagent.get(image);
|
||||
const bg = await loadImage(buffer);
|
||||
ctx.drawImage(bg, 50, 50, 450, 450);
|
||||
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);
|
||||
ctx.drawImage(bg, 50, 50, 450, 450);
|
||||
|
||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'myfetish.png');
|
||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'myfetish.png');
|
||||
|
||||
|
||||
message.channel.send(attachment).catch(() => {
|
||||
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');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = FetishCommand;
|
|
@ -1,54 +1,54 @@
|
|||
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 GodCommand extends Command {
|
||||
constructor() {
|
||||
super('god', {
|
||||
aliases: ['god'],
|
||||
category: 'images',
|
||||
args: [
|
||||
{
|
||||
id: 'image',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
constructor() {
|
||||
super('god', {
|
||||
aliases: ['god'],
|
||||
category: 'images',
|
||||
args: [
|
||||
{
|
||||
id: 'image',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message, args) {
|
||||
let Attachment = (message.attachments).array();
|
||||
let image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
image = message.author.displayAvatarURL
|
||||
else if(Attachment[0] && Attachment[0].url.endsWith('gif'))
|
||||
return message.channel.send('Gif dosent work, sorry')
|
||||
else if (!image)
|
||||
image = Attachment[0].url
|
||||
async exec(message, args) {
|
||||
let Attachment = (message.attachments).array();
|
||||
let image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
image = message.author.displayAvatarURL;
|
||||
else if (Attachment[0] && Attachment[0].url.endsWith('gif'))
|
||||
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))
|
||||
message.channel.send('Processing <a:loadingmin:527579785212329984>')
|
||||
.then(loadingmsg => loadingmsg.delete(1000));
|
||||
|
||||
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')
|
||||
})
|
||||
const bg = await loadImage(buffer);
|
||||
ctx.drawImage(bg, 0, 0, canvas.width, canvas.height);
|
||||
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');
|
||||
});
|
||||
const bg = await loadImage(buffer);
|
||||
ctx.drawImage(bg, 0, 0, canvas.width, canvas.height);
|
||||
|
||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'god.png');
|
||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'god.png');
|
||||
|
||||
message.delete();
|
||||
message.channel.send(attachment)
|
||||
.catch(() => {
|
||||
message.channel.send('an error as occured. Check the bot/channel permissions')
|
||||
})
|
||||
}
|
||||
message.delete();
|
||||
message.channel.send(attachment)
|
||||
.catch(() => {
|
||||
message.channel.send('an error as occured. Check the bot/channel permissions');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = GodCommand;
|
|
@ -1,76 +1,75 @@
|
|||
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 {
|
||||
constructor() {
|
||||
super('idubbbz', {
|
||||
aliases: ['idubbbz', 'edups'],
|
||||
category: 'images',
|
||||
split: 'quoted',
|
||||
args: [
|
||||
{
|
||||
id: 'text',
|
||||
type: 'string'
|
||||
},
|
||||
{
|
||||
id: 'image',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
constructor() {
|
||||
super('idubbbz', {
|
||||
aliases: ['idubbbz', 'edups'],
|
||||
category: 'images',
|
||||
split: 'quoted',
|
||||
args: [
|
||||
{
|
||||
id: 'text',
|
||||
type: 'string'
|
||||
},
|
||||
{
|
||||
id: 'image',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message, args) {
|
||||
let text = args.text;
|
||||
let Attachment = (message.attachments).array();
|
||||
let image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
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 {}
|
||||
image = Attachment[0].url;
|
||||
async exec(message, args) {
|
||||
let text = args.text;
|
||||
let Attachment = (message.attachments).array();
|
||||
let image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
image = message.author.displayAvatarURL;
|
||||
else if (Attachment[0] && Attachment[0].url.endsWith('gif'))
|
||||
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))
|
||||
message.channel.send('Processing <a:loadingmin:527579785212329984>')
|
||||
.then(loadingmsg => loadingmsg.delete(2000));
|
||||
|
||||
const canvas = createCanvas(1281, 627)
|
||||
const applyText = (canvas, text) => {
|
||||
const ctx = canvas.getContext('2d');
|
||||
const canvas = createCanvas(1281, 627);
|
||||
const applyText = (canvas, text) => {
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
// Declare a base size of the font
|
||||
let fontSize = 50;
|
||||
// Declare a base size of the font
|
||||
let fontSize = 50;
|
||||
|
||||
do {
|
||||
// Assign the font to the context and decrement it so it can be measured again
|
||||
ctx.font = `${fontSize -= 10}px ubuntu`;
|
||||
} while (ctx.measureText(text).width > 700 - 300);
|
||||
do {
|
||||
// Assign the font to the context and decrement it so it can be measured again
|
||||
ctx.font = `${fontSize -= 10}px ubuntu`;
|
||||
} while (ctx.measureText(text).width > 700 - 300);
|
||||
|
||||
// Return the result to use in the actual canvas
|
||||
return ctx.font;
|
||||
};
|
||||
}
|
||||
// Return the result to use in the actual canvas
|
||||
return ctx.font;
|
||||
};
|
||||
|
||||
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 bg = await loadImage(buffer);
|
||||
ctx.drawImage(bg, 0, 0, canvas.width, canvas.height);
|
||||
ctx.font = applyText(canvas, text)
|
||||
ctx.fillStyle = '#000000';
|
||||
ctx.fillText(text, canvas.width / 2.1, canvas.height / 1.5);
|
||||
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(() => {
|
||||
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.fillStyle = '#000000';
|
||||
ctx.fillText(text, canvas.width / 2.1, canvas.height / 1.5);
|
||||
|
||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'edups.png');
|
||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'edups.png');
|
||||
|
||||
message.channel.send(attachment).catch(error => {
|
||||
message.channel.send('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');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = IdubbbzCommand;
|
|
@ -1,75 +1,74 @@
|
|||
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 {
|
||||
constructor() {
|
||||
super('idubbbzpaint', {
|
||||
aliases: ['idubbbzpaint', 'edupspaint'],
|
||||
category: 'images',
|
||||
args: [
|
||||
{
|
||||
id: 'text',
|
||||
type: 'string'
|
||||
},
|
||||
{
|
||||
id: 'image',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
constructor() {
|
||||
super('idubbbzpaint', {
|
||||
aliases: ['idubbbzpaint', 'edupspaint'],
|
||||
category: 'images',
|
||||
args: [
|
||||
{
|
||||
id: 'text',
|
||||
type: 'string'
|
||||
},
|
||||
{
|
||||
id: 'image',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message, args) {
|
||||
let text = args.text;
|
||||
let Attachment = (message.attachments).array();
|
||||
let image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
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 {}
|
||||
image = Attachment[0].url;
|
||||
async exec(message, args) {
|
||||
let text = args.text;
|
||||
let Attachment = (message.attachments).array();
|
||||
let image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
image = message.author.displayAvatarURL;
|
||||
else if (Attachment[0] && Attachment[0].url.endsWith('gif'))
|
||||
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))
|
||||
message.channel.send('Processing <a:loadingmin:527579785212329984>')
|
||||
.then(loadingmsg => loadingmsg.delete(2000));
|
||||
|
||||
const canvas = createCanvas(1024, 544)
|
||||
const applyText = (canvas, text) => {
|
||||
const ctx = canvas.getContext('2d');
|
||||
const canvas = createCanvas(1024, 544);
|
||||
const applyText = (canvas, text) => {
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
// Declare a base size of the font
|
||||
let fontSize = 100;
|
||||
// Declare a base size of the font
|
||||
let fontSize = 100;
|
||||
|
||||
do {
|
||||
// Assign the font to the context and decrement it so it can be measured again
|
||||
ctx.font = `${fontSize -= 10}px ubuntu`;
|
||||
} while (ctx.measureText(text).width > 800 - 300);
|
||||
do {
|
||||
// Assign the font to the context and decrement it so it can be measured again
|
||||
ctx.font = `${fontSize -= 10}px ubuntu`;
|
||||
} while (ctx.measureText(text).width > 800 - 300);
|
||||
|
||||
// Return the result to use in the actual canvas
|
||||
return ctx.font;
|
||||
};
|
||||
}
|
||||
// Return the result to use in the actual canvas
|
||||
return ctx.font;
|
||||
};
|
||||
|
||||
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 bg = await loadImage(buffer);
|
||||
ctx.drawImage(bg, 0, 0, canvas.width, canvas.height);
|
||||
ctx.font = applyText(canvas, text)
|
||||
ctx.fillStyle = '#ffffff';
|
||||
ctx.fillText(text, canvas.width / 3, canvas.height / 1.1);
|
||||
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(() => {
|
||||
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.fillStyle = '#ffffff';
|
||||
ctx.fillText(text, canvas.width / 3, canvas.height / 1.1);
|
||||
|
||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'edupspaint.png');
|
||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'edupspaint.png');
|
||||
|
||||
message.channel.send(attachment).catch(error => {
|
||||
message.channel.send('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');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = IdubbbzPaintCommand;
|
|
@ -1,52 +1,52 @@
|
|||
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 {
|
||||
constructor() {
|
||||
super('like', {
|
||||
aliases: ['like'],
|
||||
category: 'images',
|
||||
args: [
|
||||
{
|
||||
id: 'image',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
constructor() {
|
||||
super('like', {
|
||||
aliases: ['like'],
|
||||
category: 'images',
|
||||
args: [
|
||||
{
|
||||
id: 'image',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message, args) {
|
||||
let Attachment = (message.attachments).array();
|
||||
let image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
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 {}
|
||||
image = Attachment[0].url;
|
||||
async exec(message, args) {
|
||||
let Attachment = (message.attachments).array();
|
||||
let image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
image = message.author.displayAvatarURL;
|
||||
else if (Attachment[0] && Attachment[0].url.endsWith('gif'))
|
||||
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));
|
||||
}
|
||||
message.channel.send('Processing <a:loadingmin:527579785212329984>')
|
||||
.then(loadingmsg => loadingmsg.delete(1000));
|
||||
|
||||
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 bg = await loadImage(buffer);
|
||||
ctx.drawImage(bg, 0, 0, canvas.width, canvas.height);
|
||||
|
||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'like.png');
|
||||
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(() => {
|
||||
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);
|
||||
|
||||
message.channel.send(attachment).catch(error => {
|
||||
message.channel.send('an error as occured. Check the bot/channel permissions')
|
||||
})
|
||||
}
|
||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'like.png');
|
||||
|
||||
message.channel.send(attachment).catch(() => {
|
||||
message.channel.send('an error as occured. Check the bot/channel permissions');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = LikeCommand;
|
|
@ -1,52 +1,52 @@
|
|||
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 {
|
||||
constructor() {
|
||||
super('ugly', {
|
||||
aliases: ['ugly'],
|
||||
category: 'images',
|
||||
args: [
|
||||
{
|
||||
id: 'image',
|
||||
type: 'string',
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
constructor() {
|
||||
super('ugly', {
|
||||
aliases: ['ugly'],
|
||||
category: 'images',
|
||||
args: [
|
||||
{
|
||||
id: 'image',
|
||||
type: 'string',
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message, args) {
|
||||
let Attachment = (message.attachments).array();
|
||||
let image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
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 {}
|
||||
image = Attachment[0].url;
|
||||
async exec(message, args) {
|
||||
let Attachment = (message.attachments).array();
|
||||
let image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
image = message.author.displayAvatarURL;
|
||||
else if (Attachment[0] && Attachment[0].url.endsWith('gif'))
|
||||
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));
|
||||
}
|
||||
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')
|
||||
})
|
||||
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
|
||||
const { body: buffer } = await superagent.get(image);
|
||||
const bg = await loadImage(buffer);
|
||||
ctx.drawImage(bg, 40, 100, 250, 250);
|
||||
|
||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'ugly.png');
|
||||
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);
|
||||
ctx.drawImage(bg, 40, 100, 250, 250);
|
||||
|
||||
message.channel.send(attachment).catch(error => {
|
||||
message.channel.send('an error as occured. Check the bot/channel permissions')
|
||||
})
|
||||
}
|
||||
const attachment = new Discord.Attachment(canvas.toBuffer(), 'ugly.png');
|
||||
|
||||
message.channel.send(attachment).catch(() => {
|
||||
message.channel.send('an error as occured. Check the bot/channel permissions');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = UglyCommand;
|
|
@ -1,40 +1,41 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
|
||||
class BotAvatarCommand extends Command {
|
||||
constructor() {
|
||||
super('botavatar', {
|
||||
aliases: ['botavatar', 'bavatar'],
|
||||
split: 'none',
|
||||
category: 'owner',
|
||||
ownerOnly: 'true',
|
||||
args: [
|
||||
{
|
||||
id: 'image',
|
||||
type:'string',
|
||||
optional: true
|
||||
}
|
||||
],
|
||||
description: {
|
||||
constructor() {
|
||||
super('botavatar', {
|
||||
aliases: ['botavatar', 'bavatar'],
|
||||
split: 'none',
|
||||
category: 'owner',
|
||||
ownerOnly: 'true',
|
||||
args: [
|
||||
{
|
||||
id: 'image',
|
||||
type:'string',
|
||||
optional: true
|
||||
}
|
||||
],
|
||||
description: {
|
||||
content: 'Change bot profil picture',
|
||||
usage: '[image attachment/or link]',
|
||||
examples: ['image file']
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message, args) {
|
||||
let Attachment = (message.attachments).array();
|
||||
let image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
return message.say('You didint provide any images')
|
||||
else
|
||||
image = Attachment[0].url
|
||||
this.client.user.setAvatar(image)
|
||||
.catch(() => message.channel.send("The link you provided dosen't work... is it a picture?"));
|
||||
message.channel.send('The avatar have been changed succesfully');
|
||||
async exec(message, args) {
|
||||
let Attachment = (message.attachments).array();
|
||||
let image = args.image;
|
||||
if (!Attachment[0] && !image)
|
||||
return message.say('You didint provide any images');
|
||||
else
|
||||
image = Attachment[0].url;
|
||||
|
||||
this.client.user.setAvatar(image)
|
||||
.catch(() => message.channel.send('The link you provided dosen\'t work... is it a picture?'));
|
||||
message.channel.send('The avatar have been changed succesfully');
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = BotAvatarCommand;
|
|
@ -1,45 +1,45 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
|
||||
class EvalCommand extends Command {
|
||||
constructor() {
|
||||
super('dm', {
|
||||
aliases: ['dm', 'pm'],
|
||||
split: 'none',
|
||||
category: 'owner',
|
||||
args: [
|
||||
{
|
||||
id: 'user',
|
||||
type: 'user'
|
||||
},
|
||||
{
|
||||
id: 'message',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
ownerOnly: 'true',
|
||||
description: {
|
||||
constructor() {
|
||||
super('dm', {
|
||||
aliases: ['dm', 'pm'],
|
||||
split: 'none',
|
||||
category: 'owner',
|
||||
args: [
|
||||
{
|
||||
id: 'user',
|
||||
type: 'user'
|
||||
},
|
||||
{
|
||||
id: 'text',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
ownerOnly: 'true',
|
||||
description: {
|
||||
content: 'DM users',
|
||||
usage: '[user id] [message]',
|
||||
examples: ['267065637183029248 hello i recived your feedback and...']
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message, args) {
|
||||
let user = args.user;
|
||||
let message = args.message;
|
||||
async exec(message, args) {
|
||||
let user = args.user;
|
||||
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}`)
|
||||
}
|
||||
else {
|
||||
user.send(`**Message from the dev:**\n${message}`)
|
||||
message.channel.send(`DM sent to ${user.username}`)
|
||||
}
|
||||
let Attachment = (message.attachments).array();
|
||||
if (Attachment[0]) {
|
||||
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${text}`);
|
||||
message.channel.send(`DM sent to ${user.username}`);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = EvalCommand;
|
|
@ -1,31 +1,31 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
|
||||
class emitCommand extends Command {
|
||||
constructor() {
|
||||
super('emit', {
|
||||
aliases: ['emit'],
|
||||
split: 'none',
|
||||
category: 'owner',
|
||||
ownerOnly: 'true',
|
||||
args: [
|
||||
{
|
||||
id: 'event',
|
||||
prompt: 'Wich event should i trigger?',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
description: {
|
||||
constructor() {
|
||||
super('emit', {
|
||||
aliases: ['emit'],
|
||||
split: 'none',
|
||||
category: 'owner',
|
||||
ownerOnly: 'true',
|
||||
args: [
|
||||
{
|
||||
id: 'event',
|
||||
prompt: 'Wich event should i trigger?',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
description: {
|
||||
content: 'Trigger an event',
|
||||
usage: '[event]',
|
||||
examples: ['ready']
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message, args) {
|
||||
this.client.emit(`${args.event}`);
|
||||
return message.channel.send(`${args.event} has been emited!`)
|
||||
}
|
||||
async exec(message, args) {
|
||||
this.client.emit(`${args.event}`);
|
||||
return message.channel.send(`${args.event} has been emited!`);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = emitCommand;
|
|
@ -1,46 +1,46 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
|
||||
class EvalCommand extends Command {
|
||||
constructor() {
|
||||
super('eval', {
|
||||
aliases: ['eval'],
|
||||
split: 'none',
|
||||
category: 'owner',
|
||||
args: [
|
||||
{
|
||||
id: 'eval',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
ownerOnly: 'true',
|
||||
description: {
|
||||
constructor() {
|
||||
super('eval', {
|
||||
aliases: ['eval'],
|
||||
split: 'none',
|
||||
category: 'owner',
|
||||
args: [
|
||||
{
|
||||
id: 'eval',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
ownerOnly: 'true',
|
||||
description: {
|
||||
content: 'Execute javascript',
|
||||
usage: '[code]',
|
||||
examples: ['message.channel.send(\'Hi\')']
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message, args) {
|
||||
const clean = text => {
|
||||
if (typeof(text) === "string")
|
||||
return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
|
||||
else
|
||||
return text;
|
||||
}
|
||||
async exec(message, args) {
|
||||
const clean = text => {
|
||||
if (typeof(text) === 'string')
|
||||
return text.replace(/`/g, '`' + String.fromCharCode(8203)).replace(/@/g, '@' + String.fromCharCode(8203));
|
||||
else
|
||||
return text;
|
||||
};
|
||||
|
||||
try {
|
||||
const code = args.eval
|
||||
let evaled = eval(code);
|
||||
try {
|
||||
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"});
|
||||
} catch (err) {
|
||||
message.channel.send(`\`ERROR\` \`\`\`xl\n${clean(err)}\n\`\`\``);
|
||||
}
|
||||
}
|
||||
message.channel.send(clean(evaled), {code:'xl'});
|
||||
} catch (err) {
|
||||
message.channel.send(`\`ERROR\` \`\`\`xl\n${clean(err)}\n\`\`\``);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = EvalCommand;
|
|
@ -1,25 +1,25 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
|
||||
class RebootCommand extends Command {
|
||||
constructor() {
|
||||
super('reboot', {
|
||||
aliases: ['ded', 'reboot', 'restart'],
|
||||
split: 'none',
|
||||
category: 'owner',
|
||||
ownerOnly: 'true',
|
||||
description: {
|
||||
constructor() {
|
||||
super('reboot', {
|
||||
aliases: ['ded', 'reboot', 'restart'],
|
||||
split: 'none',
|
||||
category: 'owner',
|
||||
ownerOnly: 'true',
|
||||
description: {
|
||||
content: 'Restart the bot',
|
||||
usage: '[]',
|
||||
examples: ['']
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message) {
|
||||
await message.channel.send('k bye thx\nhttps://i.redd.it/lw8hrvr0l4f11.jpg');
|
||||
process.exit();
|
||||
async exec(message) {
|
||||
await message.channel.send('k bye thx\nhttps://i.redd.it/lw8hrvr0l4f11.jpg');
|
||||
process.exit();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = RebootCommand;
|
|
@ -1,31 +1,31 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
|
||||
class StatusCommand extends Command {
|
||||
constructor() {
|
||||
super('status', {
|
||||
aliases: ['status'],
|
||||
split: 'none',
|
||||
category: 'owner',
|
||||
ownerOnly: 'true',
|
||||
args: [
|
||||
{
|
||||
id: 'status',
|
||||
prompt: 'Wich status should i have?',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
description: {
|
||||
constructor() {
|
||||
super('status', {
|
||||
aliases: ['status'],
|
||||
split: 'none',
|
||||
category: 'owner',
|
||||
ownerOnly: 'true',
|
||||
args: [
|
||||
{
|
||||
id: 'status',
|
||||
prompt: 'Wich status should i have?',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
description: {
|
||||
content: 'Change the status of the bot',
|
||||
usage: '[status]',
|
||||
examples: ['Hello world!']
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message, args) {
|
||||
this.client.user.setActivity(args.status);
|
||||
message.channel.send(`Status have been set to ${args.status}`);
|
||||
}
|
||||
async exec(message, args) {
|
||||
this.client.user.setActivity(args.status);
|
||||
message.channel.send(`Status have been set to ${args.status}`);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = StatusCommand;
|
|
@ -1,31 +1,31 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
|
||||
class usernameCommand extends Command {
|
||||
constructor() {
|
||||
super('username', {
|
||||
aliases: ['username'],
|
||||
split: 'none',
|
||||
category: 'owner',
|
||||
ownerOnly: 'true',
|
||||
args: [
|
||||
{
|
||||
id: 'username',
|
||||
prompt: 'Wich username should i have?',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
description: {
|
||||
constructor() {
|
||||
super('username', {
|
||||
aliases: ['username'],
|
||||
split: 'none',
|
||||
category: 'owner',
|
||||
ownerOnly: 'true',
|
||||
args: [
|
||||
{
|
||||
id: 'username',
|
||||
prompt: 'Wich username should i have?',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
description: {
|
||||
content: 'Change the username of the bot',
|
||||
usage: '[username]',
|
||||
examples: ['haha no']
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message, args) {
|
||||
this.client.user.setUsername(args.username);
|
||||
message.channel.send(`The username have been changed sucessfully to ${args.username}`);
|
||||
}
|
||||
async exec(message, args) {
|
||||
this.client.user.setUsername(args.username);
|
||||
message.channel.send(`The username have been changed sucessfully to ${args.username}`);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = usernameCommand;
|
|
@ -1,41 +1,41 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
|
||||
class bsespamCommand extends Command {
|
||||
constructor() {
|
||||
super('bsespam', {
|
||||
aliases: ['bsespam'] , //Required
|
||||
category: 'reserved', //recommended
|
||||
channelRestriction: 'guild', //needed if you want to restrict where we can launch the command
|
||||
args: [ //if need args
|
||||
{
|
||||
id: 'number',
|
||||
type: 'interger',
|
||||
},
|
||||
{
|
||||
id: 'text',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
description: { //recommended
|
||||
content: 'ONLY FOR BIG SNOW ENERGY\nSpam the text you send',
|
||||
usage: '[args]',
|
||||
examples: ['']
|
||||
}
|
||||
});
|
||||
}
|
||||
constructor() {
|
||||
super('bsespam', {
|
||||
aliases: ['bsespam'] , //Required
|
||||
category: 'reserved', //recommended
|
||||
channelRestriction: 'guild', //needed if you want to restrict where we can launch the command
|
||||
args: [ //if need args
|
||||
{
|
||||
id: 'number',
|
||||
type: 'interger',
|
||||
},
|
||||
{
|
||||
id: 'text',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
description: { //recommended
|
||||
content: 'ONLY FOR BIG SNOW ENERGY\nSpam the text you send',
|
||||
usage: '[args]',
|
||||
examples: ['']
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message, args) {
|
||||
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!')
|
||||
}
|
||||
}
|
||||
async exec(message, args) {
|
||||
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!');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = bsespamCommand;
|
|
@ -1,30 +1,30 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
|
||||
class AvatarCommand extends Command {
|
||||
constructor() {
|
||||
super('avatar', {
|
||||
aliases: ['avatar', 'avy'],
|
||||
category: 'utility',
|
||||
args: [
|
||||
{
|
||||
id: 'user',
|
||||
type: 'user'
|
||||
}
|
||||
],
|
||||
description: {
|
||||
constructor() {
|
||||
super('avatar', {
|
||||
aliases: ['avatar', 'avy'],
|
||||
category: 'utility',
|
||||
args: [
|
||||
{
|
||||
id: 'user',
|
||||
type: 'user'
|
||||
}
|
||||
],
|
||||
description: {
|
||||
content: 'Show avatar of the mentioned user or you',
|
||||
usage: '(optional) [@user]',
|
||||
examples: ['', '@user']
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message, args) {
|
||||
if (!args.user) // While these kind of statments work you really should use {}
|
||||
return message.channel.send(`Your avatar:\n${message.author.displayAvatarURL}`);
|
||||
else
|
||||
return message.channel.send(`${args.user.username}'s avatar:\n${args.user.displayAvatarURL}`);
|
||||
}
|
||||
async exec(message, args) {
|
||||
if (!args.user) // While these kind of statments work you really should use {}
|
||||
return message.channel.send(`Your avatar:\n${message.author.displayAvatarURL}`);
|
||||
else
|
||||
return message.channel.send(`${args.user.username}'s avatar:\n${args.user.displayAvatarURL}`);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = AvatarCommand;
|
|
@ -4,52 +4,52 @@ const youtubedl = require('youtube-dl');
|
|||
const { fbuser, fbpasswd } = require('../../config.json');
|
||||
|
||||
class DownloadCommand extends Command {
|
||||
constructor() {
|
||||
super('download', {
|
||||
aliases: ['download', 'dl'],
|
||||
category: 'utility',
|
||||
args: [
|
||||
{
|
||||
id: "link",
|
||||
type: "string",
|
||||
default: "https://www.youtube.com/watch?v=6n3pFFPSlW4"
|
||||
}
|
||||
],
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
description: {
|
||||
content: 'Download videos from different website from the link you provided',
|
||||
usage: '[link]',
|
||||
examples: ['https://www.youtube.com/watch?v=6n3pFFPSlW4']
|
||||
}
|
||||
});
|
||||
}
|
||||
constructor() {
|
||||
super('download', {
|
||||
aliases: ['download', 'dl'],
|
||||
category: 'utility',
|
||||
args: [
|
||||
{
|
||||
id: 'link',
|
||||
type: 'string',
|
||||
default: 'https://www.youtube.com/watch?v=6n3pFFPSlW4'
|
||||
}
|
||||
],
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
description: {
|
||||
content: 'Download videos from different website from the link you provided',
|
||||
usage: '[link]',
|
||||
examples: ['https://www.youtube.com/watch?v=6n3pFFPSlW4']
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message, args) {
|
||||
let link = args.link;
|
||||
async exec(message, args) {
|
||||
let link = args.link;
|
||||
|
||||
if (link.includes("http") || link.includes("www")) {
|
||||
message.channel.send('Downloading <a:loadingmin:527579785212329984>').then(msg => {
|
||||
video.on('end', function () {
|
||||
msg.delete()
|
||||
});
|
||||
});
|
||||
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.")
|
||||
});
|
||||
video.on('end', function () {
|
||||
message.delete();
|
||||
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");
|
||||
}
|
||||
}
|
||||
if (link.includes('http') || link.includes('www')) {
|
||||
message.channel.send('Downloading <a:loadingmin:527579785212329984>').then(msg => {
|
||||
video.on('end', function () {
|
||||
msg.delete();
|
||||
});
|
||||
});
|
||||
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.');
|
||||
});
|
||||
video.on('end', function () {
|
||||
message.delete();
|
||||
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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = DownloadCommand;
|
|
@ -2,32 +2,32 @@ const { Command } = require('discord-akairo');
|
|||
const { feedbackChannel } = require('../../config.json');
|
||||
|
||||
class FeedbackCommand extends Command {
|
||||
constructor() {
|
||||
super('feedback', {
|
||||
aliases: ['feedback'],
|
||||
category: 'utility',
|
||||
split: 'none',
|
||||
args: [
|
||||
{
|
||||
id: "text",
|
||||
type: "string"
|
||||
}
|
||||
],
|
||||
description: {
|
||||
constructor() {
|
||||
super('feedback', {
|
||||
aliases: ['feedback'],
|
||||
category: 'utility',
|
||||
split: 'none',
|
||||
args: [
|
||||
{
|
||||
id: 'text',
|
||||
type: 'string'
|
||||
}
|
||||
],
|
||||
description: {
|
||||
content: 'Send feedback to the bot owner',
|
||||
usage: '[What do you want to say]',
|
||||
examples: ['Hello, i just wanted to say hi!']
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message,args) {
|
||||
let text = args.text;
|
||||
async exec(message,args) {
|
||||
let text = args.text;
|
||||
|
||||
const channel = this.client.channels.get(feedbackChannel);
|
||||
channel.send(`from ${message.author.username} (${message.author.id}) : ${text}`);
|
||||
message.channel.send('Your feedback has been sent!');
|
||||
}
|
||||
const channel = this.client.channels.get(feedbackChannel);
|
||||
channel.send(`from ${message.author.username} (${message.author.id}) : ${text}`);
|
||||
message.channel.send('Your feedback has been sent!');
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = FeedbackCommand;
|
|
@ -2,22 +2,22 @@ const { Command } = require('discord-akairo');
|
|||
const { supportServer } = require('../../config.json');
|
||||
|
||||
class InviteCommand extends Command {
|
||||
constructor() {
|
||||
super('invite', {
|
||||
aliases: ['invite'],
|
||||
category: 'utility',
|
||||
description: {
|
||||
constructor() {
|
||||
super('invite', {
|
||||
aliases: ['invite'],
|
||||
category: 'utility',
|
||||
description: {
|
||||
content: 'Send invite link for the bot and support server',
|
||||
usage: '',
|
||||
examples: ['']
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message) {
|
||||
message.channel.send('Check your dm')
|
||||
return message.author.send(`You can add me from here: https://discordapp.com/oauth2/authorize?client_id=${this.client.user.id}&scope=bot&permissions=0\nYou can also join my support server over here: ${supportServer} come and say hi :)`);
|
||||
}
|
||||
async exec(message) {
|
||||
message.channel.send('Check your dm')
|
||||
return message.author.send(`You can add me from here: https://discordapp.com/oauth2/authorize?client_id=${this.client.user.id}&scope=bot&permissions=0\nYou can also join my support server over here: ${supportServer} come and say hi :)`);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = InviteCommand;
|
|
@ -1,25 +1,25 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
|
||||
class PingCommand extends Command {
|
||||
constructor() {
|
||||
super('ping', {
|
||||
aliases: ['ping', 'hello'],
|
||||
category: 'utility',
|
||||
description: {
|
||||
constructor() {
|
||||
super('ping', {
|
||||
aliases: ['ping', 'hello'],
|
||||
category: 'utility',
|
||||
description: {
|
||||
content: 'Ping the bot',
|
||||
usage: '',
|
||||
examples: ['']
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message) {
|
||||
return message.util.reply('Pong!').then(sent => {
|
||||
const timeDiff = (sent.editedAt || sent.createdAt) - (message.editedAt || message.createdAt);
|
||||
const text = `🔂\u2000**RTT**: ${timeDiff} ms\n💟\u2000**Heartbeat**: ${Math.round(this.client.ping)} ms`;
|
||||
return message.util.reply(`Pong!\n${text}`);
|
||||
});
|
||||
}
|
||||
async exec(message) {
|
||||
return message.util.reply('Pong!').then(sent => {
|
||||
const timeDiff = (sent.editedAt || sent.createdAt) - (message.editedAt || message.createdAt);
|
||||
const text = `🔂\u2000**RTT**: ${timeDiff} ms\n💟\u2000**Heartbeat**: ${Math.round(this.client.ping)} ms`;
|
||||
return message.util.reply(`Pong!\n${text}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = PingCommand;
|
|
@ -1,39 +1,36 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
|
||||
class ServerCommand extends Command {
|
||||
constructor() {
|
||||
super('server', {
|
||||
aliases: ['server', 'serverinfo'],
|
||||
category: 'utility',
|
||||
channelRestriction: 'guild',
|
||||
description: {
|
||||
constructor() {
|
||||
super('server', {
|
||||
aliases: ['server', 'serverinfo'],
|
||||
category: 'utility',
|
||||
channelRestriction: 'guild',
|
||||
description: {
|
||||
content: 'Show info about the server',
|
||||
usage: '',
|
||||
examples: ['']
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message) {
|
||||
try {
|
||||
const customresponse = require(`../tag/${message.guild.id}.json`);
|
||||
var count = Object.keys(customresponse).length
|
||||
} catch {
|
||||
var count = 'None'
|
||||
}
|
||||
async exec(message) {
|
||||
const customresponse = require(`../tag/${message.guild.id}.json`);
|
||||
var count = Object.keys(customresponse).length;
|
||||
|
||||
|
||||
const addEmbed = {
|
||||
color: 0x0099ff,
|
||||
title: 'Stats of the server',
|
||||
thumbnail: {
|
||||
url: `${message.guild.iconURL}`,
|
||||
},
|
||||
description: `Member: **${message.guild.memberCount}** \nChannel number: **${message.guild.channels.size}**\nGuild created at **${message.guild.createdAt}**\nOwner: **${message.guild.owner}**\nTag number: **${count}**`,
|
||||
};
|
||||
|
||||
message.channel.send({ embed: addEmbed });
|
||||
}
|
||||
const addEmbed = {
|
||||
color: 0x0099ff,
|
||||
title: 'Stats of the server',
|
||||
thumbnail: {
|
||||
url: `${message.guild.iconURL}`,
|
||||
},
|
||||
description: `Member: **${message.guild.memberCount}** \nChannel number: **${message.guild.channels.size}**\nGuild created at **${message.guild.createdAt}**\nOwner: **${message.guild.owner}**\nTag number: **${count}**`,
|
||||
};
|
||||
|
||||
message.channel.send({ embed: addEmbed });
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ServerCommand;
|
|
@ -1,28 +1,28 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
|
||||
class StatsCommand extends Command {
|
||||
constructor() {
|
||||
super('stats', {
|
||||
aliases: ['stats'],
|
||||
category: 'utility',
|
||||
description: {
|
||||
constructor() {
|
||||
super('stats', {
|
||||
aliases: ['stats'],
|
||||
category: 'utility',
|
||||
description: {
|
||||
content: 'Show some stats about the bot',
|
||||
usage: '',
|
||||
examples: ['']
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message) {
|
||||
let totalSeconds = (this.client.uptime / 1000);
|
||||
let days = Math.floor(totalSeconds / 86400);
|
||||
let hours = Math.floor(totalSeconds / 3600);
|
||||
totalSeconds %= 3600;
|
||||
let minutes = Math.floor(totalSeconds / 60);
|
||||
let seconds = totalSeconds.toFixed(0) % 60;
|
||||
let uptime = `${days} days, ${hours} hours, ${minutes} minutes and ${seconds} seconds`;
|
||||
return message.channel.send(`Servers: \`${this.client.guilds.size}\`\nChannels: \`${this.client.channels.size}\`\nUsers: \`${this.client.users.size}\`\nBot uptime: \`${uptime}\``);
|
||||
}
|
||||
async exec(message) {
|
||||
let totalSeconds = (this.client.uptime / 1000);
|
||||
let days = Math.floor(totalSeconds / 86400);
|
||||
let hours = Math.floor(totalSeconds / 3600);
|
||||
totalSeconds %= 3600;
|
||||
let minutes = Math.floor(totalSeconds / 60);
|
||||
let seconds = totalSeconds.toFixed(0) % 60;
|
||||
let uptime = `${days} days, ${hours} hours, ${minutes} minutes and ${seconds} seconds`;
|
||||
return message.channel.send(`Servers: \`${this.client.guilds.size}\`\nChannels: \`${this.client.channels.size}\`\nUsers: \`${this.client.users.size}\`\nBot uptime: \`${uptime}\``);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = StatsCommand;
|
|
@ -4,50 +4,44 @@ const reload = require('auto-reload');
|
|||
const fs = require('fs');
|
||||
|
||||
class taglistCommand extends Command {
|
||||
constructor() {
|
||||
super('taglist', {
|
||||
aliases: ['taglist'],
|
||||
category: 'utility',
|
||||
channelRestriction: 'guild',
|
||||
description: {
|
||||
content: 'Show the list of tag for this server.',
|
||||
usage: '',
|
||||
examples: ['']
|
||||
}
|
||||
});
|
||||
}
|
||||
constructor() {
|
||||
super('taglist', {
|
||||
aliases: ['taglist'],
|
||||
category: 'utility',
|
||||
channelRestriction: 'guild',
|
||||
description: {
|
||||
content: 'Show the list of tag for this server.',
|
||||
usage: '',
|
||||
examples: ['']
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message) {
|
||||
try {
|
||||
let customresponse = reload(`../../tag/${message.guild.id}.json`);
|
||||
let count = Object.keys(customresponse).length
|
||||
async exec(message) {
|
||||
let customresponse = reload(`../../tag/${message.guild.id}.json`);
|
||||
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')
|
||||
const tagEmbed = new Discord.RichEmbed()
|
||||
.setColor("#ff9900")
|
||||
.setTitle('Tags list')
|
||||
.setDescription(`Trigger:Response\n\n${json}`)
|
||||
.setFooter(`You have ${count} tags on this server`)
|
||||
await fs.readFile(`./tag/${message.guild.id}.json`, 'utf8', function readFileCallback(err, data) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
fs.close();
|
||||
return;
|
||||
}
|
||||
let json = JSON.stringify(data);
|
||||
json = json.replace(/[{}'\\]+/g, '');
|
||||
json = json.replace(/,+/g, '\n');
|
||||
const tagEmbed = new Discord.RichEmbed()
|
||||
.setColor('#ff9900')
|
||||
.setTitle('Tags list')
|
||||
.setDescription(`Trigger:Response\n\n${json}`)
|
||||
.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?');
|
||||
}
|
||||
}
|
||||
message.channel.send(tagEmbed);
|
||||
});
|
||||
fs.close();
|
||||
message.channel.send('An error has occured, do you have any tags on the server?');
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = taglistCommand;
|
|
@ -4,59 +4,58 @@ const fetch = require('node-fetch');
|
|||
const { yandexAPI } = require('../../config.json');
|
||||
|
||||
class TranslationCommand extends Command {
|
||||
constructor() {
|
||||
super('translation', {
|
||||
aliases: ['translation', 'trn'],
|
||||
category: 'utility',
|
||||
split: 'sticky',
|
||||
description: 'Translate the text you send into the lanuguage you selected',
|
||||
args: [
|
||||
{
|
||||
id: 'language',
|
||||
type: 'string',
|
||||
default: 'en'
|
||||
},
|
||||
{
|
||||
id: 'text',
|
||||
type: 'string',
|
||||
}
|
||||
],
|
||||
description: {
|
||||
content: 'Translate what you send in your desired language. You can find the language code here: https://tech.yandex.com/translate/doc/dg/concepts/api-overview-docpage/',
|
||||
usage: '[language code] [Text to translate]',
|
||||
examples: ['fr What are we doing today?', 'en Que faisons-nous aujourd\'hui?']
|
||||
}
|
||||
});
|
||||
}
|
||||
constructor() {
|
||||
super('translation', {
|
||||
aliases: ['translation', 'trn'],
|
||||
category: 'utility',
|
||||
split: 'sticky',
|
||||
args: [
|
||||
{
|
||||
id: 'language',
|
||||
type: 'string',
|
||||
default: 'en'
|
||||
},
|
||||
{
|
||||
id: 'text',
|
||||
type: 'string',
|
||||
}
|
||||
],
|
||||
description: {
|
||||
content: 'Translate what you send in your desired language. You can find the language code here: https://tech.yandex.com/translate/doc/dg/concepts/api-overview-docpage/',
|
||||
usage: '[language code] [Text to translate]',
|
||||
examples: ['fr What are we doing today?', 'en Que faisons-nous aujourd\'hui?']
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message, args) {
|
||||
let language = args.language;
|
||||
let text = args.text;
|
||||
async exec(message, args) {
|
||||
let language = args.language;
|
||||
let text = args.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/`)
|
||||
else if (response.code != '200')
|
||||
return message.channel.send('An error has occured')
|
||||
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/`);
|
||||
else if (response.code != '200')
|
||||
return message.channel.send('An error has occured');
|
||||
|
||||
|
||||
const translationEmbed = new Discord.RichEmbed()
|
||||
.setColor('#0099ff')
|
||||
.setTitle('Asked for the following translation:')
|
||||
.setAuthor(message.author.username)
|
||||
.setDescription(response.text[0])
|
||||
.addField('Original text', text)
|
||||
.addField('Translated from', response.detected.lang)
|
||||
.setTimestamp()
|
||||
.setFooter('Powered by Yandex.Translate ');
|
||||
const translationEmbed = new Discord.RichEmbed()
|
||||
.setColor('#0099ff')
|
||||
.setTitle('Asked for the following translation:')
|
||||
.setAuthor(message.author.username)
|
||||
.setDescription(response.text[0])
|
||||
.addField('Original text', text)
|
||||
.addField('Translated from', response.detected.lang)
|
||||
.setTimestamp()
|
||||
.setFooter('Powered by Yandex.Translate ');
|
||||
|
||||
message.channel.send(translationEmbed)
|
||||
});
|
||||
}
|
||||
message.channel.send(translationEmbed);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = TranslationCommand;
|
|
@ -1,34 +1,34 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
|
||||
class UpdootCommand extends Command {
|
||||
constructor() {
|
||||
super('updoot', {
|
||||
aliases: ['updoot', 'upvote', 'vote'],
|
||||
category: 'utility',
|
||||
channelRestriction: 'guild',
|
||||
description: {
|
||||
constructor() {
|
||||
super('updoot', {
|
||||
aliases: ['updoot', 'upvote', 'vote'],
|
||||
category: 'utility',
|
||||
channelRestriction: 'guild',
|
||||
description: {
|
||||
content: 'Send a link to vote for my bot',
|
||||
usage: '',
|
||||
examples: ['']
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message) {
|
||||
const upDoot = {
|
||||
color: 0x93C54B,
|
||||
title: 'Vote for my bot',
|
||||
url: 'https://discordbots.org/bot/377563711927484418/vote',
|
||||
description: 'You can vote for my bot if you think the bot is awesome!',
|
||||
timestamp: new Date(),
|
||||
footer: {
|
||||
text: 'Thanks for the updoots',
|
||||
icon_url: 'https://cdn.discordapp.com/avatars/377563711927484418/1335d202aa466dbeaa4ed2e4b616484a.png?size=2048',
|
||||
},
|
||||
};
|
||||
async exec(message) {
|
||||
const upDoot = {
|
||||
color: 0x93C54B,
|
||||
title: 'Vote for my bot',
|
||||
url: 'https://discordbots.org/bot/377563711927484418/vote',
|
||||
description: 'You can vote for my bot if you think the bot is awesome!',
|
||||
timestamp: new Date(),
|
||||
footer: {
|
||||
text: 'Thanks for the updoots',
|
||||
icon_url: 'https://cdn.discordapp.com/avatars/377563711927484418/1335d202aa466dbeaa4ed2e4b616484a.png?size=2048',
|
||||
},
|
||||
};
|
||||
|
||||
message.channel.send({ embed: upDoot });
|
||||
}
|
||||
message.channel.send({ embed: upDoot });
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = UpdootCommand;
|
|
@ -1,12 +1,12 @@
|
|||
module.exports = {
|
||||
a: '<a:a:493014525226778624>', b: '<a:b:493014525696802817>', c: '<a:c:493014525457596417>', d: '<a:d:493014526791254026>',
|
||||
e: '<a:e:493014525373710339>', f: '<a:f:493014525788946443>', g: '<a:g:493014525151543297>', h: '<a:h:493014525256138763>',
|
||||
i: '<a:i:493014525566648321>', j: '<a:j:493014525738614806>', k: '<a:k:493014525336092673>', l: '<a:l:493014525134635039>',
|
||||
m: '<a:m:493014525927227392>', n: '<a:n:493014525746872323>', o: '<a:o:493014525847797761>', p: '<a:p:493014525788815371>',
|
||||
q: '<a:q:493014525344219137>', r: '<a:r:493014525914775562>', s: '<a:s:493014525335961601>', t: '<a:t:493014525818306560>',
|
||||
u: '<a:u:493014525466116097>', v: '<a:v:493014525432561666>', w: '<a:w:493014525885546497>', x: '<a:x:493014525801660426>',
|
||||
y: '<a:y:493014525042360329>', z: '<a:z:493014525856055306>', 1: '<a:1:493096650160472065>', 2: '<a:2:493096650160603140>',
|
||||
3: '<a:3:493096650039099412>', 4: '<a:4:493096650005544960>', 5: '<a:5:493096650395353099>', 6: '<a:6:493096649908944906>',
|
||||
7: '<a:7:493096649833578508>', 8: '<a:8:493096650491822090>', 9: '<a:9:493096649619668993>', 0: '<a:0:493096650202546208>',
|
||||
' ': ' ', '?': '<a:question:493448821020426243>', '!': '<a:exclamation:493448903459471360>'
|
||||
a: '<a:a:493014525226778624>', b: '<a:b:493014525696802817>', c: '<a:c:493014525457596417>', d: '<a:d:493014526791254026>',
|
||||
e: '<a:e:493014525373710339>', f: '<a:f:493014525788946443>', g: '<a:g:493014525151543297>', h: '<a:h:493014525256138763>',
|
||||
i: '<a:i:493014525566648321>', j: '<a:j:493014525738614806>', k: '<a:k:493014525336092673>', l: '<a:l:493014525134635039>',
|
||||
m: '<a:m:493014525927227392>', n: '<a:n:493014525746872323>', o: '<a:o:493014525847797761>', p: '<a:p:493014525788815371>',
|
||||
q: '<a:q:493014525344219137>', r: '<a:r:493014525914775562>', s: '<a:s:493014525335961601>', t: '<a:t:493014525818306560>',
|
||||
u: '<a:u:493014525466116097>', v: '<a:v:493014525432561666>', w: '<a:w:493014525885546497>', x: '<a:x:493014525801660426>',
|
||||
y: '<a:y:493014525042360329>', z: '<a:z:493014525856055306>', 1: '<a:1:493096650160472065>', 2: '<a:2:493096650160603140>',
|
||||
3: '<a:3:493096650039099412>', 4: '<a:4:493096650005544960>', 5: '<a:5:493096650395353099>', 6: '<a:6:493096649908944906>',
|
||||
7: '<a:7:493096649833578508>', 8: '<a:8:493096650491822090>', 9: '<a:9:493096649619668993>', 0: '<a:0:493096650202546208>',
|
||||
' ': ' ', '?': '<a:question:493448821020426243>', '!': '<a:exclamation:493448903459471360>'
|
||||
};
|
45
index.js
45
index.js
|
@ -2,33 +2,32 @@ const { AkairoClient } = require('discord-akairo');
|
|||
const { token, prefix, ownerID, statsChannel } = require('./config.json');
|
||||
|
||||
const client = new AkairoClient({
|
||||
ownerID: ownerID,
|
||||
prefix: prefix,
|
||||
allowMention: true,
|
||||
handleEdits: true,
|
||||
emitters: {
|
||||
process
|
||||
},
|
||||
handleEdits: true,
|
||||
commandUtil: true,
|
||||
commandUtilLifetime: 600000,
|
||||
commandDirectory: './commands/',
|
||||
inhibitorDirectory: './inhibitors/',
|
||||
listenerDirectory: './listeners/'
|
||||
ownerID: ownerID,
|
||||
prefix: prefix,
|
||||
allowMention: true,
|
||||
handleEdits: true,
|
||||
emitters: {
|
||||
process
|
||||
},
|
||||
commandUtil: true,
|
||||
commandUtilLifetime: 600000,
|
||||
commandDirectory: './commands/',
|
||||
inhibitorDirectory: './inhibitors/',
|
||||
listenerDirectory: './listeners/'
|
||||
}, {
|
||||
disableEveryone: true
|
||||
disableEveryone: true
|
||||
});
|
||||
|
||||
// Ready messages dosent work on the listeners event for some reasons
|
||||
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
|
||||
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}`);
|
||||
client.user.setActivity(`${prefix} feedback <feedback> to tell me what you think of the bot! | ${prefix} help`); }
|
||||
});
|
||||
// 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
|
||||
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}`);
|
||||
client.user.setActivity(`${prefix} feedback <feedback> to tell me what you think of the bot! | ${prefix} help`); }
|
||||
});
|
||||
|
||||
client.login(token);
|
|
@ -1,16 +1,16 @@
|
|||
const { Inhibitor } = require('discord-akairo');
|
||||
|
||||
class BlacklistInhibitor extends Inhibitor {
|
||||
constructor() {
|
||||
super('blacklist', {
|
||||
reason: 'blacklist'
|
||||
})
|
||||
}
|
||||
constructor() {
|
||||
super('blacklist', {
|
||||
reason: 'blacklist'
|
||||
});
|
||||
}
|
||||
|
||||
exec(message) {
|
||||
const blacklist = ['501856229123948545', '497730155691638784'];
|
||||
return blacklist.includes(message.author.id);
|
||||
}
|
||||
exec(message) {
|
||||
const blacklist = ['501856229123948545', '497730155691638784'];
|
||||
return blacklist.includes(message.author.id);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = BlacklistInhibitor;
|
|
@ -1,16 +1,16 @@
|
|||
const { Listener } = require('discord-akairo');
|
||||
|
||||
class UnhandledRejectionListener extends Listener {
|
||||
constructor() {
|
||||
super('unhandledRejection', {
|
||||
eventName: 'unhandledRejection',
|
||||
emitter: 'process'
|
||||
});
|
||||
}
|
||||
constructor() {
|
||||
super('unhandledRejection', {
|
||||
eventName: 'unhandledRejection',
|
||||
emitter: 'process'
|
||||
});
|
||||
}
|
||||
|
||||
exec(error) {
|
||||
console.error(error);
|
||||
}
|
||||
exec(error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = UnhandledRejectionListener;
|
|
@ -1,33 +1,34 @@
|
|||
const { Listener } = require('discord-akairo');
|
||||
|
||||
class CommandBlockedListener extends Listener {
|
||||
constructor() {
|
||||
super('commandBlocked', {
|
||||
emitter: 'commandHandler',
|
||||
eventName: 'commandBlocked'
|
||||
});
|
||||
}
|
||||
constructor() {
|
||||
super('commandBlocked', {
|
||||
emitter: 'commandHandler',
|
||||
eventName: 'commandBlocked'
|
||||
});
|
||||
}
|
||||
|
||||
exec(message, command, reason) {
|
||||
console.log(`${message.author.username} was blocked from using ${command.id} because of ${reason}!`);
|
||||
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 )];
|
||||
message.reply(ownerMessage);
|
||||
break;
|
||||
case "clientPermissions":
|
||||
message.reply('Im missing the required permissions for this command!');
|
||||
break;
|
||||
case "userPermissions":
|
||||
message.reply('You are missing some permissions to use this command!');
|
||||
break;
|
||||
case "blacklist":
|
||||
message.reply('You can\'t use this command because you have been blacklisted!');
|
||||
break;
|
||||
exec(message, command, reason) {
|
||||
console.log(`${message.author.username} was blocked from using ${command.id} because of ${reason}!`);
|
||||
let ownerMessage;
|
||||
switch(reason) {
|
||||
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':
|
||||
message.reply('Im missing the required permissions for this command!');
|
||||
break;
|
||||
case 'userPermissions':
|
||||
message.reply('You are missing some permissions to use this command!');
|
||||
break;
|
||||
case 'blacklist':
|
||||
message.reply('You can\'t use this command because you have been blacklisted!');
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = CommandBlockedListener;
|
|
@ -4,25 +4,25 @@ const { statsChannel } = require('../config.json');
|
|||
|
||||
|
||||
class guildCreateListener extends Listener {
|
||||
constructor() {
|
||||
super('guildCreate', {
|
||||
emitter: 'client',
|
||||
eventName: 'guildCreate'
|
||||
});
|
||||
}
|
||||
constructor() {
|
||||
super('guildCreate', {
|
||||
emitter: 'client',
|
||||
eventName: 'guildCreate'
|
||||
});
|
||||
}
|
||||
|
||||
async exec(guild, client) {
|
||||
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")
|
||||
.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()
|
||||
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')
|
||||
.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();
|
||||
|
||||
channel.send({ embed: addEmbed });
|
||||
}
|
||||
channel.send({ embed: addEmbed });
|
||||
}
|
||||
}
|
||||
module.exports = guildCreateListener;
|
|
@ -4,28 +4,28 @@ const { statsChannel } = require('../config.json');
|
|||
|
||||
|
||||
class guildCreateListener extends Listener {
|
||||
constructor() {
|
||||
super('guildDelete', {
|
||||
emitter: 'client',
|
||||
eventName: 'guildDelete'
|
||||
});
|
||||
}
|
||||
constructor() {
|
||||
super('guildDelete', {
|
||||
emitter: 'client',
|
||||
eventName: 'guildDelete'
|
||||
});
|
||||
}
|
||||
|
||||
async exec(guild, client) {
|
||||
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);
|
||||
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")
|
||||
.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()
|
||||
const kickEmbed = new Discord.RichEmbed()
|
||||
.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();
|
||||
|
||||
channel.send({ embed: kickEmbed });
|
||||
console.log('***BOT KICKED***')
|
||||
}
|
||||
channel.send({ embed: kickEmbed });
|
||||
console.log('***BOT KICKED***');
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = guildCreateListener;
|
|
@ -5,48 +5,48 @@ const imgResponseObject = require("../json/imgreply.json");
|
|||
const reload = require('auto-reload');
|
||||
|
||||
class MessageListener extends Listener {
|
||||
constructor() {
|
||||
super('message', {
|
||||
emitter: 'client',
|
||||
eventName: 'message'
|
||||
});
|
||||
}
|
||||
constructor() {
|
||||
super('message', {
|
||||
emitter: 'client',
|
||||
eventName: 'message'
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message) {
|
||||
let autoresponse = reload('../json/autoresponse.json');
|
||||
let message_content = message.content.toLowerCase();
|
||||
async exec(message) {
|
||||
let autoresponse = reload('../json/autoresponse.json');
|
||||
let message_content = message.content.toLowerCase();
|
||||
|
||||
if (message.author.bot) return; {
|
||||
if (message.author.bot) return; {
|
||||
|
||||
// If autoresponse is enable send the response
|
||||
if(autoresponse[message.channel.id] == 'enable') {
|
||||
// Reply with images as attachement
|
||||
if(imgResponseObject[message_content]) {
|
||||
message.channel.send({files: [imgResponseObject[message_content]]});
|
||||
}
|
||||
// React only to the messages
|
||||
else if(reactObject[message_content]) {
|
||||
message.react(reactObject[message_content]);
|
||||
}
|
||||
// auto respond to messages
|
||||
else if(responseObject[message_content]) {
|
||||
message.channel.send(responseObject[message_content]);
|
||||
// If it contain "like if" react with 👍
|
||||
} else if (message_content.includes("like if")) {
|
||||
message.react("\u{1F44D}")
|
||||
// If it contain "jeff" react with a jeff emote
|
||||
} else if (message_content.includes("jeff")) {
|
||||
message.react("496028845967802378")
|
||||
}
|
||||
}
|
||||
let customresponse = reload(`../tag/${message.guild.id}.json`);
|
||||
// User autoresponse
|
||||
if(customresponse[message_content]) {
|
||||
message.channel.send(customresponse[message_content])
|
||||
}
|
||||
// If autoresponse is enable send the response
|
||||
if(autoresponse[message.channel.id] == 'enable') {
|
||||
// Reply with images as attachement
|
||||
if(imgResponseObject[message_content]) {
|
||||
message.channel.send({files: [imgResponseObject[message_content]]});
|
||||
}
|
||||
// React only to the messages
|
||||
else if(reactObject[message_content]) {
|
||||
message.react(reactObject[message_content]);
|
||||
}
|
||||
// auto respond to messages
|
||||
else if(responseObject[message_content]) {
|
||||
message.channel.send(responseObject[message_content]);
|
||||
// If it contain "like if" react with 👍
|
||||
} else if (message_content.includes("like if")) {
|
||||
message.react("\u{1F44D}")
|
||||
// If it contain "jeff" react with a jeff emote
|
||||
} else if (message_content.includes("jeff")) {
|
||||
message.react("496028845967802378")
|
||||
}
|
||||
}
|
||||
let customresponse = reload(`../tag/${message.guild.id}.json`);
|
||||
// User autoresponse
|
||||
if(customresponse[message_content]) {
|
||||
message.channel.send(customresponse[message_content])
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = MessageListener;
|
|
@ -3,49 +3,49 @@ const Discord = require('discord.js');
|
|||
const reload = require('auto-reload');
|
||||
|
||||
class MessageReactionAddListener extends Listener {
|
||||
constructor() {
|
||||
super('messagereactionadd', {
|
||||
emitter: 'client',
|
||||
eventName: 'messageReactionAdd'
|
||||
});
|
||||
}
|
||||
constructor() {
|
||||
super('messagereactionadd', {
|
||||
emitter: 'client',
|
||||
eventName: 'messageReactionAdd'
|
||||
});
|
||||
}
|
||||
|
||||
async exec(reaction, message, client) {
|
||||
let messageContent = reaction.message.content;
|
||||
let messageAttachments = reaction.message.attachments.map(u=> `${u.url}`);
|
||||
async exec(reaction, message, client) {
|
||||
let messageContent = reaction.message.content;
|
||||
let messageAttachments = reaction.message.attachments.map(u=> `${u.url}`);
|
||||
|
||||
if (reaction.emoji.name === '🌟' && reaction.count === 4) {
|
||||
let starboardChannel = reload(`../starboard/${reaction.message.guild.id}.json`);
|
||||
const channel = this.client.channels.get(starboardChannel['starboard']);
|
||||
if (reaction.emoji.name === '🌟' && reaction.count === 4) {
|
||||
let starboardChannel = reload(`../starboard/${reaction.message.guild.id}.json`);
|
||||
const channel = this.client.channels.get(starboardChannel['starboard']);
|
||||
|
||||
const starEmbed = new Discord.RichEmbed()
|
||||
.setColor()
|
||||
.setDescription(messageContent)
|
||||
.setAuthor(reaction.message.author.username, reaction.message.author.displayAvatarURL)
|
||||
.setTimestamp()
|
||||
const starEmbed = new Discord.RichEmbed()
|
||||
.setColor()
|
||||
.setDescription(messageContent)
|
||||
.setAuthor(reaction.message.author.username, reaction.message.author.displayAvatarURL)
|
||||
.setTimestamp()
|
||||
|
||||
channel.send({ embed: starEmbed});
|
||||
return channel.send(`From: ${reaction.message.channel}\n${messageAttachments}`);
|
||||
}
|
||||
if (reaction.emoji.name === '✡' && reaction.count === 4) {
|
||||
let shameboardChannel = reload(`../starboard/${message.guild.id}.json`);
|
||||
const channel = client.channels.get(shameboardChannel['shameboard']);
|
||||
channel.send({ embed: starEmbed});
|
||||
return channel.send(`From: ${reaction.message.channel}\n${messageAttachments}`);
|
||||
}
|
||||
if (reaction.emoji.name === '✡' && reaction.count === 4) {
|
||||
let shameboardChannel = reload(`../starboard/${message.guild.id}.json`);
|
||||
const channel = client.channels.get(shameboardChannel['shameboard']);
|
||||
|
||||
const starEmbed = new Discord.RichEmbed()
|
||||
.setColor()
|
||||
.setDescription(messageContent)
|
||||
.setAuthor(reaction.message.author.username, reaction.message.author.displayAvatarURL)
|
||||
.setTimestamp()
|
||||
const starEmbed = new Discord.RichEmbed()
|
||||
.setColor()
|
||||
.setDescription(messageContent)
|
||||
.setAuthor(reaction.message.author.username, reaction.message.author.displayAvatarURL)
|
||||
.setTimestamp()
|
||||
|
||||
try {
|
||||
channel.send({ embed: starEmbed});
|
||||
await channel.send(messageAttachments);
|
||||
} catch(err) {
|
||||
console.error('There is no shameboard');
|
||||
}
|
||||
}
|
||||
try {
|
||||
channel.send({ embed: starEmbed});
|
||||
await channel.send(messageAttachments);
|
||||
} catch(err) {
|
||||
console.error('There is no shameboard');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = MessageReactionAddListener;
|
Loading…
Reference in a new issue