thaldrin/DiscordModules/Settings/settings.js

63 lines
1.8 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();
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(", "), 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);
}
}
};