Skip to content

Commit

Permalink
Bump github.com/PaulSonOfLars/gotgbot/v2 from 2.0.0-rc.7 to 2.0.0-rc.8 (
Browse files Browse the repository at this point in the history
#13)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ÁÑÑÍHÌLÅTØR SPÄRK <75305464+annihilatorrrr@users.noreply.github.com>
  • Loading branch information
dependabot[bot] and annihilatorrrr committed May 30, 2022
1 parent f76f0e6 commit 68af4bf
Show file tree
Hide file tree
Showing 16 changed files with 1,849 additions and 883 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ module github.com/DivideProjects/GoLangTgBot
// +heroku goVersion go1.18
go 1.18

require github.com/PaulSonOfLars/gotgbot/v2 v2.0.0-rc.7
require github.com/PaulSonOfLars/gotgbot/v2 v2.0.0-rc.8
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github.com/PaulSonOfLars/gotgbot/v2 v2.0.0-rc.7 h1:RxePxfaCjLIDkYgRWRvlzBvo6OHox+gAO/PZu/jQgkQ=
github.com/PaulSonOfLars/gotgbot/v2 v2.0.0-rc.7/go.mod h1:r815fYWTudnU9JhtsJAxUtuV7QrSgKpChJkfTSMFpfg=
github.com/PaulSonOfLars/gotgbot/v2 v2.0.0-rc.8 h1:ISVCuGnT0yYmdlfhJ8LQS4G2UXf9SuDWpvTSH86Mh2I=
github.com/PaulSonOfLars/gotgbot/v2 v2.0.0-rc.8/go.mod h1:r815fYWTudnU9JhtsJAxUtuV7QrSgKpChJkfTSMFpfg=
23 changes: 12 additions & 11 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ func main() {
b, err := gotgbot.NewBot(
botToken,
&gotgbot.BotOpts{
APIURL: apiUrl,
DefaultRequestOpts: &gotgbot.RequestOpts{
Timeout: gotgbot.DefaultTimeout,
APIURL: apiUrl,
},
Client: http.Client{},
GetTimeout: gotgbot.DefaultGetTimeout,
PostTimeout: gotgbot.DefaultPostTimeout,
},
)
if err != nil {
Expand Down Expand Up @@ -96,7 +97,7 @@ func start(bot *gotgbot.Bot, ctx *ext.Context) error {

// stay silent in group chats
if chat.Type != "private" {
return ext.EndGroups
return nil
}

text = fmt.Sprintf(
Expand All @@ -123,7 +124,7 @@ func start(bot *gotgbot.Bot, ctx *ext.Context) error {
return err
}

return ext.EndGroups
return nil
}

func help(bot *gotgbot.Bot, ctx *ext.Context) error {
Expand All @@ -134,7 +135,7 @@ func help(bot *gotgbot.Bot, ctx *ext.Context) error {

// stay silent in group chats
if chat.Type != "private" {
return ext.EndGroups
return nil
}

text = fmt.Sprint(
Expand All @@ -156,7 +157,7 @@ func help(bot *gotgbot.Bot, ctx *ext.Context) error {
return err
}

return ext.EndGroups
return nil
}

func source(bot *gotgbot.Bot, ctx *ext.Context) error {
Expand All @@ -167,7 +168,7 @@ func source(bot *gotgbot.Bot, ctx *ext.Context) error {

// stay silent in group chats
if chat.Type != "private" {
return ext.EndGroups
return nil
}

text = fmt.Sprintf(
Expand Down Expand Up @@ -198,21 +199,21 @@ func source(bot *gotgbot.Bot, ctx *ext.Context) error {
return err
}

return ext.EndGroups
return nil
}

func restrictChannels(bot *gotgbot.Bot, ctx *ext.Context) error {
msg := ctx.EffectiveMessage
chat := ctx.EffectiveChat
sender := ctx.EffectiveSender

_, err := msg.Delete(bot)
_, err := msg.Delete(bot, nil)
if err != nil {
fmt.Println("[RestrictChannels] Failed to delete message:", err.Error())
return err
}

_, err = chat.BanSenderChat(bot, sender.Id())
_, err = chat.BanSenderChat(bot, sender.Id(), nil)
if err != nil {
fmt.Println("[RestrictChannels] Failed to ban sender:", err.Error())
return err
Expand Down
2 changes: 1 addition & 1 deletion vendor/github.com/PaulSonOfLars/gotgbot/v2/.golangci.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 56 additions & 24 deletions vendor/github.com/PaulSonOfLars/gotgbot/v2/bot.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions vendor/github.com/PaulSonOfLars/gotgbot/v2/custom_helpers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/github.com/PaulSonOfLars/gotgbot/v2/ext/context.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions vendor/github.com/PaulSonOfLars/gotgbot/v2/ext/dispatcher.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 68af4bf

Please sign in to comment.