1.0.0 beta 3

This commit is contained in:
2026-03-01 23:01:06 +03:00
parent a84e24ff25
commit 61562e8a3b
9 changed files with 151 additions and 35 deletions

View File

@@ -56,6 +56,7 @@ type PromoteChatMember struct {
CanPinMessages bool `json:"can_pin_messages,omitempty"`
CanManageTopics bool `json:"can_manage_topics,omitempty"`
CanManageDirectMessages bool `json:"can_manage_direct_messages,omitempty"`
CanManageTags bool `json:"can_manage_tags,omitempty"`
}
func (api *API) PromoteChatMember(params PromoteChatMember) (bool, error) {
@@ -74,6 +75,17 @@ func (api *API) SetChatAdministratorCustomTitle(params SetChatAdministratorCusto
return req.Do(api)
}
type SetChatMemberTagP struct {
ChatID int `json:"chat_id"`
UserID int `json:"user_id"`
Tag string `json:"tag,omitempty"`
}
func (api *API) SetChatMemberTag(params SetChatMemberTagP) (bool, error) {
req := NewRequest[bool]("setChatMemberTag", params)
return req.Do(api)
}
type BanChatSenderChatP struct {
ChatID int `json:"chat_id"`
SenderChatID int `json:"sender_chat_id"`

View File

@@ -99,6 +99,7 @@ type ChatPermissions struct {
CanSendPolls bool `json:"can_send_polls"`
CanSendOtherMessages bool `json:"can_send_other_messages"`
CanAddWebPagePreview bool `json:"can_add_web_page_preview"`
CatEditTag bool `json:"cat_edit_tag"`
CanChangeInfo bool `json:"can_change_info"`
CanInviteUsers bool `json:"can_invite_users"`
CanPinMessages bool `json:"can_pin_messages"`
@@ -137,6 +138,7 @@ const (
type ChatMember struct {
Status ChatMemberStatusType `json:"status"`
User User `json:"user"`
Tag string `json:"tag,omitempty"`
// Owner
IsAnonymous *bool `json:"is_anonymous"`
@@ -160,6 +162,7 @@ type ChatMember struct {
CanPinMessages *bool `json:"can_pin_messages,omitempty"`
CanManageTopics *bool `json:"can_manage_topics,omitempty"`
CanManageDirectMessages *bool `json:"can_manage_direct_messages,omitempty"`
CanManageTags *bool `json:"can_manage_tags,omitempty"`
// Member
UntilDate *int `json:"until_date,omitempty"`
@@ -175,6 +178,7 @@ type ChatMember struct {
CanSendPolls *bool `json:"can_send_polls,omitempty"`
CanSendOtherMessages *bool `json:"can_send_other_messages,omitempty"`
CanAddWebPagePreview *bool `json:"can_add_web_page_preview,omitempty"`
CanEditTag *bool `json:"can_edit_tag,omitempty"`
}
type ChatBoostSource struct {
@@ -215,6 +219,7 @@ type ChatAdministratorRights struct {
CanPinMessages *bool `json:"can_pin_messages,omitempty"`
CanManageTopics *bool `json:"can_manage_topics,omitempty"`
CanManageDirectMessages *bool `json:"can_manage_direct_messages,omitempty"`
CanManageTags *bool `json:"can_manage_tags,omitempty"`
}
type ChatBoostUpdated struct {

View File

@@ -268,7 +268,7 @@ func (api *API) SendDice(params SendDiceP) (Message, error) {
type SendMessageDraftP struct {
ChatID int `json:"chat_id"`
MessageThreadID int `json:"message_thread_id,omitempty"`
DraftID int `json:"draft_id"`
DraftID uint64 `json:"draft_id"`
Text string `json:"text"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
Entities []MessageEntity `json:"entities,omitempty"`

View File

@@ -12,10 +12,11 @@ type Message struct {
BusinessConnectionId string `json:"business_connection_id,omitempty"`
From *User `json:"from,omitempty"`
SenderChat *Chat `json:"sender_chat,omitempty"`
SenderBoostCount int `json:"sender_boost_count,omitempty"`
SenderBusinessBot *User `json:"sender_business_bot,omitempty"`
Chat *Chat `json:"chat,omitempty"`
SenderChat *Chat `json:"sender_chat,omitempty"`
SenderBoostCount int `json:"sender_boost_count,omitempty"`
SenderBusinessBot *User `json:"sender_business_bot,omitempty"`
SenderTag string `json:"sender_tag,omitempty"`
Chat *Chat `json:"chat,omitempty"`
IsTopicMessage bool `json:"is_topic_message,omitempty"`
IsAutomaticForward bool `json:"is_automatic_forward,omitempty"`
@@ -74,6 +75,7 @@ const (
MessageEntityTextLink MessageEntityType = "text_link"
MessageEntityTextMention MessageEntityType = "text_mention"
MessageEntityCustomEmoji MessageEntityType = "custom_emoji"
MessageEntityDateTime MessageEntityType = "date_time"
)
type MessageEntity struct {
@@ -85,6 +87,9 @@ type MessageEntity struct {
User *User `json:"user,omitempty"`
Language string `json:"language,omitempty"`
CustomEmojiID string `json:"custom_emoji_id,omitempty"`
UnixTime int `json:"unix_time,omitempty"`
DateTimeFormat string `json:"date_time_format,omitempty"`
}
type ReplyParameters struct {