Merge pull request #1397 from crazy-max/dependabot/go_modules/github.com/PaulSonOfLars/gotgbot/v2-2.0.0-rc.32

chore(deps): bump github.com/PaulSonOfLars/gotgbot/v2 from 2.0.0-rc.30 to 2.0.0-rc.32
This commit is contained in:
CrazyMax
2025-06-15 00:30:37 +02:00
committed by GitHub
9 changed files with 2568 additions and 105 deletions

2
go.mod
View File

@@ -5,7 +5,7 @@ go 1.23.0
require (
dario.cat/mergo v1.0.1
github.com/AlecAivazis/survey/v2 v2.3.7
github.com/PaulSonOfLars/gotgbot/v2 v2.0.0-rc.30
github.com/PaulSonOfLars/gotgbot/v2 v2.0.0-rc.32
github.com/alecthomas/kong v1.6.1
github.com/bmatcuk/doublestar/v3 v3.0.0
github.com/containerd/platforms v0.2.1

4
go.sum
View File

@@ -15,8 +15,8 @@ github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERo
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s=
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w=
github.com/PaulSonOfLars/gotgbot/v2 v2.0.0-rc.30 h1:kPFkEzqg3+5gu077Zrg+24d0rO0Iwdx/ZUUHFFprfsc=
github.com/PaulSonOfLars/gotgbot/v2 v2.0.0-rc.30/go.mod h1:kL1v4iIjlalwm3gCYGvF4NLa3hs+aKEfRkNJvj4aoDU=
github.com/PaulSonOfLars/gotgbot/v2 v2.0.0-rc.32 h1:+YzI72wzNTcaPUDVcSxeYQdHfvEk8mPGZh/yTk5kkRg=
github.com/PaulSonOfLars/gotgbot/v2 v2.0.0-rc.32/go.mod h1:BSzsfjlE0wakLw2/U1FtO8rdVt+Z+4VyoGo/YcGD9QQ=
github.com/PuerkitoBio/goquery v1.5.0/go.mod h1:qD2PgZ9lccMbQlc7eEOjaeRlFQON7xY8kdmcsrnKqMg=
github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM=
github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ=

View File

@@ -21,9 +21,6 @@ output:
# print linter name in the end of issue text, default is true
print-linter-name: true
# make issues output unique by line, default is true
uniq-by-line: true
# sorts results by: filepath, line and column
sort-results: true
@@ -44,7 +41,7 @@ linters:
- durationcheck
- errorlint
- exhaustive
- exportloopref
- copyloopvar
- forbidigo
- forcetypeassert
- godot
@@ -72,6 +69,9 @@ linters:
- unparam
- wastedassign
issues:
# make issues output unique by line, default is true
uniq-by-line: true
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- path: samples/

View File

@@ -7,20 +7,20 @@ type ParsedMessageEntity struct {
Text string `json:"text"`
}
// ParseEntities calls Message.ParseEntity on all message text entities.
func (m Message) ParseEntities() (out []ParsedMessageEntity) {
return m.ParseEntityTypes(nil)
// ParseEntity parses a single MessageEntity into a ParsedMessageEntity.
func ParseEntity(text string, entity MessageEntity) ParsedMessageEntity {
return parseEntity(entity, utf16.Encode([]rune(text)))
}
// ParseCaptionEntities calls Message.ParseEntity on all message caption entities.
func (m Message) ParseCaptionEntities() (out []ParsedMessageEntity) {
return m.ParseCaptionEntityTypes(nil)
// ParseEntities parses all MessageEntity items into a list of ParsedMessageEntity.
func ParseEntities(text string, entities []MessageEntity) (out []ParsedMessageEntity) {
return ParseEntityTypes(text, entities, nil)
}
// ParseEntityTypes calls Message.ParseEntity on a subset of message text entities.
func (m Message) ParseEntityTypes(accepted map[string]struct{}) (out []ParsedMessageEntity) {
utf16Text := utf16.Encode([]rune(m.Text))
for _, ent := range m.Entities {
// ParseEntityTypes parses a subset of MessageEntity items into a list of ParsedMessageEntity.
func ParseEntityTypes(text string, entities []MessageEntity, accepted map[string]struct{}) (out []ParsedMessageEntity) {
utf16Text := utf16.Encode([]rune(text))
for _, ent := range entities {
if _, ok := accepted[ent.Type]; ok || accepted == nil {
out = append(out, parseEntity(ent, utf16Text))
}
@@ -28,25 +28,34 @@ func (m Message) ParseEntityTypes(accepted map[string]struct{}) (out []ParsedMes
return out
}
// ParseCaptionEntityTypes calls Message.ParseEntity on a subset of message caption entities.
// ParseEntities parses all message text entities into a list of ParsedMessageEntity.
func (m Message) ParseEntities() (out []ParsedMessageEntity) {
return m.ParseEntityTypes(nil)
}
// ParseCaptionEntities parses all message caption entities into a list of ParsedMessageEntity.
func (m Message) ParseCaptionEntities() (out []ParsedMessageEntity) {
return m.ParseCaptionEntityTypes(nil)
}
// ParseEntityTypes parses a subset of message text entities into a list of ParsedMessageEntity.
func (m Message) ParseEntityTypes(accepted map[string]struct{}) (out []ParsedMessageEntity) {
return ParseEntityTypes(m.Text, m.Entities, accepted)
}
// ParseCaptionEntityTypes parses a subset of message caption entities into a list of ParsedMessageEntity.
func (m Message) ParseCaptionEntityTypes(accepted map[string]struct{}) (out []ParsedMessageEntity) {
utf16Caption := utf16.Encode([]rune(m.Caption))
for _, ent := range m.CaptionEntities {
if _, ok := accepted[ent.Type]; ok || accepted == nil {
out = append(out, parseEntity(ent, utf16Caption))
}
}
return out
return ParseEntityTypes(m.Caption, m.CaptionEntities, accepted)
}
// ParseEntity parses a single message text entity to populate text contents, URL, and offsets in UTF8.
func (m Message) ParseEntity(entity MessageEntity) ParsedMessageEntity {
return parseEntity(entity, utf16.Encode([]rune(m.Text)))
return ParseEntity(m.Text, entity)
}
// ParseCaptionEntity parses a single message caption entity to populate text contents, URL, and offsets in UTF8.
func (m Message) ParseCaptionEntity(entity MessageEntity) ParsedMessageEntity {
return parseEntity(entity, utf16.Encode([]rune(m.Caption)))
return ParseEntity(m.Caption, entity)
}
func parseEntity(entity MessageEntity, utf16Text []uint16) ParsedMessageEntity {

View File

@@ -121,6 +121,11 @@ func (c Chat) PromoteMember(b *Bot, userId int64, opts *PromoteChatMemberOpts) (
return b.PromoteChatMember(c.Id, userId, opts)
}
// RemoveVerification Helper method for Bot.RemoveChatVerification.
func (c Chat) RemoveVerification(b *Bot, opts *RemoveChatVerificationOpts) (bool, error) {
return b.RemoveChatVerification(c.Id, opts)
}
// RestrictMember Helper method for Bot.RestrictChatMember.
func (c Chat) RestrictMember(b *Bot, userId int64, permissions ChatPermissions, opts *RestrictChatMemberOpts) (bool, error) {
return b.RestrictChatMember(c.Id, userId, permissions, opts)
@@ -199,6 +204,16 @@ func (c Chat) UnpinMessage(b *Bot, opts *UnpinChatMessageOpts) (bool, error) {
return b.UnpinChatMessage(c.Id, opts)
}
// Verify Helper method for Bot.VerifyChat.
func (c Chat) Verify(b *Bot, opts *VerifyChatOpts) (bool, error) {
return b.VerifyChat(c.Id, opts)
}
// Send Helper method for Bot.SendGift.
func (g Gift) Send(b *Bot, opts *SendGiftOpts) (bool, error) {
return b.SendGift(g.Id, opts)
}
// Copy Helper method for Bot.CopyMessage.
func (im InaccessibleMessage) Copy(b *Bot, chatId int64, opts *CopyMessageOpts) (*MessageId, error) {
return b.CopyMessage(chatId, im.Chat.Id, im.MessageId, opts)
@@ -299,6 +314,11 @@ func (im InaccessibleMessage) Pin(b *Bot, opts *PinChatMessageOpts) (bool, error
return b.PinChatMessage(im.Chat.Id, im.MessageId, opts)
}
// ReadBusiness Helper method for Bot.ReadBusinessMessage.
func (im InaccessibleMessage) ReadBusiness(b *Bot, businessConnectionId string, opts *ReadBusinessMessageOpts) (bool, error) {
return b.ReadBusinessMessage(businessConnectionId, im.Chat.Id, im.MessageId, opts)
}
// SetReaction Helper method for Bot.SetMessageReaction.
func (im InaccessibleMessage) SetReaction(b *Bot, opts *SetMessageReactionOpts) (bool, error) {
return b.SetMessageReaction(im.Chat.Id, im.MessageId, opts)
@@ -438,6 +458,11 @@ func (m Message) Pin(b *Bot, opts *PinChatMessageOpts) (bool, error) {
return b.PinChatMessage(m.Chat.Id, m.MessageId, opts)
}
// ReadBusiness Helper method for Bot.ReadBusinessMessage.
func (m Message) ReadBusiness(b *Bot, businessConnectionId string, opts *ReadBusinessMessageOpts) (bool, error) {
return b.ReadBusinessMessage(businessConnectionId, m.Chat.Id, m.MessageId, opts)
}
// SetReaction Helper method for Bot.SetMessageReaction.
func (m Message) SetReaction(b *Bot, opts *SetMessageReactionOpts) (bool, error) {
return b.SetMessageReaction(m.Chat.Id, m.MessageId, opts)
@@ -482,6 +507,21 @@ func (sq ShippingQuery) Answer(b *Bot, ok bool, opts *AnswerShippingQueryOpts) (
return b.AnswerShippingQuery(sq.Id, ok, opts)
}
// Delete Helper method for Bot.DeleteStory.
func (s Story) Delete(b *Bot, businessConnectionId string, opts *DeleteStoryOpts) (bool, error) {
return b.DeleteStory(businessConnectionId, s.Id, opts)
}
// Edit Helper method for Bot.EditStory.
func (s Story) Edit(b *Bot, businessConnectionId string, content InputStoryContent, opts *EditStoryOpts) (*Story, error) {
return b.EditStory(businessConnectionId, s.Id, content, opts)
}
// EditStarSubscription Helper method for Bot.EditUserStarSubscription.
func (u User) EditStarSubscription(b *Bot, telegramPaymentChargeId string, isCanceled bool, opts *EditUserStarSubscriptionOpts) (bool, error) {
return b.EditUserStarSubscription(u.Id, telegramPaymentChargeId, isCanceled, opts)
}
// GetChatBoosts Helper method for Bot.GetUserChatBoosts.
func (u User) GetChatBoosts(b *Bot, chatId int64, opts *GetUserChatBoostsOpts) (*UserChatBoosts, error) {
return b.GetUserChatBoosts(chatId, u.Id, opts)
@@ -491,3 +531,18 @@ func (u User) GetChatBoosts(b *Bot, chatId int64, opts *GetUserChatBoostsOpts) (
func (u User) GetProfilePhotos(b *Bot, opts *GetUserProfilePhotosOpts) (*UserProfilePhotos, error) {
return b.GetUserProfilePhotos(u.Id, opts)
}
// RemoveVerification Helper method for Bot.RemoveUserVerification.
func (u User) RemoveVerification(b *Bot, opts *RemoveUserVerificationOpts) (bool, error) {
return b.RemoveUserVerification(u.Id, opts)
}
// SetEmojiStatus Helper method for Bot.SetUserEmojiStatus.
func (u User) SetEmojiStatus(b *Bot, opts *SetUserEmojiStatusOpts) (bool, error) {
return b.SetUserEmojiStatus(u.Id, opts)
}
// Verify Helper method for Bot.VerifyUser.
func (u User) Verify(b *Bot, opts *VerifyUserOpts) (bool, error) {
return b.VerifyUser(u.Id, opts)
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1 @@
15b6cd15658668b7017f3c069e27405ca4f4428e
2b29b473568cc837e56d95160b3f8409e1318537

4
vendor/modules.txt vendored
View File

@@ -25,8 +25,8 @@ github.com/Microsoft/go-winio/internal/fs
github.com/Microsoft/go-winio/internal/socket
github.com/Microsoft/go-winio/internal/stringbuffer
github.com/Microsoft/go-winio/pkg/guid
# github.com/PaulSonOfLars/gotgbot/v2 v2.0.0-rc.30
## explicit; go 1.19
# github.com/PaulSonOfLars/gotgbot/v2 v2.0.0-rc.32
## explicit; go 1.22
github.com/PaulSonOfLars/gotgbot/v2
# github.com/PuerkitoBio/goquery v1.8.1
## explicit; go 1.13