Refactor message prefix handling, lessen reliance on member caching, fix adding guilds in postgresql

This commit is contained in:
Essem 2022-10-23 20:27:32 -05:00
parent a78df6fce7
commit 3662a2e51d
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
21 changed files with 87 additions and 103 deletions

View file

@ -147,11 +147,11 @@ export async function addGuild(guild) {
const query = await this.getGuild(guild);
if (query) return query;
try {
await sql`INSERT INTO guilds ${sql({ guild_id: guild.id, prefix: process.env.PREFIX, disabled: [], disabled_commands: [] })}`;
await sql`INSERT INTO guilds ${sql({ guild_id: guild, prefix: process.env.PREFIX, disabled: [], disabled_commands: [] })}`;
} catch (e) {
logger.error(`Failed to register guild ${guild.id}: ${e}`);
logger.error(`Failed to register guild ${guild}: ${e}`);
}
return await this.getGuild(guild.id);
return await this.getGuild(guild);
}
export async function fixGuild(guild) {