lots of changes
This commit is contained in:
parent
304d0ccb96
commit
f7fd3b99a4
60 changed files with 3029 additions and 878 deletions
59
DiscordModules/Settings/prefix.js
Normal file
59
DiscordModules/Settings/prefix.js
Normal file
|
@ -0,0 +1,59 @@
|
|||
const Command = require('../../src/structures/Command');
|
||||
module.exports = class Prefix extends Command {
|
||||
constructor() {
|
||||
super({
|
||||
name: 'prefix',
|
||||
description: 'Add or Remove a prefix',
|
||||
aliases: [],
|
||||
module: 'Settings',
|
||||
cooldown: 10,
|
||||
guildOnly: true,
|
||||
developerOnly: false
|
||||
});
|
||||
}
|
||||
|
||||
async command(ctx) {
|
||||
const PrefixEmbed = new ctx.utils.discord.MessageEmbed();
|
||||
PrefixEmbed.setColor(ctx.config.color);
|
||||
let ARG = ctx.args[0];
|
||||
ctx.args.shift();
|
||||
let Prefix = ctx.args.join(' ');
|
||||
let Server = await ctx.db.servers.get(ctx.guild.id);
|
||||
Server.prefix.shift();
|
||||
Server.prefix.shift();
|
||||
Server.prefix.shift();
|
||||
switch (ARG) {
|
||||
case 'a':
|
||||
case 'add':
|
||||
if (ctx.args === [] || ctx.args.join(' ').trim() === '') return ctx.send('No Prefix was given');
|
||||
|
||||
ctx.utils.db.prefix
|
||||
.add(ctx, Prefix)
|
||||
.then(async () => {
|
||||
let NServer = await ctx.db.servers.get(ctx.guild.id);
|
||||
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));
|
||||
break;
|
||||
case 'r':
|
||||
case 'remove':
|
||||
if (ctx.args === [] || ctx.args.join(' ').trim() === '') return ctx.send('No Prefix was given');
|
||||
ctx.utils.db.prefix
|
||||
.remove(ctx, Prefix)
|
||||
.then(async (r) => {
|
||||
let NServer = await ctx.db.servers.get(ctx.guild.id);
|
||||
ctx.send('Current Prefixes are:\n' + NServer.prefix.join(', '));
|
||||
})
|
||||
.catch((err) => ctx.send(err));
|
||||
break;
|
||||
default:
|
||||
PrefixEmbed.setTitle('Help');
|
||||
PrefixEmbed.addField('a / add <prefix>', 'Add a Prefix', true);
|
||||
PrefixEmbed.addField('r / remove <prefix>', 'Remove a Prefix', true);
|
||||
ctx.send(PrefixEmbed);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
|
@ -1,62 +1,54 @@
|
|||
const Command = require("../../src/structures/Command");
|
||||
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
|
||||
});
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
75
DiscordModules/Settings/toggle.js
Normal file
75
DiscordModules/Settings/toggle.js
Normal file
|
@ -0,0 +1,75 @@
|
|||
const Command = require('../../src/structures/Command');
|
||||
module.exports = class Toggle extends Command {
|
||||
constructor() {
|
||||
super({
|
||||
name: 'toggle',
|
||||
description: 'Toggle various Settings',
|
||||
aliases: [ 't' ],
|
||||
module: 'Settings',
|
||||
cooldown: 5,
|
||||
guildOnly: true,
|
||||
developerOnly: false,
|
||||
AuthorPermissions: [ 'MANAGE_GUILD' ]
|
||||
});
|
||||
}
|
||||
|
||||
async command(ctx) {
|
||||
const Embed = new ctx.utils.discord.MessageEmbed().setColor(ctx.config.color);
|
||||
let ARG = ctx.args[0];
|
||||
switch (ARG) {
|
||||
case 'source':
|
||||
case 'sauce':
|
||||
case 'sf':
|
||||
case 'sourcefynnder':
|
||||
await ctx.utils.db.toggle.SourceFynnder(ctx);
|
||||
Embed.setTitle(`Changed SourceFynnder Setting`).setDescription(
|
||||
`Now set to ${ctx.db.servers.get(ctx.guild.id).SourceFynnder
|
||||
? ctx.utils.emotes.settings.on
|
||||
: ctx.utils.emotes.settings.off}`
|
||||
);
|
||||
ctx.send(Embed);
|
||||
break;
|
||||
case 'shortlinks':
|
||||
case 'shortlink':
|
||||
case 'sl':
|
||||
await ctx.utils.db.toggle.Shortlinks(ctx);
|
||||
Embed.setTitle(`Changed Shortlink Setting`).setDescription(
|
||||
`Now set to ${ctx.db.servers.get(ctx.guild.id).Shortlinks
|
||||
? ctx.utils.emotes.settings.on
|
||||
: ctx.utils.emotes.settings.off}`
|
||||
);
|
||||
ctx.send(Embed);
|
||||
|
||||
break;
|
||||
case 'embed':
|
||||
case 'embeds':
|
||||
await ctx.utils.db.toggle.Embeds(ctx);
|
||||
Embed.setTitle(`Changed Image Embed Setting`).setDescription(
|
||||
`Now set to ${ctx.db.servers.get(ctx.guild.id).embeds
|
||||
? ctx.utils.emotes.settings.on
|
||||
: ctx.utils.emotes.settings.off}`
|
||||
);
|
||||
ctx.send(Embed);
|
||||
break;
|
||||
case 'text':
|
||||
case 'rp_text':
|
||||
await ctx.utils.db.toggle.Text(ctx);
|
||||
Embed.setTitle(`Changed Image Text Setting`).setDescription(
|
||||
`Now set to ${ctx.db.servers.get(ctx.guild.id).rp_text
|
||||
? ctx.utils.emotes.settings.on
|
||||
: ctx.utils.emotes.settings.off}`
|
||||
);
|
||||
ctx.send(Embed);
|
||||
break;
|
||||
default:
|
||||
Embed.setTitle('Help')
|
||||
.setDescription(`All settings have their own Toggles, see the list below to know which one's which`)
|
||||
.addField('SourceFynnder', 'sf sauce source sourcefynnder', true)
|
||||
.addField('Shortlinks', 'sl shortlink shortlinks', true)
|
||||
.addField('Image Embeds', 'embed embeds', true)
|
||||
.addField('Image Text', 'text rp_text', true);
|
||||
ctx.send(Embed);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue