Skip to content

Commit

Permalink
update disgo version
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Nov 24, 2022
1 parent 8a98d51 commit 7273353
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 26 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

"github.com/KittyBot-Org/KittyBotGo/db"
"github.com/disgoorg/disgo/json"
"github.com/disgoorg/json"
"github.com/disgoorg/log"
"github.com/disgoorg/snowflake/v2"
)
Expand Down
4 changes: 2 additions & 2 deletions dbot/commands/report-user.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"github.com/KittyBot-Org/KittyBotGo/dbot"
"github.com/disgoorg/disgo/discord"
"github.com/disgoorg/disgo/events"
"github.com/disgoorg/disgo/json"
"github.com/disgoorg/handler"
"github.com/disgoorg/json"
)

func ReportUser(b *dbot.Bot) handler.Command {
Expand Down Expand Up @@ -81,7 +81,7 @@ func reportUserHandler(b *dbot.Bot) handler.CommandHandler {
IconURL: user.EffectiveAvatarURL(),
},
Description: "Reason:\n" + reason,
Timestamp: json.NewPtr(e.ID().Time()),
Timestamp: json.Ptr(e.ID().Time()),
},
)
}
Expand Down
10 changes: 5 additions & 5 deletions dbot/commands/report_components.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"github.com/KittyBot-Org/KittyBotGo/dbot"
"github.com/disgoorg/disgo/discord"
"github.com/disgoorg/disgo/events"
"github.com/disgoorg/disgo/json"
"github.com/disgoorg/disgo/rest"
"github.com/disgoorg/handler"
"github.com/disgoorg/json"
"github.com/disgoorg/snowflake/v2"
)

