diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-05-24 18:29:57 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-05-24 18:29:57 -0400 |
commit | 9f5d9da2a37ecfec412b149ec7dc385ab7b6a98c (patch) | |
tree | 4b95a06ff6991207ab8b8e93f0bca26e24a97f80 /src/listeners/track-manual-punishments | |
parent | 6b8115ab1ec94d4330019fc7a93e094d9d64c48e (diff) | |
download | tanzanite-9f5d9da2a37ecfec412b149ec7dc385ab7b6a98c.tar.gz tanzanite-9f5d9da2a37ecfec412b149ec7dc385ab7b6a98c.tar.bz2 tanzanite-9f5d9da2a37ecfec412b149ec7dc385ab7b6a98c.zip |
fix: breaking changes
Diffstat (limited to 'src/listeners/track-manual-punishments')
4 files changed, 30 insertions, 22 deletions
diff --git a/src/listeners/track-manual-punishments/modlogSyncBan.ts b/src/listeners/track-manual-punishments/modlogSyncBan.ts index 106224a..504992f 100644 --- a/src/listeners/track-manual-punishments/modlogSyncBan.ts +++ b/src/listeners/track-manual-punishments/modlogSyncBan.ts @@ -14,8 +14,8 @@ export default class ModlogSyncBanListener extends BushListener { public override async exec(...[ban]: BushClientEvents['guildBanAdd']) { if (!(await ban.guild.hasFeature('logManualPunishments'))) return; - if (!ban.guild.me) return; // bot was banned - if (!ban.guild.me.permissions.has(PermissionFlagsBits.ViewAuditLog)) { + if (!ban.guild.members.me) return; // bot was banned + if (!ban.guild.members.me.permissions.has(PermissionFlagsBits.ViewAuditLog)) { return ban.guild.error( 'modlogSyncBan', `Could not sync the manual ban of ${ban.user.tag} to the modlog because I do not have the "View Audit Log" permission.` @@ -60,10 +60,12 @@ export default class ModlogSyncBanListener extends BushListener { name: ban.user.tag, iconURL: ban.user.avatarURL({ extension: 'png', size: 4096 }) ?? undefined }) - .addFields({ name: '**Action**', value: `${'Manual Ban'}` }) - .addFields({ name: '**User**', value: `${ban.user} (${ban.user.tag})` }) - .addFields({ name: '**Moderator**', value: `${first.executor} (${first.executor.tag})` }) - .addFields({ name: '**Reason**', value: `${first.reason ? first.reason : '[No Reason Provided]'}` }); + .addFields([ + { name: '**Action**', value: `${'Manual Ban'}` }, + { name: '**User**', value: `${ban.user} (${ban.user.tag})` }, + { name: '**Moderator**', value: `${first.executor} (${first.executor.tag})` }, + { name: '**Reason**', value: `${first.reason ? first.reason : '[No Reason Provided]'}` } + ]); return await logChannel.send({ embeds: [logEmbed] }); } } diff --git a/src/listeners/track-manual-punishments/modlogSyncKick.ts b/src/listeners/track-manual-punishments/modlogSyncKick.ts index cff397b..7a2c154 100644 --- a/src/listeners/track-manual-punishments/modlogSyncKick.ts +++ b/src/listeners/track-manual-punishments/modlogSyncKick.ts @@ -13,8 +13,8 @@ export default class ModlogSyncKickListener extends BushListener { public override async exec(...[member]: BushClientEvents['guildMemberRemove']) { if (!(await member.guild.hasFeature('logManualPunishments'))) return; - if (!member.guild.me) return; // bot was removed from guild - if (!member.guild.me.permissions.has(PermissionFlagsBits.ViewAuditLog)) { + if (!member.guild.members.me) return; // bot was removed from guild + if (!member.guild.members.me.permissions.has(PermissionFlagsBits.ViewAuditLog)) { return member.guild.error( 'modlogSyncKick', `Could not sync the potential manual kick of ${member.user.tag} to the modlog because I do not have the "View Audit Log" permission.` @@ -59,10 +59,12 @@ export default class ModlogSyncKickListener extends BushListener { name: member.user.tag, iconURL: member.user.avatarURL({ extension: 'png', size: 4096 }) ?? undefined }) - .addFields({ name: '**Action**', value: `${'Manual Kick'}` }) - .addFields({ name: '**User**', value: `${member.user} (${member.user.tag})` }) - .addFields({ name: '**Moderator**', value: `${first.executor} (${first.executor.tag})` }) - .addFields({ name: '**Reason**', value: `${first.reason ? first.reason : '[No Reason Provided]'}` }); + .addFields([ + { name: '**Action**', value: `${'Manual Kick'}` }, + { name: '**User**', value: `${member.user} (${member.user.tag})` }, + { name: '**Moderator**', value: `${first.executor} (${first.executor.tag})` }, + { name: '**Reason**', value: `${first.reason ? first.reason : '[No Reason Provided]'}` } + ]); return await logChannel.send({ embeds: [logEmbed] }); } } diff --git a/src/listeners/track-manual-punishments/modlogSyncTimeout.ts b/src/listeners/track-manual-punishments/modlogSyncTimeout.ts index 57e7ae6..f6235a9 100644 --- a/src/listeners/track-manual-punishments/modlogSyncTimeout.ts +++ b/src/listeners/track-manual-punishments/modlogSyncTimeout.ts @@ -13,7 +13,7 @@ export default class ModlogSyncTimeoutListener extends BushListener { public override async exec(...[_oldMember, newMember]: BushClientEvents['guildMemberUpdate']) { if (!(await newMember.guild.hasFeature('logManualPunishments'))) return; - if (!newMember.guild.me!.permissions.has(PermissionFlagsBits.ViewAuditLog)) { + if (!newMember.guild.members.me!.permissions.has(PermissionFlagsBits.ViewAuditLog)) { return newMember.guild.error( 'modlogSyncTimeout', `Could not sync the potential manual timeout of ${newMember.user.tag} to the modlog because I do not have the "View Audit Log" permission.` @@ -64,10 +64,12 @@ export default class ModlogSyncTimeoutListener extends BushListener { name: newMember.user.tag, iconURL: newMember.user.avatarURL({ extension: 'png', size: 4096 }) ?? undefined }) - .addFields({ name: '**Action**', value: `${newTime ? 'Manual Timeout' : 'Manual Remove Timeout'}` }) - .addFields({ name: '**User**', value: `${newMember.user} (${newMember.user.tag})` }) - .addFields({ name: '**Moderator**', value: `${first.executor} (${first.executor.tag})` }) - .addFields({ name: '**Reason**', value: `${first.reason ? first.reason : '[No Reason Provided]'}` }); + .addFields([ + { name: '**Action**', value: `${newTime ? 'Manual Timeout' : 'Manual Remove Timeout'}` }, + { name: '**User**', value: `${newMember.user} (${newMember.user.tag})` }, + { name: '**Moderator**', value: `${first.executor} (${first.executor.tag})` }, + { name: '**Reason**', value: `${first.reason ? first.reason : '[No Reason Provided]'}` } + ]); return await logChannel.send({ embeds: [logEmbed] }); } } diff --git a/src/listeners/track-manual-punishments/modlogSyncUnban.ts b/src/listeners/track-manual-punishments/modlogSyncUnban.ts index f7b9730..cdf18d9 100644 --- a/src/listeners/track-manual-punishments/modlogSyncUnban.ts +++ b/src/listeners/track-manual-punishments/modlogSyncUnban.ts @@ -14,7 +14,7 @@ export default class ModlogSyncUnbanListener extends BushListener { public override async exec(...[ban]: BushClientEvents['guildBanRemove']) { if (!(await ban.guild.hasFeature('logManualPunishments'))) return; - if (!ban.guild.me!.permissions.has(PermissionFlagsBits.ViewAuditLog)) { + if (!ban.guild.members.me!.permissions.has(PermissionFlagsBits.ViewAuditLog)) { return ban.guild.error( 'modlogSyncBan', `Could not sync the manual unban of ${ban.user.tag} to the modlog because I do not have the "View Audit Log" permission.` @@ -59,10 +59,12 @@ export default class ModlogSyncUnbanListener extends BushListener { name: ban.user.tag, iconURL: ban.user.avatarURL({ extension: 'png', size: 4096 }) ?? undefined }) - .addFields({ name: '**Action**', value: `${'Manual Unban'}` }) - .addFields({ name: '**User**', value: `${ban.user} (${ban.user.tag})` }) - .addFields({ name: '**Moderator**', value: `${first.executor} (${first.executor.tag})` }) - .addFields({ name: '**Reason**', value: `${first.reason ? first.reason : '[No Reason Provided]'}` }); + .addFields([ + { name: '**Action**', value: `${'Manual Unban'}` }, + { name: '**User**', value: `${ban.user} (${ban.user.tag})` }, + { name: '**Moderator**', value: `${first.executor} (${first.executor.tag})` }, + { name: '**Reason**', value: `${first.reason ? first.reason : '[No Reason Provided]'}` } + ]); return await logChannel.send({ embeds: [logEmbed] }); } } |