feat(telegram): inline keyboard buttons (#491)

Co-authored-by: Azade <azade@hey.com>
This commit is contained in:
Peter Steinberger
2026-01-09 20:46:11 +01:00
parent 46f0a08878
commit 6d378ee608
19 changed files with 894 additions and 98 deletions

View File

@@ -65,6 +65,7 @@ type MessageCommandOpts = {
to?: string;
message?: string;
media?: string;
buttonsJson?: string;
messageId?: string;
replyTo?: string;
threadId?: string;
@@ -354,6 +355,15 @@ export async function messageCommand(
}
if (provider === "telegram") {
const buttonsJson = optionalString(opts.buttonsJson);
let buttons: unknown;
if (buttonsJson) {
try {
buttons = JSON.parse(buttonsJson);
} catch {
throw new Error("buttons-json must be valid JSON");
}
}
const result = await handleTelegramAction(
{
action: "sendMessage",
@@ -362,6 +372,8 @@ export async function messageCommand(
mediaUrl: optionalString(opts.media),
replyToMessageId: optionalString(opts.replyTo),
messageThreadId: optionalString(opts.threadId),
accountId: optionalString(opts.account),
buttons,
},
cfg,
);
@@ -550,6 +562,7 @@ export async function messageCommand(
messageId,
emoji,
remove: opts.remove,
accountId: optionalString(opts.account),
},
cfg,
);