am dumb
This commit is contained in:
parent
30a1644d10
commit
314c1847ed
|
@ -1,12 +1,5 @@
|
||||||
const express = require('express');
|
const express = require('express');
|
||||||
const {
|
const { hostname, port, authorization, source, invite, type } = require('../config');
|
||||||
hostname,
|
|
||||||
port,
|
|
||||||
authorization,
|
|
||||||
source,
|
|
||||||
invite,
|
|
||||||
type
|
|
||||||
} = require('../config');
|
|
||||||
const db = require('quick.db');
|
const db = require('quick.db');
|
||||||
const Backend = new db.table('backend');
|
const Backend = new db.table('backend');
|
||||||
const chalk = require('chalk');
|
const chalk = require('chalk');
|
||||||
|
@ -33,9 +26,11 @@ app.set('view options', {
|
||||||
});
|
});
|
||||||
|
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
app.use(express.urlencoded({
|
app.use(
|
||||||
extended: true
|
express.urlencoded({
|
||||||
}));
|
extended: true
|
||||||
|
})
|
||||||
|
);
|
||||||
app.use(helmet());
|
app.use(helmet());
|
||||||
app.use(compression());
|
app.use(compression());
|
||||||
app.use(cors());
|
app.use(cors());
|
||||||
|
@ -52,7 +47,7 @@ app.use(
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
app.use('/api', require(''))
|
app.use('/api', require('./routes/api'));
|
||||||
let support = 'https://discord.gg/' + Backend.get('Info.invite');
|
let support = 'https://discord.gg/' + Backend.get('Info.invite');
|
||||||
module.exports = (client) => {
|
module.exports = (client) => {
|
||||||
app.get('/', async (req, res) => {
|
app.get('/', async (req, res) => {
|
||||||
|
@ -105,4 +100,4 @@ module.exports = (client) => {
|
||||||
console.log(`Listening on ${hostname}:${port}`);
|
console.log(`Listening on ${hostname}:${port}`);
|
||||||
}, 1000 * 3);
|
}, 1000 * 3);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const { Collection } = require('discord.js');
|
const { Collection, MessageEmbed } = require('discord.js');
|
||||||
const { table } = require('quick.db');
|
const { table } = require('quick.db');
|
||||||
const Servers = new table('servers');
|
const Servers = new table('servers');
|
||||||
const Users = new table('users');
|
const Users = new table('users');
|
||||||
|
@ -58,8 +58,9 @@ module.exports = {
|
||||||
if (cmd.nsfw && !ctx.channel.nsfw)
|
if (cmd.nsfw && !ctx.channel.nsfw)
|
||||||
return ctx.send('This channel is not marked as NSFW, please mark it as such and rerun this command.');
|
return ctx.send('This channel is not marked as NSFW, please mark it as such and rerun this command.');
|
||||||
if (cmd.developerOnly && !client.config.developers.find((dev) => msg.author.id == dev.id)) return;
|
if (cmd.developerOnly && !client.config.developers.find((dev) => msg.author.id == dev.id)) return;
|
||||||
if (cmd.AuthorPermissions !== 'NONE' && !ctx.member.permissions.has(cmd.AuthorPermissions))
|
if (cmd.AuthorPermissions !== 'NONE' && !ctx.member.permissions.has(cmd.AuthorPermissions)) {
|
||||||
return ctx.send(`You need \`${cmd.AuthorPermissions}\` Permission(s) to run this Command`);
|
return ctx.send(`You need \`${cmd.AuthorPermissions}\` Permission(s) to run this Command`);
|
||||||
|
}
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
const timestamps = client.cooldowns.get(cmd.name);
|
const timestamps = client.cooldowns.get(cmd.name);
|
||||||
const cooldownAmount = (cmd.cooldown || 1) * 1000;
|
const cooldownAmount = (cmd.cooldown || 1) * 1000;
|
||||||
|
@ -68,14 +69,16 @@ module.exports = {
|
||||||
const expirationTime = timestamps.get(msg.author.id) + cooldownAmount;
|
const expirationTime = timestamps.get(msg.author.id) + cooldownAmount;
|
||||||
|
|
||||||
if (now < expirationTime) {
|
if (now < expirationTime) {
|
||||||
|
let CooldownEmb = new MessageEmbed();
|
||||||
const timeLeft = (expirationTime - now) / 1000;
|
const timeLeft = (expirationTime - now) / 1000;
|
||||||
return ctx.send(
|
CooldownEmb.setTitle(`${cmd.name} is on cooldown`).setDescription(
|
||||||
`\`${cmd.name}\` has a cooldown of \`${cmd.cooldown} second${cmd.cooldown > 1
|
`\`${cmd.name}\` has a cooldown of \`${cmd.cooldown} second${cmd.cooldown > 1
|
||||||
? 's'
|
? 's'
|
||||||
: ''}\`, wait \`${`${Math.round(timeLeft)} second${Math.round(timeLeft) > 1
|
: ''}\`\n Wait \`${`${Math.round(timeLeft)} second${Math.round(timeLeft) > 1
|
||||||
? 's'
|
? 's'
|
||||||
: ''}`.replace('0 second', 'just a second longer')}\` before trying to use it again.`
|
: ''}`.replace('0 second', 'just a second longer')}\` before trying to use it again.`
|
||||||
);
|
);
|
||||||
|
return ctx.send(CooldownEmb);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
timestamps.set(msg.author.id, now);
|
timestamps.set(msg.author.id, now);
|
||||||
|
|
|
@ -23,13 +23,18 @@ module.exports = class Hug extends Command {
|
||||||
if (ctx.msg.mentions.members.first().id === ctx.author.id)
|
if (ctx.msg.mentions.members.first().id === ctx.author.id)
|
||||||
return ctx.send(`Don't you want to hug someone other than yourself?`);
|
return ctx.send(`Don't you want to hug someone other than yourself?`);
|
||||||
|
|
||||||
const LineFromUtils = ctx.utils.int.hug[parseInt(Math.random() * ctx.utils.int.hug.length)];
|
|
||||||
let Line = LineFromUtils.replace(/0/g, ctx.utils.format.bold(ctx.author.username)).replace(
|
|
||||||
/1/g,
|
|
||||||
ctx.utils.format.bold(ctx.msg.mentions.members.first().user.username)
|
|
||||||
);
|
|
||||||
|
|
||||||
const Server = await ctx.db.servers.get(ctx.guild.id);
|
const Server = await ctx.db.servers.get(ctx.guild.id);
|
||||||
|
let Line;
|
||||||
|
if (Server === null) {
|
||||||
|
const LineFromUtils = ctx.utils.int.hug[parseInt(Math.random() * ctx.utils.int.hug.length)];
|
||||||
|
Line = LineFromUtils.replace(/0/g, ctx.utils.format.bold(ctx.author.username)).replace(
|
||||||
|
/1/g,
|
||||||
|
ctx.utils.format.bold(ctx.msg.mentions.members.first().user.username)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
Line = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
let Settings;
|
let Settings;
|
||||||
if (Server === null) {
|
if (Server === null) {
|
||||||
Settings = ctx.utils.db.defaults.server;
|
Settings = ctx.utils.db.defaults.server;
|
||||||
|
@ -43,11 +48,17 @@ module.exports = class Hug extends Command {
|
||||||
if (Settings.embeds) {
|
if (Settings.embeds) {
|
||||||
Message = new MessageEmbed()
|
Message = new MessageEmbed()
|
||||||
.setColor(ctx.config.color)
|
.setColor(ctx.config.color)
|
||||||
.setDescription(Line)
|
|
||||||
.setImage(req)
|
.setImage(req)
|
||||||
.setFooter(`${ctx.client.user.username} - Provided by furry.bot`, ctx.client.user.avatarURL());
|
.setFooter(`${ctx.client.user.username} - Provided by furry.bot`, ctx.client.user.avatarURL());
|
||||||
|
if (Line) {
|
||||||
|
Message.setDescription(Line);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Message = `${req}`;
|
if (Line) {
|
||||||
|
Message = `${Line}\n${req}`;
|
||||||
|
} else {
|
||||||
|
Message = `${req}`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ctx.send(Message);
|
ctx.send(Message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,11 +48,17 @@ module.exports = class Kiss extends Command {
|
||||||
if (Settings.embeds) {
|
if (Settings.embeds) {
|
||||||
Message = new MessageEmbed()
|
Message = new MessageEmbed()
|
||||||
.setColor(ctx.config.color)
|
.setColor(ctx.config.color)
|
||||||
.setDescription(Line)
|
|
||||||
.setImage(req)
|
.setImage(req)
|
||||||
.setFooter(`${ctx.client.user.username} - Provided by furry.bot`, ctx.client.user.avatarURL());
|
.setFooter(`${ctx.client.user.username} - Provided by furry.bot`, ctx.client.user.avatarURL());
|
||||||
|
if (Line) {
|
||||||
|
Message.setDescription(Line);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Message = `${req}`;
|
if (Line) {
|
||||||
|
Message = `${Line}\n${req}`;
|
||||||
|
} else {
|
||||||
|
Message = `${req}`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ctx.send(Message);
|
ctx.send(Message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,8 @@ module.exports = class nKiss extends Command {
|
||||||
return ctx.send("Don't kiss me! Kiss someone else!");
|
return ctx.send("Don't kiss me! Kiss someone else!");
|
||||||
if (ctx.msg.mentions.members.first().id === ctx.author.id)
|
if (ctx.msg.mentions.members.first().id === ctx.author.id)
|
||||||
return ctx.send(`Don't you want to kiss someone other than yourself?`);
|
return ctx.send(`Don't you want to kiss someone other than yourself?`);
|
||||||
|
const Server = await ctx.db.servers.get(ctx.guild.id);
|
||||||
|
let Line;
|
||||||
if (Server.rp_text) {
|
if (Server.rp_text) {
|
||||||
const LineFromUtils = ctx.utils.int.kiss[parseInt(Math.random() * ctx.utils.int.kiss.length)];
|
const LineFromUtils = ctx.utils.int.kiss[parseInt(Math.random() * ctx.utils.int.kiss.length)];
|
||||||
Line = LineFromUtils.replace(/0/g, ctx.utils.format.bold(ctx.author.username)).replace(
|
Line = LineFromUtils.replace(/0/g, ctx.utils.format.bold(ctx.author.username)).replace(
|
||||||
|
@ -33,7 +34,6 @@ module.exports = class nKiss extends Command {
|
||||||
Line = undefined;
|
Line = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Server = await ctx.db.servers.get(ctx.guild.id);
|
|
||||||
let Settings;
|
let Settings;
|
||||||
if (Server === null) {
|
if (Server === null) {
|
||||||
Settings = ctx.utils.db.defaults.server;
|
Settings = ctx.utils.db.defaults.server;
|
||||||
|
|
|
@ -8,7 +8,8 @@ module.exports = class Prefix extends Command {
|
||||||
module: 'Settings',
|
module: 'Settings',
|
||||||
cooldown: 10,
|
cooldown: 10,
|
||||||
guildOnly: true,
|
guildOnly: true,
|
||||||
developerOnly: false
|
developerOnly: false,
|
||||||
|
AuthorPermissions: [ 'MANAGE_GUILD' ]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +33,7 @@ module.exports = class Prefix extends Command {
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
let NServer = await ctx.db.servers.get(ctx.guild.id);
|
let NServer = await ctx.db.servers.get(ctx.guild.id);
|
||||||
PrefixEmbed.setTitle(`Prefixes for ${ctx.guild.name}`);
|
PrefixEmbed.setTitle(`Prefixes for ${ctx.guild.name}`);
|
||||||
PrefixEmbed.setDescription(`${NServer.prefix.join(', ') || ctx.db.defaults.server.prefix}`);
|
PrefixEmbed.setDescription(`${NServer.prefix.join(' | ') || ctx.db.defaults.server.prefix}`);
|
||||||
ctx.send(PrefixEmbed);
|
ctx.send(PrefixEmbed);
|
||||||
})
|
})
|
||||||
.catch((err) => ctx.send(err));
|
.catch((err) => ctx.send(err));
|
||||||
|
@ -42,9 +43,11 @@ module.exports = class Prefix extends Command {
|
||||||
if (ctx.args === [] || ctx.args.join(' ').trim() === '') return ctx.send('No Prefix was given');
|
if (ctx.args === [] || ctx.args.join(' ').trim() === '') return ctx.send('No Prefix was given');
|
||||||
ctx.utils.db.prefix
|
ctx.utils.db.prefix
|
||||||
.remove(ctx, Prefix)
|
.remove(ctx, Prefix)
|
||||||
.then(async (r) => {
|
.then(async () => {
|
||||||
let NServer = await ctx.db.servers.get(ctx.guild.id);
|
let NServer = await ctx.db.servers.get(ctx.guild.id);
|
||||||
ctx.send('Current Prefixes are:\n' + NServer.prefix.join(', '));
|
PrefixEmbed.setTitle(`Prefixes for ${ctx.guild.name}`);
|
||||||
|
PrefixEmbed.setDescription(`${NServer.prefix.join(' | ') || ctx.db.defaults.server.prefix}`);
|
||||||
|
ctx.send(PrefixEmbed);
|
||||||
})
|
})
|
||||||
.catch((err) => ctx.send(err));
|
.catch((err) => ctx.send(err));
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -45,7 +45,7 @@ module.exports = {
|
||||||
return New;
|
return New;
|
||||||
},
|
},
|
||||||
remove: async function(ctx, Prefix) {
|
remove: async function(ctx, Prefix) {
|
||||||
if (prefixes.includes(Prefix)) {
|
if (DatabaseDefaults.server.prefix.includes(Prefix)) {
|
||||||
throw new Error('You cannot remove the Default Prefix(es)');
|
throw new Error('You cannot remove the Default Prefix(es)');
|
||||||
}
|
}
|
||||||
let Prefixes = ctx.db.servers.get(ctx.guild.id).prefix;
|
let Prefixes = ctx.db.servers.get(ctx.guild.id).prefix;
|
||||||
|
|
Loading…
Reference in New Issue