mirror of
https://github.com/uditkarode/bing-chat-telegram.git
synced 2026-01-11 14:04:15 +00:00
init
This commit is contained in:
9
src/check-origin.ts
Normal file
9
src/check-origin.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Context, Middleware } from "telegraf";
|
||||
|
||||
export const checkOrigin =
|
||||
(allowedIds: readonly number[] | number[]): Middleware<Context> =>
|
||||
(ctx, next) => {
|
||||
const chatId = ctx.chat?.id;
|
||||
if (chatId && allowedIds.includes(chatId)) next();
|
||||
else ctx.reply("Unable to proceed in this chat!");
|
||||
};
|
||||
Reference in New Issue
Block a user