Tips
Search in Potato software for @BotFather, as shown in the image below:
Each bot is given a unique authentication token when it is created. The token looks something like 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11, but we'll use simply <token> in this document instead. You can learn about obtaining tokens and generating new ones in Create Bot.
All queries to the Potato Bot API must be served over HTTPS and need to be presented in this form:
https://api.rct2008.com:8443/<bot_token>/METHOD_NAME
.
Like this for example:
https://api.rct2008.com:8443/123456909:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/getMe
We support GET and POST HTTP methods. We support four ways of passing parameters in Bot API requests:
The response contains a JSON object, which always has a Boolean field 'ok' and may have an optional String field 'description' with a human-readable description of the result. If 'ok' equals true, the request was successful and the result of the query can be found in the 'result' field. In case of an unsuccessful request, 'ok' equals false and the error is explained in the 'description'. An Integer 'error_code' field is also returned, but its contents are subject to change in the future. Some errors may also have an optional field 'parameters' of the type ResponseParameters, which can help to automatically handle the error.
https://api.rct2008.com:8443/getUpdates
to retrieve bot updates ( represents the bot user token value. With the chat you can search within Potato for BotCreator user to view and make changes). Upon success request, a json object containing the list of message updates will be returned. Details will be explained in later documents.If you're using webhooks, you can perform a request to the Bot API while sending an answer to the webhook. Use either application/json or application/x-www-form-urlencoded or multipart/form-data response content type for passing parameters. Specify the method to be invoked in the method parameter of the request. It's not possible to know that such a request was successful or get its result.
Here are two mutually exclusive ways of receiving updates for your bot — the getUpdates method on one hand and Webhooks on the other. Incoming updates are stored on the server until the bot receives them either way, but they will not be kept longer than 24 hours.
Regardless of which option you choose, you will receive JSON-serialized Update objects as a result.
This object represents an incoming update.
At most one of the optional parameters can be present in any given update.
Parameter | Type | Description |
---|---|---|
update_id | Integer | The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you're using Webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially. |
message | Message | Optional. New incoming message of any kind — text, photo, sticker, etc. |
edited_message | Message | OPtional. a message that is known to the bot and was edited. |
inline_query | InlineQuery | Optional. New incoming inline query. |
callback_query | CallbackQuery | Optional. New incoming callback query. |
lang | String | Message source client language type, e.g. 'en' in English or 'zh' in Chinese. |
os_type | String | Message source client type, e.g. 'pc'. |
https://api.rct2008.com:8443/<bot_token>/getUpdates
An Array of Update objects is returned.
{ "ok": true, "result": [ { "update_id": 1, "message": { "message_id": 57, "chat": { "id": 11370003, "type": 2, "title": "group1" }, "from": { "id": 22800001, "first_name": "David", "last_name": "Smith", "username": "" }, "text": "123", "date": 1544440630 }, "inline_query": null, "lang": "en" } ] }
https://api.rct2008.com:8443/<bot_token>/setWebhook
https://www.example.com/<bot_token>
Since nobody else knows your bot‘s token, you can be pretty sure it's us.Parameter | Required | Type | Description |
---|---|---|---|
url | Yes | String | HTTP url to send updates to |
certificate | Optional | InputFile or String | A digital certificate that sends an existing file on the server through the file_id String. Or upload new files, using multipart/form-data |
{ "url": "https://127.0.0.1/web-mobile", "certificate": "00050000321djau921030213" }
https://api.rct2008.com:8443/<bot_token>/delWebhook
https://api.rct2008.com:8443/<bot_token>/getMe
{ "ok": true, "result": { "id": 10100427, "first_name": "ll_bot", "last_name": "", "username": "ll_bot" } }
Parameter | Description |
---|---|
id | The bot's unique identifier. bot identifiers start from a certain positive number and increase sequentially. |
first_name | The bot's first name |
last_name | Always be null. Ignore this parameter for Potato bot user. |
username | The bot's username |
https://api.rct2008.com:8443/<bot_token>/getFile
https://api.rct2008.com:8443/<bot_token>/<file_path>
.Parameter | Required | Type | Description |
---|---|---|---|
file_id | Yes | String | File identifier to get info about |
{ "file_id": "000001009814fcd09659fdcd80bf5224" }
Parameter | Type | Description |
---|---|---|
url | String | URL of the file |
{ "ok": true, "result": { "url": "https://api.rct2008.com:8443/files/10000000:p6KKlJ7JWa6XKEj7cJ6/0000fcd09659fdcd80bf5224.mp3" } }
https://api.rct2008.com:8443/<bot_token>/sendTextMessage
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
text | Yes | String | Text of the message to be sent |
reply_to_message_id | Optional | Integer | If the message is a reply, ID of the original message |
markdown | Optional | Boolean | Whether to use MarkDown rendering, Entities will be generated automatically based on the text field. Refer Rich Text Support for detail |
reply_markup | Optional | ReplyMarkup | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the use |
{ "chat_type":1, "chat_id":20216742, "text":"aaqwerwqerwqerwerqwrqwerqwerqrqwerqwerwerqa", "markdown" : true, "reply_markup":{ "type": 4, "inline_keyboard": [ { "buttons": [ { "text": "Button1", "callback_data": "123" }, { "text": "Button2", "callback_data": "abcde" } ] }, { "buttons": [ { "text": "Button3", "callback_data": "22222" }, { "text": "Button4", "callback_data": "333" } ] } ] } }
Parameter | Type | Description |
---|---|---|
message_id | Integer | Indicates the unique ID of the message |
{ "ok": true, "result": { "message_id": 27315 } }
https://api.rct2008.com:8443/<bot_token>/forwardMessage
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
from_chat_type | Yes | ChatType | Source target chat type |
from_chat_id | Yes | Integer | Unique identifier for the chat where the original message was sent |
message_id | Yes | Integer | Unique ID of the message to be forwarded |
{ "chat_type": 1, "chat_id": 8000012, "from_chat_type": 1, "from_chat_id": 8000042, "message_id": 523621234 }
Parameter | Type | Description |
---|---|---|
message_id | int | Indicates the unique ID of the message |
{ "ok": true, "result": { "message_id": 27315 } }
https://api.rct2008.com:8443/<bot_token>/answerCallbackQuery
Parameter | Required | Type | Description |
---|---|---|---|
inline_message_id | Yes | String | An unique identifier for the String query callback, uploaded by the user when sending a query callback request |
text | Yes | String | Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters |
show_alert | Optional | Boolean | If true, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false |
url | Optional | String | URL that will be opened by the user's client. If you have created a Game and accepted the conditions via @Botfather, specify the URL that opens your game – note that this will only work if the query comes from a callback_game button. |
cache_time | Optional | Integer | Default 0,The maximum amount of time in seconds that the result of the callback query may be cached client-side |
{ "inline_message_id": "521521325217527362323", "text": "Alert", "show_alert": true }
{ "ok": true, "result": null }
https://api.rct2008.com:8443/<bot_token>/sendLocation
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
latitude | Yes | Float | Latitude of the location |
longitude | Yes | Float | Longitude of the location |
reply_to_message_id | Optional | Integer | If the message is a reply, ID of the original message |
reply_markup | Optional | ReplyMarkup | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the use |
{ "chat_type": 1, "chat_id": 8000023, "latitude": 212.03, "longitude": 54.12 }
Parameter | Type | Description |
---|---|---|
message_id | Integer | Indicates the unique ID of the message |
{ "ok": true, "result": { "message_id": 27315 } }
https://api.rct2008.com:8443/<bot_token>/sendVenue
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
latitude | Yes | Float | Latitude of the location |
longitude | Yes | Float | Longitude of the location |
title | Yes | String | Name of the venue |
address | Yes | String | Address of the venue |
foursquare_id | Optional | String | Foursquare identifier of the venue |
reply_to_message_id | Optional | Integer | If the message is a reply, ID of the original message |
reply_markup | Optional | ReplyMarkup | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the use |
{ "chat_type": 1, "chat_id": 8000023, "latitude": 33.6, "longitude": -111.9, "title": "Musical Instrument Museum", "address": "Phoenix,Arizona" }
Parameter | Type | Description |
---|---|---|
message_id | Integer | Indicates the unique ID of the message |
{ "ok": true, "result": { "message_id": 27315 } }
https://api.rct2008.com:8443/<bot_token>/sendPhoto
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
photo | Yes | InputFile or String | Sends a photo. Sends the existing photo on the server via the file_id String. Or upload new photos using multipart/form-data |
caption | Optional | String | Photo caption (0-200 characters) |
reply_to_message_id | Optional | Integer | If the message is a reply, ID of the original message. |
reply_markup | Optional | ReplyMarkup | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the use |
{ "chat_type": 1, "chat_id": 8000012, "photo": "00000220aa47fca4bf5dfd5b49d552b9" }
Parameter | Type | Description |
---|---|---|
message_id | Integer | Indicates the unique ID of the message |
file_id | String | Indicates the unique ID of the file |
{ "ok": true, "result": { "message_id": 27315, "file_id": "00050000321djau921030213" } }
https://api.rct2008.com:8443/<bot_token>/sendDocument
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
document | Yes | InputFile or String | Sends a file document. You can send an existing file on the server via the file_id String. Or upload new files, using multipart/form-data |
caption | Optional | String | Document caption (0-200 characters) |
reply_to_message_id | Optional | Integer | If the message is a reply, ID of the original message |
reply_markup | Optional | ReplyMarkup | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the use |
{ "chat_type": 1, "chat_id": 8000012, "document": "aaadeaamadf6knpuata7w2sceqpdjrpq" }
Parameter | Type | Description |
---|---|---|
message_id | Integer | Indicates the unique ID of the message |
file_id | String | Indicates the unique ID of the file |
{ "ok": true, "result": { "message_id": 27315, "file_id": "00050000321djau921030213" } }
https://api.rct2008.com:8443/<bot_token>/sendVideo
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
video | Yes | InputFile or String | Sends a video . You can send an existing file on the server via the file_id String. Or upload new files, using multipart/form-data |
duration | Optional | Integer | Duration of sent video in seconds |
thumb | Optional | InputFile or String | Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be less than 3MB in size. |
width | Optional | Integer | Video width |
height | Optional | Integer | Video height |
caption | Optional | String | Video caption (0-200 characters) |
reply_to_message_id | Optional | Integer | If the message is a reply, ID of the original message |
reply_markup | Optional | ReplyMarkup | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the use |
{ "chat_type": 1, "chat_id": 8000012, "video": "000002229ad7056e1e5ddc6018da56dc" }
Parameter | Type | Description |
---|---|---|
message_id | Integer | Indicates the unique ID of the message |
file_id | String | Indicates the unique ID of the file |
{ "ok": true, "result": { "message_id": 27315, "file_id": "000002229ad7056e1e5ddc6018da56dc" } }
https://api.rct2008.com:8443/<bot_token>/editMessageText
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
text | Yes | String | Text of the message to be sent |
message_id | Yes | Integer | The unique ID of the message being edited |
markdown | Optional | Boolean | Whether to use MarkDown rendering, Entities will be generated automatically based on the text field. Refer Rich Text Support for detail |
reply_markup | Optional | ReplyMarkup | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the use |
{ "chat_type":1, "chat_id":20000009, "message_id": 16, "text":"abcde", "markdown" : true, "reply_markup":{ "type": 2, "resize_keyboard": true, "single_use": false, "selective": false, "keyboard": [ { "buttons": [ { "text": "new Button1" }, { "text": "new Button2" } ] }, { "buttons": [ { "text": "new Button3" }, { "text": "new Button4" } ] } ] } }
Parameter | Type | Description |
---|---|---|
ok | Boolean | Whether the operation is successful or not |
{ "ok": true, "result": null }
https://api.rct2008.com:8443/<bot_token>/editMessageCaption
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
message_id | Yes | Integer | the unique ID of the message being edited |
reply_markup | Optional | ReplyMarkup | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the use |
{ "chat_type":1, "chat_id":20000009, "message_id": 16, "text":"abcde", "caption" : "new text", "reply_markup":{ "type": 4, "inline_keyboard": [ { "buttons": [ { "text": "new Button1", "callback_data": "123" }, { "text": "new Button2", "callback_data": "" } ] }, { "buttons": [ { "text": "new Button3", "callback_data": "" }, { "text": "new Button4", "callback_data": "" } ] } ] } }
Parameter | Type | Description |
---|---|---|
ok | Boolean | Whether the operation is successful or not |
{ "ok": true, "result": null }
https://api.rct2008.com:8443/<bot_token>/deleteMessage
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
message_id | Yes | Integer | the unique ID of the message being edited |
{ "chat_type": 1, "chat_id": 8000012, "message_id": 27315634 }
Parameter | Type | Description |
---|---|---|
ok | Boolean | Whether the operation is successful or not |
{ "ok": true, "result": null }
https://api.rct2008.com:8443/<bot_token>/leaveChat
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
{ "chat_type": 2, "chat_id": 8000012 }
Parameter | Type | Description |
---|---|---|
ok | Boolean | Whether the operation is successful or not |
{ "ok": true }
https://api.rct2008.com:8443/<bot_token>/getChat
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
{ "chat_type": 2, "chat_id": 8000012 }
Parameter | Type | Description |
---|---|---|
ok | Boolean | Whether the operation is successful or not |
chat | Chat | Returns a Chat object on success. |
{ "ok": true, "result": { "id": 11190291, "type": 2, "title": "grpnaga" } }
https://api.rct2008.com:8443/<bot_token>/getChatMembersCount
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
{ "chat_type": 2, "chat_id": 8000012 }
Parameter | Type | Description |
---|---|---|
ok | Integer | Whether the operation is successful or not |
count | Integer | The number of members in a chat |
{ "ok": true, "result": { "count": 4 } }
https://api.rct2008.com:8443/<bot_token>/getChatAdministrators
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
{ "chat_type": 3, "chat_id": 8000012 }
Parameter | Type | Description |
---|---|---|
ok | Integer | Whether the operation is successful or not |
chat_member | ChatMember | An Array of ChatMember objects that contains information about all chat administrators |
{ "ok": true, "result": [ { "user": { "id": 20239276, "first_name": "ray", "last_name": "ray", "username": "" }, "status": "creator" }, { "user": { "id": 10100091, "first_name": "ABCD", "last_name": "", "username": "ABCD" }, "status": "administrator", "can_change_info": true, "can_post_messages": true, "can_edit_messages": true, "can_delete_messages": true, "can_invite_users": true, "can_restrict_members": true, "can_pin_messages": true, "can_promote_members": true } ] }
https://api.rct2008.com:8443/<bot_token>/setChatTitle
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
title | Yes | String | New chat title, 1-255 characters |
{ "chat_type": 2, "chat_id": 8000012, "title": "plane" }
Parameter | Type | Description |
---|---|---|
ok | Boolean | Whether the operation is successful or not |
{ "ok": true }
https://api.rct2008.com:8443/<bot_token>/setChatDescription
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
description | Yes | String | New chat description, 0-255 characters |
{ "chat_type": 2, "chat_id": 8000012, "description": "plane" }
Parameter | Type | Description |
---|---|---|
ok | Boolean | Whether the operation is successful or not |
{ "ok": true }
https://api.rct2008.com:8443/<bot_token>/setJoinGroups
Parameter | Required | Type | Description |
---|---|---|---|
enable | Yes | Boolean | True, the bot can be added to groups, else can not |
{ "enable":true }
Parameter | Type | Description |
---|---|---|
ok | Boolean | Whether the operation is successful or not |
{ "ok": true }
https://api.rct2008.com:8443/<bot_token>/pinChatMessage
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
message_id | Yes | Integer | Identifier of a message to pin |
disable_notification | No | Boolean | Pass True, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels. |
{ "chat_type": 3, "chat_id": 8000012, "message_id": 6234, "disable_notification": false }
Parameter | Type | Description |
---|---|---|
ok | Boolean | Whether the operation is successful or not |
{ "ok": true }
https://api.rct2008.com:8443/<bot_token>/unpinChatMessage
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
{ "chat_type": 3, "chat_id": 8000012 }
Parameter | Type | Description |
---|---|---|
ok | Boolean | Whether the operation is successful or not |
{ "ok": true }
https://api.rct2008.com:8443/<bot_token>/kickChatMember
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
user_id | Yes | Integer | Unique identifier for the target user |
{ "chat_type": 3, "chat_id": 8000012, "user_id": 80000001 }
Parameter | Type | Description |
---|---|---|
ok | Boolean | Whether the operation is successful or not |
{ "ok": true }
https://api.rct2008.com:8443/<bot_token>/kickNotBan
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
user_id | Yes | Integer | Unique identifier for the target user |
{ "chat_type": 3, "chat_id": 8000012, "user_id": 80000001 }
Parameter | Type | Description |
---|---|---|
ok | Boolean | Whether the operation is successful or not |
{ "ok": true }
https://api.rct2008.com:8443/<bot_token>/sendChatAction
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat or username of the target channel |
action | Yes | String | Type of action to broadcast.Choose one,depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_audio or upload_audio for audio files.upload_document for general files, find_location for location data, record_video_note or upload_video_note for video notes. All actions "typing", "record_video", "upload_video", "record_audio", "upload_audio", "upload_photo", "upload_document", "geo_location", "choose_contact", "game_play", "record_round", upload_round", "cancel" |
{ "chat_type": 2, "chat_id": 8000012, "action":"upload_document" }
Parameter | Type | Description |
---|---|---|
ok | Boolean | Whether the operation is successful or not |
{ "ok": true }
https://api.rct2008.com:8443/<bot_token>/getGroups
Parameter | Type | Description |
---|---|---|
ok | Boolean | Whether the operation is successful or not |
Groups | String[] | groups |
SuperGroups | String[] | supergroups |
Channels | String[] | channels |
{ "ok": true, "result": { "Groups": [ { "PeerID": 12345671, "PeerName": "group" } ], "SuperGroups": [ { "PeerID": 12345672, "PeerName": "supergroup" } ], "Channels": [ { "PeerID": 12345673, "PeerName": "channel" } ] } }
https://api.sydney.im:8443/<bot_token>/getGroupBlackList
Parameter | Required | Type | Description |
---|---|---|---|
chat_id | Yes | Integer | Unique identifier for the target chat |
offset | Yes | Integer | sequential number of the first banned user to be returned |
limit | Yes | Integer | limits the number of baned user to be retrieved. Values between 1-100 are accepted. Defaults to 100. |
{
"chat_id": 11241496
}
Parameter | Type | Description |
---|---|---|
ok | Boolean | Whether the operation is successful or not |
result | array | An Array of User objects and a user id indicate that who kicked the user |
{
"ok": true,
"result": [
{
"user": {
"id": 20241232,
"first_name": "James",
"last_name": "",
"username": "james"
},
"kicked_by": 11240103
}
]
}
https://api.sydney.im:8443/<bot_token>/editGroupBlackList
Parameter | Required | Type | Description |
---|---|---|---|
chat_id | Yes | Integer | Unique identifier for the target chat |
user_id | Yes | Integer | Unique identifier for the target user |
action | Yes | Integer | If action is 1 means ban a user, if action is 2 means unban a user |
{
"action": 1,
"chat_id": 11241496,
"user_id": 20241232
}
Parameter | Type | Description |
---|---|---|
ok | Boolean | Whether the operation is successful or not |
{
"ok": true
}
https://api.sydney.im:8443/<bot_token>/lipBlock
Parameter | Required | Type | Description |
---|---|---|---|
group_id | Yes | Integer | Unique identifier for the target super group |
user_id | Yes | Integer | Unique identifier for the target user |
{
"group_id": 11241496,
"user_id": 20241232
}
Parameter | Type | Description |
---|---|---|
ok | Boolean | Whether the operation is successful or not |
{
"ok": true
}
https://api.sydney.im:8443/<bot_token>/lipUnBlock
Parameter | Required | Type | Description |
---|---|---|---|
group_id | Yes | Integer | Unique identifier for the target super group |
user_id | Yes | Integer | Unique identifier for the target user |
{
"group_id": 11241496,
"user_id": 20241232
}
Parameter | Type | Description |
---|---|---|
ok | Boolean | Whether the operation is successful or not |
{
"ok": true
}
Your bot can offer users HTML5 games to play solo or to compete against each other in groups and one-on-one chats. Create games via @BotFather using the /newgame command. Please note that this kind of power requires responsibility: you will need to accept the terms for each game that your bots will be offering.
Games are a new type of content on Potato, represented by the Game and InlineQueryResultGame objects.
Once you've created a game via BotFather, you can send games to chats as regular messages using the sendGame method, or use inline mode with InlineQueryResultGame.
If you send the game message without any buttons, it will automatically have a 'Play GameName' button. When this button is pressed, your bot gets a CallbackQuery with the game_short_name of the requested game. You provide the correct URL for this particular user and the app opens the game in the in-app browser.
You can manually add multiple buttons to your game message. Please note that the first button in the first row must always launch the game, using the field callback_game in InlineKeyboardButton. You can add extra buttons according to taste: e.g., for a description of the rules, or to open the game's official community.
To make your game more attractive, you can upload a GIF animation that demostrates the game to the users via BotFather (see 2048
for example).
A game message will also display high scores for the current chat. Use setGameScore to post high scores to the chat with the game, add the edit_message parameter to automatically update the message with the current scoreboard.
Use getGameHighScores to get data for in-game high score tables.
You can also add an extra sharing button for users to share their best score to different chats.
For examples of what can be done using this new stuff, check the @app.
https://api.rct2008.com:8443/<bot_token>/sendGame
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
game_short_name | Yes | String | Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather. |
reply_to_message_id | Optional | Integer | If the message is a reply, ID of the original message |
disable_notification | Optional | Boolean | WSends the message silently. Users will receive a notification with no sound. |
reply_markup | Optional | InlineKeyboardMarkup | A JSON-serialized object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. |
{ "chat_type":1, "chat_id":22800001, "game_short_name":"2048" }
Parameter | Type | Description |
---|---|---|
message_id | Integer | Indicates the unique ID of the message |
{ "ok": true, "result": { "message_id": 27315 } }
https://api.rct2008.com:8443/<bot_token>/setGameScore
Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
user_id | Yes | Integer | Unique identifier of the user |
score | Yes | Integer | New score, must be non-negative |
message_id | Yes | Integer | Identifier of the sent game message |
force | Optional | Boolean | Pass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters |
{ "message_id":204, "user_id":22800001, "chat_type":1, "chat_id":22800001, "bot_id":10006000, "score":70 }
Parameter | Type | Description |
---|---|---|
message_id | Integer | Indicates the unique ID of the message |
{ "ok": true, "result": { "message_id": 27315 } }
https://api.rct2008.com:8443/<bot_token>/getGameHighScores
GameHighScore
objects.Parameter | Required | Type | Description |
---|---|---|---|
chat_type | Yes | ChatType | Type for the target chat |
chat_id | Yes | Integer | Unique identifier for the target chat |
user_id | Yes | Integer | Unique identifier of the user |
message_id | Yes | Integer | Identifier of the sent game message.You can get it from CallbackQuery from the server when you click play button |
{ "message_id":204, "user_id":22800001, "chat_type":3, "chat_id":10856320, "bot_id":10060216, "score":70 }
Parameter | Type | Description |
---|---|---|
message_id | Integer | Indicates the unique ID of the message |
{ "ok": true, "result": { "message_id": 27315 } }
The following methods and objects allow your bot to work in inline mode.
Please see our Introduction to Inline bots for more details.
To enable this option, send the /setinline command to @BotFather and provide the placeholder text that the user will see in the input field after typing your bot's name.
Field | Type | Required | Description |
---|---|---|---|
id | String | Yes | Unique identifier for this query |
from | User | Yes | Sender |
location | Location | Optional | Optional. Sender location, only for bots that request user location |
query | String | Yes | Text of the query (up to 512 characters) |
offset | String | Yes | Offset of the results to be returned, can be controlled by the bot |
https://api.rct2008.com:8443/<bot_token>/answerInlineQuery
Parameter | Type | Required | Description |
---|---|---|---|
inline_query_id | String | Yes | Unique identifier for the answered query |
results | Array of InlineQueryResult | Yes | A JSON-serialized array of results for the inline query |
is_personal | Boolean | Optional | Pass True, if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query |
next_offset | String | Optional | Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty String if there are no more results or if you don‘t support pagination. Offset length can't exceed 64 bytes. |
switch_pm_text | String | Optional | If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with the parameter switch_pm_parameter |
switch_pm_parameter | String | Optional | parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed. |
This object represents one result of an inline query. Potato clients currently support results of the following 5 types:
Field | Type | Required | Description |
---|---|---|---|
type | String | Yes | Type of the result, must be article |
id | String | Yes | Unique identifier for this result, 1-64 Bytes |
title | String | Yes | Title of the result |
input_message_content | InputMessageContent | Yes | Content of the message to be sent |
reply_markup | InlineKeyboardMarkup | Optional | Inline keyboard attached to the message |
url | String | Optional | URL of the result |
hide_url | Boolean | Optional | Pass True, if you don't want the URL to be shown in the message |
description | String | Optional | Short description of the result |
thumb_url | String | Optional | Url of the thumbnail for the result |
thumb_width | Integer | Optional | Optional. Thumbnail width |
thumb_height | Integer | Optional | Optional. Thumbnail height |
Field | Type | Required | Description |
---|---|---|---|
type | String | Yes | Type of the result, must be website |
id | String | Yes | Unique identifier for this result, 1-64 Bytes |
title | String | Yes | Title of the result |
input_message_content | InputMessageContent | Yes | Content of the message to be sent |
url | String | Yes | URL of the website |
reply_markup | InlineKeyboardMarkup | Optional | Inline keyboard attached to the message |
description | String | Optional | Short description of the result |
thumb_url | String | Optional | Url of the thumbnail for the result |
Field | Type | Required | Description |
---|---|---|---|
type | String | Yes | Type of the result, must be article |
id | String | Yes | Unique identifier for this result, 1-64 Bytes |
game_short_name | String | Yes | Unique identifier of the user |
reply_markup | ReplyMarkup | Optional | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the use |
Field | Type | Required | Description |
---|---|---|---|
type | String | Yes | Type of the result, must be gif |
id | String | Yes | Unique identifier for this result, 1-64 bytes |
gif_url | String | Yes | A valid URL for the GIF file. File size must not exceed 1MB |
gif_width | Integer | Optional | Width of the GIF |
gif_height | Integer | Optional | Height of the GIF |
gif_duration | Integer | Optional | Duration of the GIF |
thumb_url | String | Yes | URL of the static thumbnail for the result (jpeg or gif) |
title | String | Optional | Title for the result |
caption | String | Optional | Caption of the GIF file to be sent, 0-1024 characters |
reply_markup | InlineKeyboardMarkup | Optional | Inline keyboard](#inlinekeyboardmarkup) attached to the message |
Field | Type | Required | Description |
---|---|---|---|
type | String | Yes | Type of the result, must be photo |
id | String | Yes | Unique identifier for this result, 1-64 bytes |
photo_url | String | Yes | A valid URL of the photo. Photo must be in jpeg format. Photo size must not exceed 5MB |
thumb_url | String | Yes | URL of the thumbnail for the photo |
photo_width | Integer | Optional | Width of the photo |
photo_height | Integer | Optional | Height of the photo |
title | String | Optional | Title for the result |
description | String | Optional | Short description of the result |
caption | String | Optional | Caption of the photo to be sent, 0-1024 characters |
reply_markup | InlineKeyboardMarkup | Optional | Inline keyboard attached to the message |
Field | Type | Required | Description |
---|---|---|---|
type | String | Yes | Type of the result, must be video |
id | String | Yes | Unique identifier for this result, 1-64 bytes |
video_url | String | Yes | A valid URL for the embedded video player or video file and size must not exceed 50MB |
mime_type | String | Yes | Mime type of the content of video url, "text/html" or "video/mp4" |
thumb_url | String | Yes | URL of the thumbnail for the video |
title | String | Yes | Title for the result |
caption | String | Optional | Caption of the photo to be sent, 0-1024 characters |
video_width | Integer | Optional | Video width, default 686px |
video_height | Integer | Optional | Video height, default 386px |
reply_markup | InlineKeyboardMarkup | Optional | Inline keyboard attached to the message |
This object represents the content of a message to be sent as a result of an inline query. Potato clients currently support the following 1 types:
Field | Type | Required | Description |
---|---|---|---|
message_text | String | Yes | TypText of the message to be sent, 1-4096 characters |
Field | Type | Required | Description |
---|---|---|---|
type | String | Yes | Type of the result, must be photo |
id | String | Yes | Unique identifier for this result, 1-64 bytes |
photo_file_id | String | Yes | A valid file identifier of the photo |
title | String | Optional | Title for the result |
description | String | Optional | Optional. Short description of the result |
caption | String | Optional | Caption of the photo to be sent, 0-1024 characters |
parse_mode | String | Optional | Send Markdown , if you want Potato apps to show bold, italic, fixed-width text or inline URLs in the media caption. |
reply_markup | InlineKeyboardMarkup | Optional | inline keyboard attached to the message |
input_message_content | InputMessageContent | Optional | Content of the message to be sent instead of the photo |
Field | Type | Description |
---|---|---|
message_text | String | TypText of the message to be sent, 1-4096 characters |
Value | Enumeration value | Description |
---|---|---|
1 | PeerUser | user chat |
2 | PeerChat | standard group chat |
3 | ChannelChat | super group chat |
Value | Enumeration value | Description |
---|---|---|
1 | EntityBold | Bold |
2 | EntityItalic | Italic |
3 | EntityCode | Code highlighting |
4 | EntityURL | Hyperlink |
5 | EntityTextURL | Text link |
6 | EntityMention | Mentioned |
7 | EntityMentionName | Mention the name |
8 | EntityEMail | Code highlighting |
9 | EntityBotCommand | Bot command |
Value | Enumeration value | Description |
---|---|---|
1 | ForceReplyType | Display of the reply screen so that the user has manually select the rbot message to click the "reply" button |
2 | ReplyKeyboardMarkupType | Replies to custom keyboard |
3 | ReplyKeyboardRemoveType | Indicates that the current custom keyboard is removed |
4 | InlineKeyboardMarkupType | That line custom keyboard, displayed in the chat content |
Parameter | Required | Type | Description |
---|---|---|---|
id | Yes | Integer | the user's unique ID |
first_name | Optional | String | The user's First name |
last_name | Optional | String | The user's Last name |
username | Yes | String | The user name |
{ "id": 1000, "first_name": "David", "last_name": "Smith", "username": "username" }
Parameter | Type | Required | Description |
---|---|---|---|
id | Yes | Integer | The user's unique ID |
type | Yes | ChatType | Chat Type |
title | String | Optional | The title of the dialog takes effect only if the type field is 2 (PeerChat) or 3 (ChannelChat |
invite_link | String | Optional | Invite link, only when the type field is 3 (ChannelChat) will take effect |
username | String | Optional | Username, for private chats, supergroups and channels if available |
all_members_are_administrators | Boolean | Optional | True if a group has 'All Members Are Admins' enabled. |
description | String | Optional | Description, for supergroups and channel chats. Returned only in getChat |
pinned_message | Message | Optional | Pinned message, for supergroups and channel chats. Returned only in getChat. |
{ "id": 1000, "type": 3, "title": "super group" }
Field | Required | Type | Comments |
---|---|---|---|
type | Yes | EntityType | Entity type |
user_id | Optional | Integer | Required when type 7 (EntityMentionName) indicates the target user ID of @e |
offset | Yes | Integer | the starting offset position of the link, in bytes, of which Chinese characters and English letters count one byte, emoj count two bytes |
length | Yes | Integer | the length of the link, in bytes |
url | Optional | String | Type 5 (EntityTextUrl) Mandatory, indicating the URL of the link |
Field | Type | Required | Comments |
---|---|---|---|
text | String | Yes | the label text displayed on the button |
request_contact | Boolean | Optional | Default false, whether to click and send your own business card |
request_location | Boolean | Optional | Default false, whether to click and send their own geographic location |
Field | Type | Required | Comments |
---|---|---|---|
buttons | Array of KeyboardButton | Yes | A row of custom buttons |
Field | Type | Required | Comments |
---|---|---|---|
text | String | Yes | label text displayed on the button |
url | String | Optional | Default null, HTTP url |
callback_data | String | Optional | default null, callback send data |
switch_inline_query | String | Optional | Default null, toggles inline query data. Ask the user to select a dialog, then @ robot and send this data |
switch_inline_query_current_chat | String | Optional | default null, toggles the inline query data. In the current dialog @ robot and send this data |
Field | Type | Required | Comments |
---|---|---|---|
buttons | Array of InlineKeyboardButton | Yes | A row of inline buttons |
Field | Type | Required | Comments |
---|---|---|---|
type | ReplyMarkupType | Yes | This value needs to be 2(ReplyKeyboardMarkupType), indicates reply keyboard |
keyboard | Array of KeyboardButtonRow | Yes | Custom keyboard, referencing "Button" object "KeyboardButtonRow" |
resize_keyboard | Booleanean | Optional | "False" by default, adaptive keyboard height |
single_use | Booleanean | Optional | "False" by default, hide custom keyboard after use |
selective | Booleanean | Optional | "False" by default, indicates that it can only be seen by specific users: 1. Users mentioned in the message. 2. If the previous message is a reply, only the original sender can view the message. |
Field | Type | Required | Comments |
---|---|---|---|
type | ReplyMarkupType | Yes | This value needs to be 2(ReplyKeyboardMarkupType), indicates reply keyboard |
keyboard | Array of KeyboardButtonRow | Yes | Custom keyboard, referencing "Button" object "KeyboardButtonRow" |
resize_keyboard | Booleanean | Optional | "False" by default, adaptive keyboard height |
single_use | Booleanean | Optional | "False" by default, hide custom keyboard after use |
selective | Booleanean | Optional | "False" by default, indicates that it can only be seen by specific users: 1. Users mentioned in the message. 2. If the previous message is a reply, only the original sender can view the message. |
Field | Type | Required | Comments |
---|---|---|---|
type | ReplyMarkupType | Yes | This value needs to be set as 4(InlineKeyboardMarkupType), used to depict the inline keyboard displayed in the chat message |
selective | Booleanean | Optional | False by default, indicates that it can only be seen by specific users: 1. Users mentioned in the message. 2. If the previous message is a reply, only the original sender can view the message. |
Field | Type | Required | Comments |
---|---|---|---|
type | ReplyMarkupType | Yes | This value needs to be set as 3(ReplyKeyboardRemoveType), which will delete the custom keyboard |
selective | Booleanean | Optional | False by default, indicates that it can only be seen by specific users: 1. Users mentioned in the message. 2. If the previous message is a reply, only the original sender can view the message. |
Field | Type | Required | Comments |
---|---|---|---|
longitude | Float | Yes | Longitude |
latitude | Float | Yes | Latitude |
Field | Type | Required | Comments |
---|---|---|---|
longitude | Float | Yes | Longitude |
latitude | Float | Yes | Latitude |
title | String | Yes | Title |
address | String | Yes | Address |
foursquare_id | String | Optional | Foursquare Identifier |
Field | Type | Required | Comments |
---|---|---|---|
file_id | String | Yes | File unique ID |
width | Integer | Yes | Photo width |
height | Integer | Yes | Photo height |
file_size | Integer | Optional | Photo size |
Field | Type | Required | Comments |
---|---|---|---|
file_id | String | Yes | File unique ID |
duration | Integer | Yes | Playing time |
performer | String | Optional | Author |
title | String | Optional | Title |
mime_type | String | Optional | File mime_type |
file_size | Integer | Optional | File size |
Field | Type | Required | Comments |
---|---|---|---|
file_id | String | Yes | File unique ID |
thumb | PhotoSize | Optional | File thumbnail |
file_name | String | Optional | File name |
mime_type | String | Optional | File mime type |
file_size | Integer | Optional | File size |
Field | Type | Required | Comments |
---|---|---|---|
file_id | String | Yes | File unique ID |
width | Integer | Yes | Video width |
height | Integer | Yes | Video height |
duration | Integer | Yes | playing time |
thumb | PhotoSize | Optional | Video thumbnail |
mime_type | String | Optional | File MIME type |
file_size | Integer | Optional | File size |
Field | Type | Required | Comments |
---|---|---|---|
file_id | String | Yes | File unique ID |
duration | Integer | Yes | Playing time |
mime_type | String | Optional | File MIME type |
file_size | Integer | Optional | File size |
Field | Type | Required | Comments |
---|---|---|---|
phone_number | String | Yes | Contact phone number |
first_name | String | Yes | Contact first name |
last_name | String | Optional | Contact last name |
user_id | Integer | Optional | Contact user id |
Field | Type | Required | Comments |
---|---|---|---|
new_group_members | Array of User | Optional | Join the group |
left_group_member | User | Optional | Leave the group |
new_group_title | String | Optional | Modify the group name |
migrate_from_chat_id | Integer | Optional | Upgrade from a normal group to a super group with the unique ID of the normal group |
migrate_to_chat_id | Integer | Optional | Upgrade from a normal group to a super group with a unique ID of the super group |
Field | Type | Required | Comments |
---|---|---|---|
inline_message_id | String | Yes | The unique identifier for this query, which is needed to answer this query (in fact yes, the client and server agreed message ID) |
message_id | Integer | Yes | The message id that triggered this query |
chat | Chat | Yes | Message conversation information |
from | User | Yes | Message sender information |
data | String | Yes | Query data |
date | Integer | Yes | Unix time stamp of the message |
Field | Type | Required | Comments |
---|---|---|---|
message_id | Integer | Yes | A unique ID for the message |
chat | Chat | Yes | Message conversation information |
from | User | Yes | Message sender information |
forward_from | User | Optional | The sender of the original message |
forward_date | Integer | Optional | Message forwarding Unix timestamp |
text | String | Optional | Message text |
entities | Array of Entity | Optional | An array of Entity objects describing the rich text information |
reply_to_message | Message | Optional | Reply to the original message |
date | Integer | Yes | Unix time stamp of the message |
edit_date | Integer | Optional | Unix timestamp of last edited message |
location | Location | Optional | Address location |
venue | Venue | Optional | Address |
photo | Array of PhotoSize | Optional | Photo file |
audio | Audio | Optional | Audio file |
document | Document | Optional | Document file |
video | Video | Optional | Video file |
voice | Voice | Optional | Recording files |
contact | Contact | Optional | Contact |
caption | String | Optional | Document / Picture / Video / Audio title |
action | MessageAction | Optional | Message action |
Field | Type | Required | Comments |
---|---|---|---|
update_id | Integer | Yes | Update ID |
message | Message | Optional | Messages (including text, media and forwarding messages) |
edited_message | Message | Optional | Edit the message |
callback_query | CallbackQuery | Optional | Callback inquiry |
Inline_query | InlineQuery | Optional | Incoming inline query |
lang | String | Optional | Current session client language type |
Field | Type | Required | Comments |
---|---|---|---|
user | User | Yes | Information about the user |
status | String | Yes | The member's status in the chat. Can be "creator", "administrator", "member", "restricted", "left" or "kicked" |
until_date | Integer | Optional | Restricted and kicked only. Date when restrictions will be lifted for this user, unix time |
can_be_edited | Boolean | Optional | Administrators only. True, if the bot is allowed to edit administrator privileges of that user |
can_change_info | Boolean | Optional | Administrators only. True, if the administrator can change the chat title, photo and other settings |
can_post_messages | Boolean | Optional | Administrators only. True, if the administrator can post in the channel, channels only |
can_edit_messages | Boolean | Optional | Administrators only. True, if the administrator can edit messages of other users and can pin messages, channels only |
can_delete_messages | Boolean | Optional | Administrators only. True, if the administrator can delete messages of other users |
can_invite_users | Boolean | Yes | Administrators only. True, if the administrator can invite new users to the chat |
can_restrict_members | Boolean | Optional | Administrators only. True, if the administrator can restrict, ban or unban chat members |
can_pin_messages | Boolean | Optional | Administrators only. True, if the administrator can pin messages, supergroups only |
can_promote_members | Boolean | Optional | Administrators only. True, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user) |
can_send_messages | Boolean | Optional | Restricted only. True, if the user can send text messages, contacts, locations and venues |
can_send_media_messages | Boolean | Optional | Restricted only. True, if the user can send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages |
can_send_other_messages | Boolean | Optional | Restricted only. True, if the user can send animations, games, stickers and use inline bots, implies can_send_media_messages |
can_add_web_page_previews | Boolean | Optional | Restricted only. True, if user may add web page previews to his messages, implies can_send_media_messages |
*this is italics*
_this is italics_
**This is bold font**
__This is also bold font__
***italics and bold***
___italics and bold___
`printf("Hello World!");`
<https://www.google.com/>
<username@mail.com>
[https://www.google.com/](https://www.google.com/)
[Tap here to open Google website](https://www.google.com/)
[/new_bot](cmd)
[@username](@)
[@username](@ 100500)
Code | Type |
---|---|
1001 | internal server error |
1002 | invalid token |
1003 | unknown command |
1004 | wrong parameters |
1005 | wrong format data |
1006 | no permission |
1007 | frequency of apis sent exceeded limit |
1008 | cannot send message to target user |
1009 | uploaded file size too large |
1010 | illegal characters in message |
1011 | entities" exceeds length limit |
1012 | reply markup" exceeds length limit |
1013 | file not exists |
1014 | request body too long |
1015 | robots are not in groups |
1016 | the group does not exist |
1017 | not support the chat type |
3002 | have been in black list |
3003 | does not found user info |
3004 | permission Denied |
3005 | the group does not exist or already upgrade to a super group |
3006 | user is not in the group |
3007 | object type error |
3008 | frequently message |
3009 | repeated message |
3010 | can not get group participant |
3011 | check media message error |
3012 | message not found |
3013 | get forward message list failed |
3014 | message too long |
3015 | message storage failed |
3016 | none pinned msg |
4048 | channel msg slow mode |
4049 | channel msg slow mode forward |
4050 | channel msg slow mode multi media |