From 0488480ae933beb23bb46b6b4a2b8464e58462ef Mon Sep 17 00:00:00 2001 From: Matthew R Date: Tue, 1 Mar 2022 12:37:12 -0500 Subject: [PATCH] qol fixes --- src/commands/mute.ts | 2 +- src/commands/score.ts | 1 + src/commands/sysinfo.ts | 6 +++--- src/commands/unmute.ts | 2 +- src/events/guildMemberAdd.ts | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/commands/mute.ts b/src/commands/mute.ts index 3f46070..f33684b 100644 --- a/src/commands/mute.ts +++ b/src/commands/mute.ts @@ -20,7 +20,7 @@ export default class Mute extends Command { if (!member) return this.error(message.channel, 'Cannot find user.'); try { - const res1 = await this.client.db.mongo.local.muted.get(`muted-${member.id}`); + const res1 = await this.client.db.local.muted.get(`muted-${member.id}`); if (res1 || this.mainGuild.members.get(member.id).roles.includes('478373942638149643')) return this.error(message.channel, 'This user is already muted.'); } catch {} // eslint-disable-line no-empty if (member && !this.client.util.moderation.checkPermissions(member, message.member)) return this.error(message.channel, 'Permission Denied.'); diff --git a/src/commands/score.ts b/src/commands/score.ts index 4909380..59b2107 100644 --- a/src/commands/score.ts +++ b/src/commands/score.ts @@ -180,6 +180,7 @@ export default class Score extends Command { if (args[1] === 'soft' && !check) { let name = ''; + // eslint-disable-next-line no-unreachable-loop for (const role of this.client.util.resolveMember(message.author.id, this.mainGuild).roles.map((r) => this.mainGuild.roles.get(r)).sort((a, b) => b.position - a.position)) { name = `Library of Code sp-us | ${role.name}`; break; diff --git a/src/commands/sysinfo.ts b/src/commands/sysinfo.ts index 5059515..062714d 100644 --- a/src/commands/sysinfo.ts +++ b/src/commands/sysinfo.ts @@ -31,9 +31,9 @@ export default class SysInfo extends Command { embed.setDescription('__Format of Services__\n- {Server/Service Name} + {various server stats} | {Node Library Used for Communication w/ Server or Service}'); const mongoBuild = await mongoose.connections[0].db.command({ buildInfo: 1 }); const mongoDatabase: { - collections: number, - objects: number, - dataSize: number, + collections?: number, + objects?: number, + dataSize?: number, } = await mongoose.connections[0].db.command({ dbStats: 1 }); const asteriskInformation = await this.client.util.pbx.ari.asterisk.getInfo(); const redisVersion = await this.client.util.exec('redis-cli info | grep "redis_version"'); diff --git a/src/commands/unmute.ts b/src/commands/unmute.ts index 7ffe92a..f3d75c1 100644 --- a/src/commands/unmute.ts +++ b/src/commands/unmute.ts @@ -19,7 +19,7 @@ export default class Unmute extends Command { if (!member) return this.error(message.channel, 'Cannot find user.'); try { - const res1 = await this.client.db.mongo.local.muted.get(`muted-${member.id}`); + const res1 = await this.client.db.local.muted.get(`muted-${member.id}`); if (!res1 || !this.mainGuild.members.get(member.id).roles.includes('478373942638149643')) return this.error(message.channel, 'This user is already unmuted.'); } catch {} // eslint-disable-line no-empty if (member && !this.client.util.moderation.checkPermissions(member, message.member)) return this.error(message.channel, 'Permission Denied.'); diff --git a/src/events/guildMemberAdd.ts b/src/events/guildMemberAdd.ts index 40a7e0e..b0a405f 100644 --- a/src/events/guildMemberAdd.ts +++ b/src/events/guildMemberAdd.ts @@ -11,7 +11,7 @@ export default class GuildMemberAdd extends Event { public async run(_, member: Member) { try { - const search = await this.client.db.mongo.local.muted.get(`muted-${member.user.id}`); + const search = await this.client.db.local.muted.get(`muted-${member.user.id}`); if (search === true) { member.addRole('478373942638149643', 'muted user left server and joined back'); }