thaldrin/DiscordModules/Settings/settings.js

55 lines
1.7 KiB
JavaScript
Raw Normal View History

2019-11-10 08:42:09 +00:00
const Command = require('../../src/structures/Command');
2019-10-14 11:19:41 +00:00
module.exports = class Settings extends Command {
2019-11-10 08:42:09 +00:00
constructor() {
super({
name: 'settings',
description: 'Show the Settings of this Server',
aliases: [ 'config' ],
module: 'Settings',
cooldown: 5,
guildOnly: true,
developerOnly: false
});
}
2019-10-14 11:19:41 +00:00
2019-11-10 08:42:09 +00:00
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);
}
}
2019-10-14 11:19:41 +00:00
};