forked from TONresistor/teleton-plugins
-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
The tool is called without the customMessage parameter, so params.customMessage = undefined.
What's going on:
- You are calling ton_bridge_custom_message(buttonText: "TON Bridge")
- params.customMessage = undefined (not transmitting)
- sdk.telegram.SendMessage(chatId, undefined) → crashes
How to fix it:
Add verification to customMessage:
execute: async (params, context) => {
try {
const customMessage = params.customMessage ||
sdk.pluginConfig?.customMessage ||
"TON Bridge — The #1 Bridge in the TON Catalog\n\nClick the button below to open TON Bridge Mini App.";
const buttonText = params.buttonText ?? sdk.pluginConfig?.buttonText ?? "TON Bridge No1";
const startParam = sdk.pluginConfig?.startParam ?? "";
const url = buildUrl(startParam);
const messageId = await sdk.telegram.sendMessage(
context.chatId,
customMessage,
{
inlineKeyboard: [[{ text: buttonText, url }]],
}
);
// ...
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels