From 979dad51695418d4b2dd6e723b9526e4fd57dd53 Mon Sep 17 00:00:00 2001 From: Vargoshi Date: Sun, 15 Oct 2023 21:35:35 +0200 Subject: [PATCH] ignore other bots --- bot/img2imgCommand.ts | 6 +++++- bot/txt2imgCommand.ts | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) 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; } -- 2.43.4