Skip to content

Commit 1e06724

Browse files
Adam GoughAdam Gough
authored andcommitted
telegram webhook fix
1 parent 871f4e8 commit 1e06724

1 file changed

Lines changed: 67 additions & 36 deletions

File tree

apps/sim/triggers/telegram/webhook.ts

Lines changed: 67 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -21,56 +21,87 @@ export const telegramWebhookTrigger: TriggerConfig = {
2121
},
2222

2323
outputs: {
24+
// Matches the formatted payload built in `formatWebhookInput` for provider "telegram"
25+
// Supports tags like <telegram.message.text> and deep paths like <telegram.message.raw.chat.id>
2426
message: {
25-
update_id: {
27+
id: {
2628
type: 'number',
27-
description: 'Unique identifier for the update',
29+
description: 'Telegram message ID',
2830
},
29-
message_id: {
30-
type: 'number',
31-
description: 'Unique message identifier',
32-
},
33-
from_id: {
34-
type: 'number',
35-
description: 'User ID who sent the message',
36-
},
37-
from_username: {
38-
type: 'string',
39-
description: 'Username of the sender',
40-
},
41-
from_first_name: {
42-
type: 'string',
43-
description: 'First name of the sender',
44-
},
45-
from_last_name: {
46-
type: 'string',
47-
description: 'Last name of the sender',
48-
},
49-
chat_id: {
50-
type: 'number',
51-
description: 'Unique identifier for the chat',
52-
},
53-
chat_type: {
54-
type: 'string',
55-
description: 'Type of chat (private, group, supergroup, channel)',
56-
},
57-
chat_title: {
31+
text: {
5832
type: 'string',
59-
description: 'Title of the chat (for groups and channels)',
33+
description: 'Message text content (if present)',
6034
},
61-
text: {
35+
caption: {
6236
type: 'string',
63-
description: 'Message text content',
37+
description: 'Caption for media messages (if present)',
6438
},
6539
date: {
6640
type: 'number',
6741
description: 'Date the message was sent (Unix timestamp)',
6842
},
69-
entities: {
43+
messageType: {
7044
type: 'string',
71-
description: 'Special entities in the message (mentions, hashtags, etc.) as JSON string',
45+
description:
46+
'Detected content type: text, photo, document, audio, video, voice, sticker, location, contact, poll',
47+
},
48+
raw: {
49+
message_id: {
50+
type: 'number',
51+
description: 'Original Telegram message_id',
52+
},
53+
date: {
54+
type: 'number',
55+
description: 'Original Telegram message date (Unix timestamp)',
56+
},
57+
text: {
58+
type: 'string',
59+
description: 'Original Telegram text (if present)',
60+
},
61+
caption: {
62+
type: 'string',
63+
description: 'Original Telegram caption (if present)',
64+
},
65+
chat: {
66+
id: { type: 'number', description: 'Chat identifier' },
67+
title: { type: 'string', description: 'Chat title (for groups/channels)' },
68+
username: { type: 'string', description: 'Chat username (if available)' },
69+
first_name: { type: 'string', description: 'First name (for private chats)' },
70+
last_name: { type: 'string', description: 'Last name (for private chats)' },
71+
},
72+
from: {
73+
id: { type: 'number', description: 'Sender user ID' },
74+
is_bot: { type: 'boolean', description: 'Whether the sender is a bot' },
75+
first_name: { type: 'string', description: 'Sender first name' },
76+
last_name: { type: 'string', description: 'Sender last name' },
77+
username: { type: 'string', description: 'Sender username (if available)' },
78+
language_code: { type: 'string', description: 'Sender language code (if available)' },
79+
},
7280
},
7381
},
82+
sender: {
83+
id: { type: 'number', description: 'Sender user ID' },
84+
firstName: { type: 'string', description: 'Sender first name' },
85+
lastName: { type: 'string', description: 'Sender last name' },
86+
username: { type: 'string', description: 'Sender username (if available)' },
87+
languageCode: { type: 'string', description: 'Sender language code (if available)' },
88+
isBot: { type: 'boolean', description: 'Whether the sender is a bot' },
89+
},
90+
chat: {
91+
id: { type: 'number', description: 'Chat identifier' },
92+
title: { type: 'string', description: 'Chat title (for groups/channels)' },
93+
username: { type: 'string', description: 'Chat username (if available)' },
94+
firstName: { type: 'string', description: 'First name (for private chats)' },
95+
lastName: { type: 'string', description: 'Last name (for private chats)' },
96+
},
97+
updateId: {
98+
type: 'number',
99+
description: 'Update ID for this webhook delivery',
100+
},
101+
updateType: {
102+
type: 'string',
103+
description: 'Type of update: message, edited_message, channel_post, edited_channel_post, unknown',
104+
},
74105
},
75106

76107
instructions: [

0 commit comments

Comments
 (0)