aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord.js/BushGuildMember.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-09-05 21:45:29 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-09-05 21:45:29 -0400
commite3c116e0f4b741032fe777936fdf5d80f0b011e6 (patch)
tree024bd9884f1456983faae2b62b59485a879ac934 /src/lib/extensions/discord.js/BushGuildMember.ts
parentc8a5bfe694ee6e784a0c5cbe1a7076b1c055249a (diff)
downloadtanzanite-e3c116e0f4b741032fe777936fdf5d80f0b011e6.tar.gz
tanzanite-e3c116e0f4b741032fe777936fdf5d80f0b011e6.tar.bz2
tanzanite-e3c116e0f4b741032fe777936fdf5d80f0b011e6.zip
modlogid uuid -> nanoid
Diffstat (limited to 'src/lib/extensions/discord.js/BushGuildMember.ts')
-rw-r--r--src/lib/extensions/discord.js/BushGuildMember.ts25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/lib/extensions/discord.js/BushGuildMember.ts b/src/lib/extensions/discord.js/BushGuildMember.ts
index 4dd1a5d..5575303 100644
--- a/src/lib/extensions/discord.js/BushGuildMember.ts
+++ b/src/lib/extensions/discord.js/BushGuildMember.ts
@@ -145,25 +145,24 @@ export class BushGuildMember extends GuildMember {
const ret = await (async () => {
if (options.addToModlog || options.duration) {
- const { log: modlog } = options.addToModlog
- ? await util.createModLogEntry({
- type: options.duration ? ModLogType.TEMP_PUNISHMENT_ROLE : ModLogType.PERM_PUNISHMENT_ROLE,
- guild: this.guild,
- moderator: moderator.id,
- user: this,
- reason: 'N/A'
- })
- : { log: null };
- caseID = modlog?.id;
-
- if (!modlog && options.addToModlog) return 'error creating modlog entry';
+ const { log: modlog } = await util.createModLogEntry({
+ type: options.duration ? ModLogType.TEMP_PUNISHMENT_ROLE : ModLogType.PERM_PUNISHMENT_ROLE,
+ guild: this.guild,
+ moderator: moderator.id,
+ user: this,
+ reason: 'N/A',
+ pseudo: !options.addToModlog
+ });
+
+ if (!modlog) return 'error creating modlog entry';
+ caseID = modlog.id;
if (options.addToModlog || options.duration) {
const punishmentEntrySuccess = await util.createPunishmentEntry({
type: 'role',
user: this,
guild: this.guild,
- modlog: modlog?.id ?? undefined,
+ modlog: modlog.id,
duration: options.duration,
extraInfo: options.role.id
});