Bugfix hopefully

This commit is contained in:
Erik 2023-12-08 21:27:50 +02:00
parent 6fa715fb8b
commit 8dc57444b2
2 changed files with 3 additions and 3 deletions

View File

@ -384,7 +384,7 @@ export type BaseInfractionData = {
arguments?: InfractionArguments, arguments?: InfractionArguments,
targetType?: InfractionTargetType, targetType?: InfractionTargetType,
guild: GuildWrapper, guild: GuildWrapper,
channel?: GuildTextBasedChannel, channel?: GuildTextBasedChannel | null,
invoker?: InvokerWrapper | null, invoker?: InvokerWrapper | null,
target?: MemberWrapper | UserWrapper | GuildTextBasedChannel, target?: MemberWrapper | UserWrapper | GuildTextBasedChannel,
executor?: MemberWrapper | UserWrapper executor?: MemberWrapper | UserWrapper

View File

@ -554,8 +554,8 @@ class ModerationManager implements Initialisable
{ {
const executor = await guild.memberWrapper(i.executor!).catch(() => null) ?? await guild.memberWrapper(guild.me!); const executor = await guild.memberWrapper(i.executor!).catch(() => null) ?? await guild.memberWrapper(guild.me!);
const channel = guild.channels.resolve(i.channel!); const channel = guild.channels.resolve(i.channel!);
if (!channel?.isTextBased()) if (channel && !channel.isTextBased())
throw new Error('Bad channel'); throw new Error('Bad channel ' + inspect(i));
if (!executor) if (!executor)
throw new Error('Missing executor'); throw new Error('Missing executor');
try try