mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-09-06 16:07:14 +08:00
fix: telegram bot/miniapp bugs (#259)
This commit is contained in:
@@ -46,11 +46,9 @@ export function newTelegramBot(c: Context<HonoCustomType>, token: string): Teleg
|
|||||||
const bot = new Telegraf(token);
|
const bot = new Telegraf(token);
|
||||||
|
|
||||||
bot.use(async (ctx, next) => {
|
bot.use(async (ctx, next) => {
|
||||||
// skip non-message
|
|
||||||
if (ctx.updateType != "message") return;
|
|
||||||
// check if in private chat
|
// check if in private chat
|
||||||
if (ctx.chat?.type !== "private") {
|
if (ctx.chat?.type !== "private") {
|
||||||
return await ctx.reply("请在私聊中使用");
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const userId = ctx?.message?.from?.id || ctx.callbackQuery?.message?.chat?.id;
|
const userId = ctx?.message?.from?.id || ctx.callbackQuery?.message?.chat?.id;
|
||||||
|
|||||||
Reference in New Issue
Block a user