diff --git a/bot/img2imgCommand.ts b/bot/img2imgCommand.ts index 45ba4c6..ed8b635 100644 --- a/bot/img2imgCommand.ts +++ b/bot/img2imgCommand.ts @@ -28,7 +28,11 @@ async function img2img( includeRepliedTo: boolean, state: QuestionState = {}, ): Promise { - if (!ctx.message?.from?.id) { + if (!ctx.from) { + return; + } + + if (ctx.from.is_bot) { return; } diff --git a/bot/txt2imgCommand.ts b/bot/txt2imgCommand.ts index 6b2ae1a..851ed74 100644 --- a/bot/txt2imgCommand.ts +++ b/bot/txt2imgCommand.ts @@ -20,7 +20,11 @@ export async function txt2imgCommand(ctx: CommandContext) { } async function txt2img(ctx: ErisContext, match: string, includeRepliedTo: boolean): Promise { - if (!ctx.message?.from?.id) { + if (!ctx.from) { + return; + } + + if (ctx.from.is_bot) { return; }