aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-18 21:03:52 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-18 21:03:52 -0400
commit8bb57f756e641c54cd0f8c172456ebf4c8fed7d4 (patch)
treeacad9652b7e913ebe339bfbb4893a76af56c5517 /src/lib/extensions
parenta6ac0dd9f89e51513c0be5810f41a27447816d6e (diff)
downloadtanzanite-8bb57f756e641c54cd0f8c172456ebf4c8fed7d4.tar.gz
tanzanite-8bb57f756e641c54cd0f8c172456ebf4c8fed7d4.tar.bz2
tanzanite-8bb57f756e641c54cd0f8c172456ebf4c8fed7d4.zip
a few fixes
Diffstat (limited to 'src/lib/extensions')
-rw-r--r--src/lib/extensions/discord-akairo/BushClientUtil.ts4
-rw-r--r--src/lib/extensions/discord.js/BushGuildMember.ts3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts
index 46e81df..9ccce65 100644
--- a/src/lib/extensions/discord-akairo/BushClientUtil.ts
+++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts
@@ -669,13 +669,15 @@ export class BushClientUtil extends ClientUtil {
duration: number;
guild: BushGuildResolvable;
modlog: string;
+ role?: Snowflake
}): Promise<Mute | Ban | PunishmentRole> {
const dbModel = this.findPunishmentModel(options.type);
const expires = options.duration ? new Date(new Date().getTime() + options.duration) : null;
const user = this.client.users.resolveId(options.user);
const guild = this.client.guilds.resolveId(options.guild);
- const entry = dbModel.build({ user, guild, expires, modlog: options.modlog });
+
+ const entry = options.type === 'role' ? (dbModel as typeof PunishmentRole).build({ user, guild, expires, modlog: options.modlog, role: options.role }):dbModel.build({ user, guild, expires, modlog: options.modlog });
return await entry.save().catch((e) => {
this.client.console.error('createPunishmentEntry', e?.stack || e);
return null;
diff --git a/src/lib/extensions/discord.js/BushGuildMember.ts b/src/lib/extensions/discord.js/BushGuildMember.ts
index fb85d7f..40e4a3a 100644
--- a/src/lib/extensions/discord.js/BushGuildMember.ts
+++ b/src/lib/extensions/discord.js/BushGuildMember.ts
@@ -136,7 +136,8 @@ export class BushGuildMember extends GuildMember {
user: this,
guild: this.guild,
duration: options.duration,
- modlog: modlog.id
+ modlog: modlog.id,
+ role: options.role.id
})
.catch(() => null);
if (!punishmentEntrySuccess) return 'error creating role entry';