Bugfix hopefully
This commit is contained in:
parent
6fa715fb8b
commit
8dc57444b2
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user