Skip to content

Commit 958048e

Browse files
authored
Merge pull request #59 from OvyFlash/bot-api-7.11
BotAPI 7.11 implementation
2 parents 95cf1ee + 6485c6a commit 958048e

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

helper_structs.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ type BaseChat struct {
2424
ProtectContent bool
2525
ReplyMarkup interface{}
2626
DisableNotification bool
27+
AllowPaidBroadcast bool
2728
MessageEffectID string // for private chats only
2829
ReplyParameters ReplyParameters
2930
}
@@ -41,6 +42,7 @@ func (chat *BaseChat) params() (Params, error) {
4142

4243
params.AddNonZero("message_thread_id", chat.MessageThreadID)
4344
params.AddBool("disable_notification", chat.DisableNotification)
45+
params.AddBool("allow_paid_broadcast", chat.AllowPaidBroadcast)
4446
params.AddBool("protect_content", chat.ProtectContent)
4547
params.AddNonEmpty("message_effect_id", chat.MessageEffectID)
4648

@@ -65,8 +67,8 @@ func (file BaseFile) params() (Params, error) {
6567
// BaseEdit is base type of all chat edits.
6668
type BaseEdit struct {
6769
BaseChatMessage
68-
InlineMessageID string
69-
ReplyMarkup *InlineKeyboardMarkup
70+
InlineMessageID string
71+
ReplyMarkup *InlineKeyboardMarkup
7072
}
7173

7274
func (edit BaseEdit) params() (Params, error) {

types.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2512,6 +2512,10 @@ type InlineKeyboardButton struct {
25122512
//
25132513
//optional
25142514
SwitchInlineQueryChosenChat *SwitchInlineQueryChosenChat `json:"switch_inline_query_chosen_chat,omitempty"`
2515+
//CopyText is the description of the button that copies the specified text to the clipboard.
2516+
//
2517+
//optional
2518+
CopyText *CopyTextButton `json:"copy_text,omitempty"`
25152519
// CallbackGame description of the game that will be launched when the user presses the button.
25162520
//
25172521
// optional
@@ -2559,6 +2563,12 @@ type LoginURL struct {
25592563
RequestWriteAccess bool `json:"request_write_access,omitempty"`
25602564
}
25612565

2566+
// CopyTextButton represents an inline keyboard button that
2567+
// copies specified text to the clipboard.
2568+
type CopyTextButton struct {
2569+
Text string `json:"text"`
2570+
}
2571+
25622572
// CallbackQuery represents an incoming callback query from a callback button in
25632573
// an inline keyboard. If the button that originated the query was attached to a
25642574
// message sent by the bot, the field message will be present. If the button was
@@ -5233,13 +5243,15 @@ type RevenueWithdrawalState struct {
52335243
// - TransactionPartnerUser
52345244
// - TransactionPartnerFragment
52355245
// - TransactionPartnerTelegramAds
5246+
// - TransactionPartnerTelegramApi
52365247
// - TransactionPartnerOther
52375248
type TransactionPartner struct {
52385249
// Type of the transaction partner. Must be one of:
52395250
// - fragment
52405251
// - user
52415252
// - other
52425253
// - telegram_ads
5254+
// - telegram_api
52435255
Type string `json:"type"`
52445256
// State of the transaction if the transaction is outgoing.
52455257
// Represent only in "fragment" state
@@ -5260,6 +5272,12 @@ type TransactionPartner struct {
52605272
//
52615273
// optional
52625274
PaidMedia []PaidMedia `json:"paid_media,omitempty"`
5275+
// RequestCount is the number of successful requests that
5276+
// exceeded regular limits and were therefore billed
5277+
// Represent only in "telegram_api" state
5278+
//
5279+
// optional
5280+
RequestCount int `json:"request_count,omitempty"`
52635281
}
52645282

52655283
// StarTransaction describes a Telegram Star transaction.

0 commit comments

Comments
 (0)