Retrieves the i18n session attached to a context by the i18n plugin.
The callback context of the current update.
The session, or undefined if the plugin is not installed.
undefined
app.on("message", async (update, context) => { const t = i18nFor(context)?.t("hello", { name: "Nam" }); await context.reply(t ?? "no i18n");}); Copy
app.on("message", async (update, context) => { const t = i18nFor(context)?.t("hello", { name: "Nam" }); await context.reply(t ?? "no i18n");});
Retrieves the i18n session attached to a context by the i18n plugin.