Skip to content

Commit

Permalink
MD API 6.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
IRus committed Aug 19, 2023
1 parent 1fd2bc1 commit 3396e55
Show file tree
Hide file tree
Showing 11 changed files with 29,464 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core-gen/src/main/kotlin/Generate.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import kotlinx.serialization.json.Json
fun main() {
// https://ark0f.github.io/tg-bot-api/custom.json
val apiJson = {}::class.java
.getResource("api670.json")
.getResource("api680.json")
?.readText()
?: error("custom.json not found")

Expand Down
1 change: 1 addition & 0 deletions core-gen/src/main/kotlin/Parse.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ fun main() {
"api650",
"api660",
"api670",
"api680",
).forEach { v ->
val input = rootPath.resolve(v).readText()
val output = processVersion(input)
Expand Down
11,395 changes: 11,395 additions & 0 deletions core-gen/src/main/resources/api680

Large diffs are not rendered by default.

13,158 changes: 13,158 additions & 0 deletions core-gen/src/main/resources/api680.json

Large diffs are not rendered by default.

4,825 changes: 4,825 additions & 0 deletions core-gen/src/main/resources/api680.md

Large diffs are not rendered by default.

32 changes: 30 additions & 2 deletions core-gen/src/main/resources/latest.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ create and set up a bot, please consult our Introduction to Bots and Bot FAQ.

> Subscribe to @BotNews to be the first to know about the latest updates and join the discussion in @BotTalk
#### August 18, 2023

Bot API 6.8

* Added the field story to the class Message for messages with forwarded stories. Currently, it holds no information.
* Added the field voter_chat to the class PollAnswer, to contain channel chat voters in Polls. For backward
compatibility, the field user in such objects will contain the user 136817688 (@Channel_Bot).
* Added the field emoji_status_expiration_date to the class Chat.
* Added the method unpinAllGeneralForumTopicMessages.
* Increased to 512 characters the maximum length of the startapp parameter in direct Web App links.

#### April 21, 2023

Bot API 6.7
Expand Down Expand Up @@ -289,6 +300,7 @@ This object represents a chat.
| photo | ChatPhoto | Optional. Chat photo. Returned only in getChat. |
| active_usernames | Array of String | Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat. |
| emoji_status_custom_emoji_id | String | Optional. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat. |
| emoji_status_expiration_date | Integer | Optional. Expiration date of the emoji status of the other party in a private chat, if any. Returned only in getChat. |
| bio | String | Optional. Bio of the other party in a private chat. Returned only in getChat. |
| has_private_forwards | True | Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat. |
| has_restricted_voice_and_video_messages | True | Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat. |
Expand Down Expand Up @@ -342,6 +354,7 @@ This object represents a message.
| document | Document | Optional. Message is a general file, information about the file |
| photo | Array of PhotoSize | Optional. Message is a photo, available sizes of the photo |
| sticker | Sticker | Optional. Message is a sticker, information about the sticker |
| story | Story | Optional. Message is a forwarded story |
| video | Video | Optional. Message is a video, information about the video |
| video_note | VideoNote | Optional. Message is a video note, information about the video message |
| voice | Voice | Optional. Message is a voice message, information about the file |
Expand Down Expand Up @@ -472,6 +485,10 @@ This object represents a general file (as opposed to photos, voice messages and
| mime_type | String | Optional. MIME type of the file as defined by sender |
| file_size | Integer | Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. |

#### Story

This object represents a message about a forwarded story in the chat. Currently holds no information.

#### Video

This object represents a video file.
Expand Down Expand Up @@ -557,8 +574,9 @@ This object represents an answer of a user in a non-anonymous poll.
| --- | --- | --- |
| |
| poll_id | String | Unique poll identifier |
| user | User | The user, who changed the answer to the poll |
| option_ids | Array of Integer | 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote. |
| voter_chat | Chat | Optional. The chat that changed the answer to the poll, if the voter is anonymous |
| user | User | Optional. The user that changed the answer to the poll, if the voter isn't anonymous |
| option_ids | Array of Integer | 0-based identifiers of chosen answer options. May be empty if the vote was retracted. |

#### Poll

Expand Down Expand Up @@ -2541,6 +2559,16 @@ for this to work and must have the can_manage_topics administrator rights. Retur
| |
| chat_id | Integer or String | Yes | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |

#### unpinAllGeneralForumTopicMessages

Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the
chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| |
| chat_id | Integer or String | Yes | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |

#### answerCallbackQuery

Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package io.heapy.kotbot.bot.method

import io.heapy.kotbot.bot.Method
import io.heapy.kotbot.bot.Response
import io.heapy.kotbot.bot.model.ChatId
import kotlin.Boolean
import kotlin.String
import kotlinx.serialization.KSerializer
import kotlinx.serialization.Serializable
import kotlinx.serialization.builtins.serializer

/**
* Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the *can_pin_messages* administrator right in the supergroup. Returns *True* on success.
*/
@Serializable
public data class UnpinAllGeneralForumTopicMessages(
/**
* Unique identifier for the target chat or username of the target supergroup (in the format `@supergroupusername`)
*/
public val chat_id: ChatId,
) : Method<UnpinAllGeneralForumTopicMessages, Boolean> by Companion {
public companion object : Method<UnpinAllGeneralForumTopicMessages, Boolean> {
override val _deserializer: KSerializer<Response<Boolean>> =
Response.serializer(Boolean.serializer())

override val _serializer: KSerializer<UnpinAllGeneralForumTopicMessages> = serializer()

override val _name: String = "unpinAllGeneralForumTopicMessages"
}
}
4 changes: 4 additions & 0 deletions core/src/generated/kotlin/io/heapy/kotbot/bot/model/Chat.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ public data class Chat(
* *Optional*. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in [getChat](https://core.telegram.org/bots/api/#getchat).
*/
public val emoji_status_custom_emoji_id: String? = null,
/**
* *Optional*. Expiration date of the emoji status of the other party in a private chat, if any. Returned only in [getChat](https://core.telegram.org/bots/api/#getchat).
*/
public val emoji_status_expiration_date: Int? = null,
/**
* *Optional*. Bio of the other party in a private chat. Returned only in [getChat](https://core.telegram.org/bots/api/#getchat).
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ public data class Message(
* *Optional*. Message is a sticker, information about the sticker
*/
public val sticker: Sticker? = null,
/**
* *Optional*. Message is a forwarded story
*/
public val story: Story? = null,
/**
* *Optional*. Message is a video, information about the video
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ public data class PollAnswer(
*/
public val poll_id: String,
/**
* The user, who changed the answer to the poll
* *Optional*. The chat that changed the answer to the poll, if the voter is anonymous
*/
public val user: User,
public val voter_chat: Chat? = null,
/**
* 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.
* *Optional*. The user that changed the answer to the poll, if the voter isn't anonymous
*/
public val user: User? = null,
/**
* 0-based identifiers of chosen answer options. May be empty if the vote was retracted.
*/
public val option_ids: List<Int>,
)
9 changes: 9 additions & 0 deletions core/src/generated/kotlin/io/heapy/kotbot/bot/model/Story.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package io.heapy.kotbot.bot.model

import kotlinx.serialization.Serializable

/**
* This object represents a message about a forwarded story in the chat. Currently holds no information.
*/
@Serializable
public class Story

0 comments on commit 3396e55

Please sign in to comment.