Skip to content

Commit

Permalink
ifUserExist
Browse files Browse the repository at this point in the history
  • Loading branch information
katsuhira02 committed Jul 5, 2024
1 parent e5235d3 commit 5d36a40
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions supabase/functions/ai-koshey/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1402,8 +1402,19 @@ botAiKoshey.on("message:text", async (ctx: Context) => {
}
} else {
await ctx.replyWithChatAction("typing");
if (ctx.message?.text?.startsWith("/")) return;
const query = ctx?.message?.text;

const {isUserExist} = await checkAndReturnUser(ctx.from.id.toString())
if (!isUserExist) {
await ctx.reply(await textError(ctx), {
reply_markup: {
force_reply: true,
},
});
return;
}

const username = ctx?.update?.message?.from?.username;

if (!username || !language_code) return;
Expand Down

0 comments on commit 5d36a40

Please sign in to comment.