From 8bb57f756e641c54cd0f8c172456ebf4c8fed7d4 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sun, 18 Jul 2021 21:03:52 -0400 Subject: a few fixes --- src/lib/extensions/discord-akairo/BushClientUtil.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib/extensions/discord-akairo') 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 { 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; -- cgit