Closed Ice-Hazymoon closed 1 year ago
举个例子,在 Telegraf 中可以这样实现接收 web_app_data 数据
const { Telegraf, Markup } = require("telegraf"); const bot = new Telegraf("bot token"); bot.command("register", (ctx) => { return ctx.reply( "open webapp", Markup.keyboard([ Markup.button.webApp( "Open", "https://uture-tg-web.imiku.me/" ), ]) ); }); bot.on("message", async (ctx) => { console.log(ctx.message.web_app_data) return ctx.reply(ctx.message.web_app_data.data) }); bot.launch();
但是在 koishi 中不知道该怎样获取这些数据,session 是否有某个字段可以获取收到的原始数据
telegram 文档:https://core.telegram.org/bots/webapps#initializing-web-apps
如题
No response
"koishi": "^4.12.9",
session.telegram 上有你想要的属性,需要你先导入一下适配器的类型
session.telegram
import {} from 'koishi-plugin-adapter-telegram'
session.telegram 上有你想要的属性,需要你先导入一下适配器的类型 import {} from 'koishi-plugin-adapter-telegram'
谢谢
Describe the bug
举个例子,在 Telegraf 中可以这样实现接收 web_app_data 数据
但是在 koishi 中不知道该怎样获取这些数据,session 是否有某个字段可以获取收到的原始数据
telegram 文档:https://core.telegram.org/bots/webapps#initializing-web-apps
Steps to reproduce
如题
Expected behavior
如题
Screenshots
No response
Versions
"koishi": "^4.12.9",
Additional context
No response