redis limitations

This commit is contained in:
Emily 2020-10-11 15:03:54 +11:00
parent 8d5c0e4c00
commit 6dd7d93efd
2 changed files with 35 additions and 9 deletions

View file

@ -0,0 +1,27 @@
const { DiscordAPIError } = require("discord.js");
const { MessageEmbed } = require("discord.js");
const Command = require("../../base/Command.js");
class Settings extends Command {
constructor (client) {
super(client, {
description: "View all of your server's settings.",
usage: "settings",
guildOnly: true,
aliases: ["config"]
});
}
async run (message, args) { // eslint-disable-line no-unused-vars
const settings = await this.client.db.getGuild(message.guild.id);
const embed = new MessageEmbed()
.setAuthor('Settings Panel', message.guild.iconURL({dynamic: true}))
.setDescription('All the settings for this server are listed below. To set a setting, use `set [setting] [what you want to set it to]')
.addFields(
{ name: '**Prefix**', value: settings.prefix }
)
}
}
module.exports = Settings;

View file

@ -13,14 +13,9 @@ module.exports = class {
const userPrefix = await this.client.db.getUserKey(message.author.id, 'prefix');
const userBlacklisted = await this.client.db.getUserKey(message.author.id, 'blacklisted');
let memberBlacklisted = false;
const prefixes = [userPrefix];
if (message.guild) {
memberBlacklisted = await this.client.db.getMemberKey(message.guild.id, message.author.id, 'blacklisted');
prefixes.push(await this.client.db.getGuildKey(message.guild.id, 'prefix'));
};
if (message.guild) prefixes.push(await this.client.db.getGuildKey(message.guild.id, 'prefix'));
prefixes.push(`<@${this.client.user.id}> `, `<@!${this.client.user.id}> `)
@ -39,8 +34,12 @@ module.exports = class {
};
// Naughty users can't run commands!
if (message.guild && memberBlacklisted === true) return;
if (userBlacklisted === true) return;
if (message.guild) {
const check = await this.client.db.getMemberKey(message.guild.id, message.author.id, 'blacklisted')
if (check === true) { return };
};
if (userBlacklisted) return;
const args = message.content.slice(prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();