mirror of
https://github.com/uditkarode/bing-chat-telegram.git
synced 2025-04-20 09:46:51 +00:00
10 lines
303 B
TypeScript
10 lines
303 B
TypeScript
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!");
|
|
};
|