Skip to content

Commit

Permalink
api: add missing methods
Browse files Browse the repository at this point in the history
  • Loading branch information
demget committed Aug 10, 2024
1 parent 7ee7bd3 commit cc61a96
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
7 changes: 6 additions & 1 deletion api.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type API interface {
ApproveJoinRequest(chat Recipient, user *User) error
Ban(chat *Chat, member *ChatMember, revokeMessages ...bool) error
BanSenderChat(chat *Chat, sender Recipient) error
BusinessConnection(id string) (*BusinessConnection, error)
ChatByID(id int64) (*Chat, error)
ChatByUsername(name string) (*Chat, error)
ChatMemberOf(chat, user Recipient) (*ChatMember, error)
Expand Down Expand Up @@ -65,16 +66,19 @@ type API interface {
Pin(msg Editable, opts ...interface{}) error
ProfilePhotosOf(user *User) ([]Photo, error)
Promote(chat *Chat, member *ChatMember) error
React(to Recipient, msg Editable, opts ...ReactionOptions) error
React(to Recipient, msg Editable, r Reactions) error
RefundStars(to Recipient, chargeID string) error
RemoveWebhook(dropPending ...bool) error
ReopenGeneralTopic(chat *Chat) error
ReopenTopic(chat *Chat, topic *Topic) error
ReplaceStickerInSet(of Recipient, stickerSet, oldSticker string, sticker InputSticker) (bool, error)
Reply(to *Message, what interface{}, opts ...interface{}) (*Message, error)
Respond(c *Callback, resp ...*CallbackResponse) error
Restrict(chat *Chat, member *ChatMember) error
RevokeInviteLink(chat Recipient, link string) (*ChatInviteLink, error)
Send(to Recipient, what interface{}, opts ...interface{}) (*Message, error)
SendAlbum(to Recipient, a Album, opts ...interface{}) ([]Message, error)
SendPaid(to Recipient, stars int, a PaidAlbum, opts ...interface{}) (*Message, error)
SetAdminTitle(chat *Chat, user *User, title string) error
SetCommands(opts ...interface{}) error
SetCustomEmojiStickerSetThumb(name, id string) error
Expand All @@ -96,6 +100,7 @@ type API interface {
SetStickerSetTitle(s StickerSet) error
SetWebhook(w *Webhook) error
Ship(query *ShippingQuery, what ...interface{}) error
StarTransactions(offset, limit int) ([]StarTransaction, error)
StickerSet(name string) (*StickerSet, error)
StopLiveLocation(msg Editable, opts ...interface{}) (*Message, error)
StopPoll(msg Editable, opts ...interface{}) (*Poll, error)
Expand Down
28 changes: 13 additions & 15 deletions markup.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,22 +263,20 @@ type ReplyRecipient struct {

// RecipientShared combines both UserShared and ChatShared objects.
type RecipientShared struct {
ID int32 `json:"request_id"` // chat, users
Users []SharedUser `json:"users"` // users only
ChatID int64 `json:"chat_id"` // chat only
Title string `json:"title"` // chat only
Username string `json:"username"` // chat only
Photo *Photo `json:"photo"` // chat only
}
ID int32 `json:"request_id"` // chat, users
ChatID int64 `json:"chat_id"` // chat only
Title string `json:"title"` // chat only
Username string `json:"username"` // chat only
Photo *Photo `json:"photo"` // chat only

Users []struct {
UserID int64 `json:"user_id"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Username string `json:"username"`
Photo *Photo `json:"photo"`
} `json:"users"` // users only

// SharedUser contains information about a user that was shared
// with the bot using a KeyboardButtonRequestUsers button.
type SharedUser struct {
UserID int64 `json:"user_id"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Username string `json:"username"`
Photo []photoSize `json:"photo"`
}

// InlineButton represents a button displayed in the message.
Expand Down
2 changes: 1 addition & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ type SendOptions struct {
// Unique identifier of the business connection
BusinessConnectionID string

// Unique identifier of the message effect to be added to the message; for private chats only
// Unique identifier of the message effect to be added to the message; for private chats only
EffectID string
}

Expand Down

0 comments on commit cc61a96

Please sign in to comment.