Lodol Docs

Telegram

API actions for the Telegram integration.

Telegram

Send Telegram messages, manage chat pins, and generate invite links.


Generate a new join link for a chat.

Parameters

ParameterTypeRequiredDescription
chat_idstringYesThe chat to create an invite link for.
namestringNoOptional label to help you recognize this link.
expire_datenumberNoOptional. When the link should expire, as a Unix timestamp in seconds (for example, 1706745600). Leave blank for a link that never expires.
member_limitnumberNoOptional. The maximum number of people who can join using this link.

Response

{
  "expire_date": 1706745600,
  "invite_link": "https://t.me/+abcdef123456",
  "member_limit": 100,
  "status": "success"
}

Forward a message

Forward a message from one chat to another.

Parameters

ParameterTypeRequiredDescription
chat_idstringYesThe chat to forward the message to.
from_chat_idstringYesThe chat that currently has the message.
message_idnumberYesThe ID of the message to forward.

Response

{
  "chat_id": 123456789,
  "message_id": 12347,
  "status": "success"
}

Get chat member count

Retrieve the number of members in a chat.

Parameters

ParameterTypeRequiredDescription
chat_idstringYesThe chat to count members in.

Response

{
  "count": 147,
  "status": "success"
}

Pin a chat message

Pin a message in a chat with optional silent notification.

Parameters

ParameterTypeRequiredDescription
chat_idstringYesThe chat that has the message.
message_idnumberYesThe ID of the message to pin.
disable_notificationbooleanNoSet to true to pin the message without notifying members.

Response

{
  "status": "success"
}

Send a message

Send a text message to a Telegram chat.

Parameters

ParameterTypeRequiredDescription
chat_idstringYesWhich chat to send to, given as its numeric chat ID or @username.
textstringYesThe text of the message to send.
parse_modestringNoOptional. How to format the message text: HTML, Markdown, or MarkdownV2. Leave blank for plain text.

Response

{
  "chat_id": 987654321,
  "message_id": 12345,
  "status": "success"
}

Send a photo

Send a photo to a Telegram chat, with an optional caption.

Parameters

ParameterTypeRequiredDescription
chat_idstringYesWhich chat to send to, given as its numeric chat ID or @username.
photo_urlstringYesA link to the photo you want to send.
captionstringNoOptional caption to show below the photo.

Response

{
  "chat_id": 987654321,
  "message_id": 12346,
  "status": "success"
}

On this page