Skip to content

Commit 7273353

Browse files
committed
update disgo version
1 parent 8a98d51 commit 7273353

File tree

10 files changed

+29
-26
lines changed

10 files changed

+29
-26
lines changed

config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"os"
66

77
"github.com/KittyBot-Org/KittyBotGo/db"
8-
"github.com/disgoorg/disgo/json"
8+
"github.com/disgoorg/json"
99
"github.com/disgoorg/log"
1010
"github.com/disgoorg/snowflake/v2"
1111
)

dbot/commands/report-user.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"github.com/KittyBot-Org/KittyBotGo/dbot"
88
"github.com/disgoorg/disgo/discord"
99
"github.com/disgoorg/disgo/events"
10-
"github.com/disgoorg/disgo/json"
1110
"github.com/disgoorg/handler"
11+
"github.com/disgoorg/json"
1212
)
1313

1414
func ReportUser(b *dbot.Bot) handler.Command {
@@ -81,7 +81,7 @@ func reportUserHandler(b *dbot.Bot) handler.CommandHandler {
8181
IconURL: user.EffectiveAvatarURL(),
8282
},
8383
Description: "Reason:\n" + reason,
84-
Timestamp: json.NewPtr(e.ID().Time()),
84+
Timestamp: json.Ptr(e.ID().Time()),
8585
},
8686
)
8787
}

dbot/commands/report_components.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
"github.com/KittyBot-Org/KittyBotGo/dbot"
1111
"github.com/disgoorg/disgo/discord"
1212
"github.com/disgoorg/disgo/events"
13-
"github.com/disgoorg/disgo/json"
1413
"github.com/disgoorg/disgo/rest"
1514
"github.com/disgoorg/handler"
15+
"github.com/disgoorg/json"
1616
"github.com/disgoorg/snowflake/v2"
1717
)
1818

