Skip to content

Commit f147eae

Browse files
feat(telegram): added additional telegram tools & docs (#1625)
* feat(telegram): added delete message,send photo-video-audio-animation tools * fix: updated Telegram tool types and removed debug logs * reverted telegram message tool to older name * added docs for telegram * updated telegram docs --------- Co-authored-by: SimplyRohit <[email protected]>
1 parent 6f3df27 commit f147eae

File tree

12 files changed

+1546
-46
lines changed

12 files changed

+1546
-46
lines changed

apps/docs/content/docs/en/tools/telegram.mdx

Lines changed: 101 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Telegram
3-
description: Send messages through Telegram or trigger workflows from Telegram events
3+
description: Interact with Telegram
44
---
55

66
import { BlockInfoCard } from "@/components/ui/block-info-card"
@@ -67,7 +67,7 @@ In Sim, the Telegram integration enables your agents to leverage these powerful
6767

6868
## Usage Instructions
6969

70-
Integrate Telegram into the workflow. Can send messages. Can be used in trigger mode to trigger a workflow when a message is sent to a chat.
70+
Integrate Telegram into the workflow. Can send and delete messages. Can be used in trigger mode to trigger a workflow when a message is sent to a chat.
7171

7272

7373

@@ -96,6 +96,105 @@ Send messages to Telegram channels or users through the Telegram Bot API. Enable
9696
| `timestamp` | number | Unix timestamp when message was sent |
9797
| `from` | object | Information about the bot that sent the message |
9898

99+
### `telegram_delete_message`
100+
101+
Delete messages in Telegram channels or chats through the Telegram Bot API. Requires the message ID of the message to delete.
102+
103+
#### Input
104+
105+
| Parameter | Type | Required | Description |
106+
| --------- | ---- | -------- | ----------- |
107+
| `botToken` | string | Yes | Your Telegram Bot API Token |
108+
| `chatId` | string | Yes | Target Telegram chat ID |
109+
| `messageId` | string | Yes | Message ID to delete |
110+
111+
#### Output
112+
113+
| Parameter | Type | Description |
114+
| --------- | ---- | ----------- |
115+
| `message` | string | Success or error message |
116+
| `data` | object | Delete operation result |
117+
118+
### `telegram_send_photo`
119+
120+
Send photos to Telegram channels or users through the Telegram Bot API.
121+
122+
#### Input
123+
124+
| Parameter | Type | Required | Description |
125+
| --------- | ---- | -------- | ----------- |
126+
| `botToken` | string | Yes | Your Telegram Bot API Token |
127+
| `chatId` | string | Yes | Target Telegram chat ID |
128+
| `photo` | string | Yes | Photo to send. Pass a file_id or HTTP URL |
129+
| `caption` | string | No | Photo caption \(optional\) |
130+
131+
#### Output
132+
133+
| Parameter | Type | Description |
134+
| --------- | ---- | ----------- |
135+
| `message` | string | Success or error message |
136+
| `data` | object | Telegram message data including optional photo\(s\) |
137+
138+
### `telegram_send_video`
139+
140+
Send videos to Telegram channels or users through the Telegram Bot API.
141+
142+
#### Input
143+
144+
| Parameter | Type | Required | Description |
145+
| --------- | ---- | -------- | ----------- |
146+
| `botToken` | string | Yes | Your Telegram Bot API Token |
147+
| `chatId` | string | Yes | Target Telegram chat ID |
148+
| `video` | string | Yes | Video to send. Pass a file_id or HTTP URL |
149+
| `caption` | string | No | Video caption \(optional\) |
150+
151+
#### Output
152+
153+
| Parameter | Type | Description |
154+
| --------- | ---- | ----------- |
155+
| `message` | string | Success or error message |
156+
| `data` | object | Telegram message data including optional media |
157+
158+
### `telegram_send_audio`
159+
160+
Send audio files to Telegram channels or users through the Telegram Bot API.
161+
162+
#### Input
163+
164+
| Parameter | Type | Required | Description |
165+
| --------- | ---- | -------- | ----------- |
166+
| `botToken` | string | Yes | Your Telegram Bot API Token |
167+
| `chatId` | string | Yes | Target Telegram chat ID |
168+
| `audio` | string | Yes | Audio file to send. Pass a file_id or HTTP URL |
169+
| `caption` | string | No | Audio caption \(optional\) |
170+
171+
#### Output
172+
173+
| Parameter | Type | Description |
174+
| --------- | ---- | ----------- |
175+
| `message` | string | Success or error message |
176+
| `data` | object | Telegram message data including voice/audio information |
177+
178+
### `telegram_send_animation`
179+
180+
Send animations (GIFs) to Telegram channels or users through the Telegram Bot API.
181+
182+
#### Input
183+
184+
| Parameter | Type | Required | Description |
185+
| --------- | ---- | -------- | ----------- |
186+
| `botToken` | string | Yes | Your Telegram Bot API Token |
187+
| `chatId` | string | Yes | Target Telegram chat ID |
188+
| `animation` | string | Yes | Animation to send. Pass a file_id or HTTP URL |
189+
| `caption` | string | No | Animation caption \(optional\) |
190+
191+
#### Output
192+
193+
| Parameter | Type | Description |
194+
| --------- | ---- | ----------- |
195+
| `message` | string | Success or error message |
196+
| `data` | object | Telegram message data including optional media |
197+
99198

100199

101200
## Notes

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/user-input.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,7 +2054,7 @@ const UserInput = forwardRef<UserInputRef, UserInputProps>(
20542054
{/* Highlight overlay */}
20552055
<div
20562056
ref={overlayRef}
2057-
className='pointer-events-none absolute inset-0 z-[1] max-h-[120px] overflow-y-auto overflow-x-hidden pl-[2px] pr-14 py-1 [&::-webkit-scrollbar]:hidden'
2057+
className='pointer-events-none absolute inset-0 z-[1] max-h-[120px] overflow-y-auto overflow-x-hidden py-1 pr-14 pl-[2px] [&::-webkit-scrollbar]:hidden'
20582058
>
20592059
<pre className='whitespace-pre-wrap break-words font-sans text-foreground text-sm leading-[1.25rem]'>
20602060
{(() => {
@@ -2102,7 +2102,7 @@ const UserInput = forwardRef<UserInputRef, UserInputProps>(
21022102
placeholder={isDragging ? 'Drop files here...' : effectivePlaceholder}
21032103
disabled={disabled}
21042104
rows={1}
2105-
className='relative z-[2] mb-2 min-h-[32px] w-full resize-none overflow-y-auto overflow-x-hidden break-words border-0 bg-transparent pl-[2px] pr-14 py-1 font-sans text-sm text-transparent leading-[1.25rem] caret-foreground focus-visible:ring-0 focus-visible:ring-offset-0'
2105+
className='relative z-[2] mb-2 min-h-[32px] w-full resize-none overflow-y-auto overflow-x-hidden break-words border-0 bg-transparent py-1 pr-14 pl-[2px] font-sans text-sm text-transparent leading-[1.25rem] caret-foreground focus-visible:ring-0 focus-visible:ring-offset-0'
21062106
style={{ height: 'auto', wordBreak: 'break-word' }}
21072107
/>
21082108

0 commit comments

Comments
 (0)