Expand Down Expand Up @@ -133,7 +133,7 @@ func reportConfirmHandler(b *dbot.Bot) handler.ComponentHandler {
discord.SelectMenuComponent{
CustomID: fmt.Sprintf("handler:report-action:%d", reportID),
Placeholder: "Select an action",
MinValues: json.NewPtr(1),
MinValues: json.Ptr(1),
MaxValues: 1,
Options: selectMenuOptions,
},
Expand Down Expand Up @@ -260,7 +260,7 @@ func reportActionHandler(b *dbot.Bot) handler.ComponentHandler {
CustomID: "duration",
Style: discord.TextInputStyleShort,
Label: "Timeout Duration",
MinLength: json.NewPtr(2),
MinLength: json.Ptr(2),
Required: true,
Placeholder: "time units: s, m, h example: 1h3s",
Value: "1h",
Expand Down Expand Up @@ -307,7 +307,7 @@ func reportActionHandler(b *dbot.Bot) handler.ComponentHandler {
CustomID: "del-days",
Style: discord.TextInputStyleShort,
Label: "Message Delete Days",
MinLength: json.NewPtr(1),
MinLength: json.Ptr(1),
MaxLength: 1,
Required: true,
Placeholder: "0-7",
Expand Down Expand Up @@ -354,7 +354,7 @@ func reportActionConfirmHandler(b *dbot.Bot) handler.ModalHandler {
} else {
until = until.Add(duration)
if _, err = b.Client.Rest().UpdateMember(*e.GuildID(), userID, discord.MemberUpdate{
CommunicationDisabledUntil: json.NewOptional(until),
CommunicationDisabledUntil: json.NewNullablePtr(until),
}, rest.WithReason(reason)); err != nil {
b.Logger.Errorf("Failed to update member: %s", err)
content = "Failed to timeout user, please reach out to a bot developer."
Expand Down
4 changes: 2 additions & 2 deletions dbot/commands/reports.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/KittyBot-Org/KittyBotGo/dbot"
"github.com/disgoorg/disgo/discord"
"github.com/disgoorg/disgo/events"
"github.com/disgoorg/disgo/json"
"github.com/disgoorg/handler"
"github.com/disgoorg/json"
)

func Reports(b *dbot.Bot) handler.Command {
Expand Down Expand Up @@ -75,7 +75,7 @@ func Reports(b *dbot.Bot) handler.Command {
},
},
},
DefaultMemberPermissions: json.NewOptional(discord.PermissionKickMembers | discord.PermissionBanMembers | discord.PermissionModerateMembers),
DefaultMemberPermissions: json.NewNullablePtr(discord.PermissionKickMembers | discord.PermissionBanMembers | discord.PermissionModerateMembers),
},
CommandHandlers: map[string]handler.CommandHandler{
"view": reportsViewHandler(b),
Expand Down
4 changes: 2 additions & 2 deletions dbot/commands/seek.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"github.com/KittyBot-Org/KittyBotGo/dbot/responses"
"github.com/disgoorg/disgo/discord"
"github.com/disgoorg/disgo/events"
"github.com/disgoorg/disgo/json"
"github.com/disgoorg/disgolink/lavalink"
"github.com/disgoorg/handler"
"github.com/disgoorg/json"
)

func Seek(b *dbot.Bot) handler.Command {
Expand All @@ -20,7 +20,7 @@ func Seek(b *dbot.Bot) handler.Command {
Name: "position",
Description: "The position to seek to in seconds(default)/minutes/hours",
Required: true,
MinValue: json.NewPtr(0),
MinValue: json.Ptr(0),
},
discord.ApplicationCommandOptionInt{
Name: "time-unit",
Expand Down
6 changes: 3 additions & 3 deletions dbot/commands/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/KittyBot-Org/KittyBotGo/dbot"
"github.com/disgoorg/disgo/discord"
"github.com/disgoorg/disgo/events"
"github.com/disgoorg/disgo/json"
"github.com/disgoorg/handler"
"github.com/disgoorg/json"
"github.com/disgoorg/snowflake/v2"
)

Expand Down Expand Up @@ -41,7 +41,7 @@ func Settings(b *dbot.Bot) handler.Command {
},
},
},
DefaultMemberPermissions: json.NewOptional(discord.PermissionManageServer),
DefaultMemberPermissions: json.NewNullablePtr(discord.PermissionManageServer),
},
CommandHandlers: map[string]handler.CommandHandler{
"moderation/disable": settingsModerationDisableHandler(b),
Expand Down Expand Up @@ -102,7 +102,7 @@ func settingsModerationEnableHandler(b *dbot.Bot) handler.CommandHandler {
}
} else {
if _, err = b.Client.Rest().UpdateWebhook(snowflake.MustParse(settings.ModerationLogWebhookID), discord.WebhookUpdate{
ChannelID: json.NewPtr(data.Snowflake("channel")),
ChannelID: json.Ptr(data.Snowflake("channel")),
}); err != nil {
b.Logger.Errorf("Error updating webhook: %s", err)
return e.CreateMessage(discord.MessageCreate{
Expand Down
6 changes: 3 additions & 3 deletions dbot/commands/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"github.com/KittyBot-Org/KittyBotGo/dbot/responses"
"github.com/disgoorg/disgo/discord"
"github.com/disgoorg/disgo/events"
"github.com/disgoorg/disgo/json"
"github.com/disgoorg/handler"
"github.com/disgoorg/json"
)

func Volume(bot *dbot.Bot) handler.Command {
Expand All @@ -19,8 +19,8 @@ func Volume(bot *dbot.Bot) handler.Command {
Name: "volume",
Description: "The new volume",
Required: true,
MinValue: json.NewPtr(0),
MaxValue: json.NewPtr(100),
MinValue: json.Ptr(0),
MaxValue: json.Ptr(100),
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions dbot/listeners/moderation.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/disgoorg/disgo/bot"
"github.com/disgoorg/disgo/discord"
"github.com/disgoorg/disgo/events"
"github.com/disgoorg/disgo/json"
"github.com/disgoorg/json"
"github.com/disgoorg/snowflake/v2"
)

Expand Down Expand Up @@ -83,7 +83,7 @@ func Moderation(b *dbot.Bot) bot.EventListener {
},
Description: e.Content,
Fields: fields,
Timestamp: json.NewPtr(time.Now()),
Timestamp: json.Ptr(time.Now()),
},
)
if err != nil {
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ module github.com/KittyBot-Org/KittyBotGo
go 1.18

require (
github.com/disgoorg/disgo v0.13.21
github.com/disgoorg/disgo v0.13.22
github.com/disgoorg/disgolink/disgolink v1.7.4
github.com/disgoorg/disgolink/lavalink v1.7.3
github.com/disgoorg/handler v0.3.0
github.com/disgoorg/json v1.0.0
github.com/disgoorg/log v1.2.0
github.com/disgoorg/snowflake/v2 v2.0.1
github.com/disgoorg/source-plugins v1.3.1-0.20221009162536-28cea64ea737
Expand Down Expand Up @@ -36,7 +37,7 @@ require (
github.com/prometheus/procfs v0.8.0 // indirect
github.com/sasha-s/go-csync v0.0.0-20210812194225-61421b77c44b // indirect
github.com/stretchr/testify v1.8.1 // indirect
golang.org/x/exp v0.0.0-20221111204811-129d8d6c17ab // indirect
golang.org/x/exp v0.0.0-20221114191408-850992195362 // indirect
golang.org/x/sys v0.2.0 // indirect
golang.org/x/text v0.4.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
Expand Down
10 changes: 6 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,16 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/disgoorg/disgo v0.13.21 h1:mapasORJIZWGMcsAxTzosIHfBlx39g2KLbY/OJlJn3A=
github.com/disgoorg/disgo v0.13.21/go.mod h1:VpRp9ifKNcQ05mgIx9l5oU4TADysXUGmNx9iHM9/DpA=
github.com/disgoorg/disgo v0.13.22 h1:Vf49TkfC5djuMTbS9qdg/pr/pCNUxHQtx8/dMPu3aWI=
github.com/disgoorg/disgo v0.13.22/go.mod h1:YiVpXSmyXLRalYQHTHUFWEQvolCNzw0zh6nfug07b/M=
github.com/disgoorg/disgolink/disgolink v1.7.4 h1:JqiB9fOMxEZHktfHc0LZVOCiNLVmkmtlIic8qDTd5W0=
github.com/disgoorg/disgolink/disgolink v1.7.4/go.mod h1:qbYYCPJvmoBSxDnk+UznKRYa86QMsIZKQxfv9joBVr4=
github.com/disgoorg/disgolink/lavalink v1.7.3 h1:i3wThR0CWWvabhR/HSYM8b6Ln7Ex3ZgX6Hs4VZ+ZSV0=
github.com/disgoorg/disgolink/lavalink v1.7.3/go.mod h1:e/oo6afxnHvjkgGeJYrDazVIJEsQuWVSFahsek+K1mo=
github.com/disgoorg/handler v0.3.0 h1:jT78k9tUeLm96yNJBVi8N8rNMU0f4pf71Je3U/IbpXA=
github.com/disgoorg/handler v0.3.0/go.mod h1:oGRTTnVSS14auraNSEURCYf7/lk+y6fB2/7R29MjH1w=
github.com/disgoorg/json v1.0.0 h1:kDhSM661fgIuNoZF3BO5/odaR5NSq80AWb937DH+Pdo=
github.com/disgoorg/json v1.0.0/go.mod h1:BHDwdde0rpQFDVsRLKhma6Y7fTbQKub/zdGO5O9NqqA=
github.com/disgoorg/log v1.2.0 h1:sqlXnu/ZKAlIlHV9IO+dbMto7/hCQ474vlIdMWk8QKo=
github.com/disgoorg/log v1.2.0/go.mod h1:3x1KDG6DI1CE2pDwi3qlwT3wlXpeHW/5rVay+1qDqOo=
github.com/disgoorg/snowflake/v2 v2.0.1 h1:CuUxGLwggUxEswZOmZ+mZ5i0xSumQdXW9tXW7uGqe+0=
Expand Down Expand Up @@ -358,8 +360,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20221111204811-129d8d6c17ab h1:1S7USr8/C0Sgk4egxq4zZ07zYt2Xh1IiFp8hUMXH/us=
golang.org/x/exp v0.0.0-20221111204811-129d8d6c17ab/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/exp v0.0.0-20221114191408-850992195362 h1:NoHlPRbyl1VFI6FjwHtPQCN7wAMXI6cKcqrmXhOOfBQ=
golang.org/x/exp v0.0.0-20221114191408-850992195362/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
Expand Down

0 comments on commit 7273353

Please sign in to comment.