thaldrin/DiscordModules/Settings/settings.js
2019-11-10 09:42:09 +01:00

54 lines
1.7 KiB
JavaScript
Executable file

const Command = require('../../src/structures/Command');
module.exports = class Settings extends Command {
constructor() {
super({
name: 'settings',
description: 'Show the Settings of this Server',
aliases: [ 'config' ],
module: 'Settings',
cooldown: 5,
guildOnly: true,
developerOnly: false
});
}
async command(ctx) {
const SettingsEmbed = new ctx.utils.discord.MessageEmbed();
SettingsEmbed.setColor(ctx.config.color);
const Server = await ctx.db.servers.get(ctx.guild.id);
// console.log(Server);
if (Server !== null) {
SettingsEmbed.setTitle(`Settings for ${ctx.guild.name}`)
.addField('Prefixes', Server.prefix.join(', ') || `<@${ctx.client.user.id}> or \`'\``, false)
.addField(
'SourceFynnder',
Server.SourceFynnder ? ctx.utils.emotes.settings.on : ctx.utils.emotes.settings.off,
true
)
.addField(
'Shortlinks',
Server.Shortlinks ? ctx.utils.emotes.settings.on : ctx.utils.emotes.settings.off,
true
)
.addBlankField(true)
.addField(
'Image Embeds',
Server.embeds ? ctx.utils.emotes.settings.on : ctx.utils.emotes.settings.off,
true
)
.addField(
'Image Text',
Server.rp_text ? ctx.utils.emotes.settings.on : ctx.utils.emotes.settings.off,
true
);
// .addField('Default Yiff', Server.default_yiff, true);
ctx.send(SettingsEmbed);
} else {
SettingsEmbed.setTitle(`No Settings for ${ctx.guild.name}`).setDescription(
`You shouldn't see this.\n Your Server might not have been set up Properly when you invited me.\n\nPlease [join my support server](https://discord.gg/xNAcF8m) and notify my Developer`
);
ctx.send(SettingsEmbed);
}
}
};