@@ -133,7 +133,7 @@ func reportConfirmHandler(b *dbot.Bot) handler.ComponentHandler {
133133
discord.SelectMenuComponent{
134134
CustomID: fmt.Sprintf("handler:report-action:%d", reportID),
135135
Placeholder: "Select an action",
136-
MinValues: json.NewPtr(1),
136+
MinValues: json.Ptr(1),
137137
MaxValues: 1,
138138
Options: selectMenuOptions,
139139
},
@@ -260,7 +260,7 @@ func reportActionHandler(b *dbot.Bot) handler.ComponentHandler {
260260
CustomID: "duration",
261261
Style: discord.TextInputStyleShort,
262262
Label: "Timeout Duration",
263-
MinLength: json.NewPtr(2),
263+
MinLength: json.Ptr(2),
264264
Required: true,
265265
Placeholder: "time units: s, m, h example: 1h3s",
266266
Value: "1h",
@@ -307,7 +307,7 @@ func reportActionHandler(b *dbot.Bot) handler.ComponentHandler {
307307
CustomID: "del-days",
308308
Style: discord.TextInputStyleShort,
309309
Label: "Message Delete Days",
310-
MinLength: json.NewPtr(1),
310+
MinLength: json.Ptr(1),
311311
MaxLength: 1,
312312
Required: true,
313313
Placeholder: "0-7",
@@ -354,7 +354,7 @@ func reportActionConfirmHandler(b *dbot.Bot) handler.ModalHandler {
354354
} else {
355355
until = until.Add(duration)
356356
if _, err = b.Client.Rest().UpdateMember(*e.GuildID(), userID, discord.MemberUpdate{
357-
CommunicationDisabledUntil: json.NewOptional(until),
357+
CommunicationDisabledUntil: json.NewNullablePtr(until),
358358
}, rest.WithReason(reason)); err != nil {
359359
b.Logger.Errorf("Failed to update member: %s", err)
360360
content = "Failed to timeout user, please reach out to a bot developer."

dbot/commands/reports.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"github.com/KittyBot-Org/KittyBotGo/dbot"
99
"github.com/disgoorg/disgo/discord"
1010
"github.com/disgoorg/disgo/events"
11-
"github.com/disgoorg/disgo/json"
1211
"github.com/disgoorg/handler"
12+
"github.com/disgoorg/json"
1313
)
1414

1515
func Reports(b *dbot.Bot) handler.Command {
@@ -75,7 +75,7 @@ func Reports(b *dbot.Bot) handler.Command {
7575
},
7676
},
7777
},
78-
DefaultMemberPermissions: json.NewOptional(discord.PermissionKickMembers | discord.PermissionBanMembers | discord.PermissionModerateMembers),
78+
DefaultMemberPermissions: json.NewNullablePtr(discord.PermissionKickMembers | discord.PermissionBanMembers | discord.PermissionModerateMembers),
7979
},
8080
CommandHandlers: map[string]handler.CommandHandler{
8181
"view": reportsViewHandler(b),

dbot/commands/seek.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"github.com/KittyBot-Org/KittyBotGo/dbot/responses"
66
"github.com/disgoorg/disgo/discord"
77
"github.com/disgoorg/disgo/events"
8-
"github.com/disgoorg/disgo/json"
98
"github.com/disgoorg/disgolink/lavalink"
109
"github.com/disgoorg/handler"
10+
"github.com/disgoorg/json"
1111
)
1212

1313
func Seek(b *dbot.Bot) handler.Command {
@@ -20,7 +20,7 @@ func Seek(b *dbot.Bot) handler.Command {
2020
Name: "position",
2121
Description: "The position to seek to in seconds(default)/minutes/hours",
2222
Required: true,
23-
MinValue: json.NewPtr(0),
23+
MinValue: json.Ptr(0),
2424
},
2525
discord.ApplicationCommandOptionInt{
2626
Name: "time-unit",

dbot/commands/settings.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"github.com/KittyBot-Org/KittyBotGo/dbot"
55
"github.com/disgoorg/disgo/discord"
66
"github.com/disgoorg/disgo/events"
7-
"github.com/disgoorg/disgo/json"
87
"github.com/disgoorg/handler"
8+
"github.com/disgoorg/json"
99
"github.com/disgoorg/snowflake/v2"
1010
)
1111

@@ -41,7 +41,7 @@ func Settings(b *dbot.Bot) handler.Command {
4141
},
4242
},
4343
},
44-
DefaultMemberPermissions: json.NewOptional(discord.PermissionManageServer),
44+
DefaultMemberPermissions: json.NewNullablePtr(discord.PermissionManageServer),
4545
},
4646
CommandHandlers: map[string]handler.CommandHandler{
4747
"moderation/disable": settingsModerationDisableHandler(b),
@@ -102,7 +102,7 @@ func settingsModerationEnableHandler(b *dbot.Bot) handler.CommandHandler {
102102
}
103103
} else {
104104
if _, err = b.Client.Rest().UpdateWebhook(snowflake.MustParse(settings.ModerationLogWebhookID), discord.WebhookUpdate{
105-
ChannelID: json.NewPtr(data.Snowflake("channel")),
105+
ChannelID: json.Ptr(data.Snowflake("channel")),
106106
}); err != nil {
107107
b.Logger.Errorf("Error updating webhook: %s", err)
108108
return e.CreateMessage(discord.MessageCreate{

dbot/commands/volume.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"github.com/KittyBot-Org/KittyBotGo/dbot/responses"
66
"github.com/disgoorg/disgo/discord"
77
"github.com/disgoorg/disgo/events"
8-
"github.com/disgoorg/disgo/json"
98
"github.com/disgoorg/handler"
9+
"github.com/disgoorg/json"
1010
)
1111

1212
func Volume(bot *dbot.Bot) handler.Command {
@@ -19,8 +19,8 @@ func Volume(bot *dbot.Bot) handler.Command {
1919
Name: "volume",
2020
Description: "The new volume",
2121
Required: true,
22-
MinValue: json.NewPtr(0),
23-
MaxValue: json.NewPtr(100),
22+
MinValue: json.Ptr(0),
23+
MaxValue: json.Ptr(100),
2424
},
2525
},
2626
},

dbot/listeners/moderation.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/disgoorg/disgo/bot"
1010
"github.com/disgoorg/disgo/discord"
1111
"github.com/disgoorg/disgo/events"
12-
"github.com/disgoorg/disgo/json"
12+
"github.com/disgoorg/json"
1313
"github.com/disgoorg/snowflake/v2"
1414
)
1515

@@ -83,7 +83,7 @@ func Moderation(b *dbot.Bot) bot.EventListener {
8383
},
8484
Description: e.Content,
8585
Fields: fields,
86-
Timestamp: json.NewPtr(time.Now()),
86+
Timestamp: json.Ptr(time.Now()),
8787
},
8888
)
8989
if err != nil {

go.mod

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ module github.com/KittyBot-Org/KittyBotGo
33
go 1.18
44

55
require (
6-
github.com/disgoorg/disgo v0.13.21
6+
github.com/disgoorg/disgo v0.13.22
77
github.com/disgoorg/disgolink/disgolink v1.7.4
88
github.com/disgoorg/disgolink/lavalink v1.7.3
99
github.com/disgoorg/handler v0.3.0
10+
github.com/disgoorg/json v1.0.0
1011
github.com/disgoorg/log v1.2.0
1112
github.com/disgoorg/snowflake/v2 v2.0.1
1213
github.com/disgoorg/source-plugins v1.3.1-0.20221009162536-28cea64ea737
@@ -36,7 +37,7 @@ require (
3637
github.com/prometheus/procfs v0.8.0 // indirect
3738
github.com/sasha-s/go-csync v0.0.0-20210812194225-61421b77c44b // indirect
3839
github.com/stretchr/testify v1.8.1 // indirect
39-
golang.org/x/exp v0.0.0-20221111204811-129d8d6c17ab // indirect
40+
golang.org/x/exp v0.0.0-20221114191408-850992195362 // indirect
4041
golang.org/x/sys v0.2.0 // indirect
4142
golang.org/x/text v0.4.0 // indirect
4243
google.golang.org/protobuf v1.28.1 // indirect

go.sum

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,16 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do
5959
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
6060
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
6161
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
62-
github.com/disgoorg/disgo v0.13.21 h1:mapasORJIZWGMcsAxTzosIHfBlx39g2KLbY/OJlJn3A=
63-
github.com/disgoorg/disgo v0.13.21/go.mod h1:VpRp9ifKNcQ05mgIx9l5oU4TADysXUGmNx9iHM9/DpA=
62+
github.com/disgoorg/disgo v0.13.22 h1:Vf49TkfC5djuMTbS9qdg/pr/pCNUxHQtx8/dMPu3aWI=
63+
github.com/disgoorg/disgo v0.13.22/go.mod h1:YiVpXSmyXLRalYQHTHUFWEQvolCNzw0zh6nfug07b/M=
6464
github.com/disgoorg/disgolink/disgolink v1.7.4 h1:JqiB9fOMxEZHktfHc0LZVOCiNLVmkmtlIic8qDTd5W0=
6565
github.com/disgoorg/disgolink/disgolink v1.7.4/go.mod h1:qbYYCPJvmoBSxDnk+UznKRYa86QMsIZKQxfv9joBVr4=
6666
github.com/disgoorg/disgolink/lavalink v1.7.3 h1:i3wThR0CWWvabhR/HSYM8b6Ln7Ex3ZgX6Hs4VZ+ZSV0=
6767
github.com/disgoorg/disgolink/lavalink v1.7.3/go.mod h1:e/oo6afxnHvjkgGeJYrDazVIJEsQuWVSFahsek+K1mo=
6868
github.com/disgoorg/handler v0.3.0 h1:jT78k9tUeLm96yNJBVi8N8rNMU0f4pf71Je3U/IbpXA=
6969
github.com/disgoorg/handler v0.3.0/go.mod h1:oGRTTnVSS14auraNSEURCYf7/lk+y6fB2/7R29MjH1w=
70+
github.com/disgoorg/json v1.0.0 h1:kDhSM661fgIuNoZF3BO5/odaR5NSq80AWb937DH+Pdo=
71+
github.com/disgoorg/json v1.0.0/go.mod h1:BHDwdde0rpQFDVsRLKhma6Y7fTbQKub/zdGO5O9NqqA=
7072
github.com/disgoorg/log v1.2.0 h1:sqlXnu/ZKAlIlHV9IO+dbMto7/hCQ474vlIdMWk8QKo=
7173
github.com/disgoorg/log v1.2.0/go.mod h1:3x1KDG6DI1CE2pDwi3qlwT3wlXpeHW/5rVay+1qDqOo=
7274
github.com/disgoorg/snowflake/v2 v2.0.1 h1:CuUxGLwggUxEswZOmZ+mZ5i0xSumQdXW9tXW7uGqe+0=
@@ -358,8 +360,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
358360
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
359361
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
360362
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
361-
golang.org/x/exp v0.0.0-20221111204811-129d8d6c17ab h1:1S7USr8/C0Sgk4egxq4zZ07zYt2Xh1IiFp8hUMXH/us=
362-
golang.org/x/exp v0.0.0-20221111204811-129d8d6c17ab/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
363+
golang.org/x/exp v0.0.0-20221114191408-850992195362 h1:NoHlPRbyl1VFI6FjwHtPQCN7wAMXI6cKcqrmXhOOfBQ=
364+
golang.org/x/exp v0.0.0-20221114191408-850992195362/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
363365
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
364366
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
365367
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=

0 commit comments

Comments
 (0)