Skip to content

Commit

Permalink
Merge pull request #94 from ritsec/bradhacker-update-discordgo
Browse files Browse the repository at this point in the history
Update discordgo
  • Loading branch information
BradHacker authored Apr 5, 2024
2 parents 3848775 + 94a6fb2 commit cdb1537
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 39 deletions.
2 changes: 1 addition & 1 deletion commands/handlers/angryreact.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func AngryReact(s *discordgo.Session, m *discordgo.MessageCreate) {
Label: "View Message",
URL: helpers.JumpURL(m.Message),
Style: discordgo.LinkButton,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "👀",
},
},
Expand Down
4 changes: 2 additions & 2 deletions commands/handlers/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func MemberJoin(s *discordgo.Session, m *discordgo.GuildMemberAdd) {
Label: "View Profile",
URL: fmt.Sprintf("https://discordapp.com/users/%v/", m.Member.User.ID),
Style: discordgo.LinkButton,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "👀",
},
},
Expand Down Expand Up @@ -54,7 +54,7 @@ func MemberLeave(s *discordgo.Session, m *discordgo.GuildMemberRemove) {
Label: "View Profile",
URL: fmt.Sprintf("https://discordapp.com/users/%v/", m.Member.User.ID),
Style: discordgo.LinkButton,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "👀",
},
},
Expand Down
2 changes: 1 addition & 1 deletion commands/handlers/isTheStackRunning.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func IsTheStackRunning(s *discordgo.Session, m *discordgo.MessageCreate) {
Label: "View Message",
URL: helpers.JumpURL(message),
Style: discordgo.LinkButton,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "👀",
},
},
Expand Down
2 changes: 1 addition & 1 deletion commands/handlers/uwu.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func Uwu(s *discordgo.Session, m *discordgo.MessageCreate) {
Label: "View Message",
URL: helpers.JumpURL(message),
Style: discordgo.LinkButton,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "👀",
},
},
Expand Down
6 changes: 3 additions & 3 deletions commands/scheduled/goodfood.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func sendGoodFoodPing(s *discordgo.Session, location string, ctx ddtrace.SpanCon
Label: "View Message",
URL: helpers.JumpURL(message),
Style: discordgo.LinkButton,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "👀",
},
},
Expand Down Expand Up @@ -76,7 +76,7 @@ func GoodFood(s *discordgo.Session, quit chan interface{}) error {
}

// 11:00 AM
must(c.AddFunc("0 0 11 * * MON", func() { sendGoodFoodPing(s, "RITZ", span.Context()) })) // Monday
must(c.AddFunc("0 0 11 * * MON", func() { sendGoodFoodPing(s, "RITZ", span.Context()) })) // Monday
must(c.AddFunc("0 0 11 * * TUE", func() { sendGoodFoodPing(s, "Crossroads", span.Context()) })) // Tuesday
must(c.AddFunc("0 0 11 * * WED", func() { sendGoodFoodPing(s, "Brick City", span.Context()) })) // Wednesday
must(c.AddFunc("0 0 11 * * THU", func() {})) // Thursday
Expand All @@ -85,7 +85,7 @@ func GoodFood(s *discordgo.Session, quit chan interface{}) error {
must(c.AddFunc("0 0 11 * * SUN", func() {})) // Sunday

// 4:00 PM
must(c.AddFunc("0 0 16 * * MON", func() {})) // Monday
must(c.AddFunc("0 0 16 * * MON", func() {})) // Monday
must(c.AddFunc("0 0 16 * * TUE", func() {})) // Tuesday
must(c.AddFunc("0 0 16 * * WED", func() { sendGoodFoodPing(s, "RITZ", span.Context()) })) // Wednesday
must(c.AddFunc("0 0 16 * * THU", func() { sendGoodFoodPing(s, "Crossroads", span.Context()) })) // Thursday
Expand Down
4 changes: 2 additions & 2 deletions commands/slash/kudos.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,15 @@ func Kudos() (*discordgo.ApplicationCommand, func(s *discordgo.Session, i *disco
Label: "Approve",
Style: discordgo.SuccessButton,
CustomID: approve_slug,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "✔️",
},
},
discordgo.Button{
Label: "Deny",
Style: discordgo.DangerButton,
CustomID: deny_slug,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "✖️",
},
},
Expand Down
36 changes: 18 additions & 18 deletions commands/slash/member.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,15 @@ func tooManyAttempts(s *discordgo.Session, i *discordgo.InteractionCreate, attem
Label: "Yes",
Style: discordgo.SuccessButton,
CustomID: yesSlug,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "✔️",
},
},
discordgo.Button{
Label: "No",
Style: discordgo.DangerButton,
CustomID: noSlug,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "✖️",
},
},
Expand Down Expand Up @@ -309,15 +309,15 @@ func emailInUse(s *discordgo.Session, i *discordgo.InteractionCreate, userEmail
Label: "Yes",
Style: discordgo.SuccessButton,
CustomID: yesSlug,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "✔️",
},
},
discordgo.Button{
Label: "No",
Style: discordgo.DangerButton,
CustomID: noSlug,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "✖️",
},
},
Expand Down Expand Up @@ -488,15 +488,15 @@ func recievedEmail(s *discordgo.Session, i *discordgo.InteractionCreate, userEma
CustomID: recievedSlug,
Label: "I recieved the code",
Style: discordgo.SuccessButton,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "✔️",
},
},
discordgo.Button{
CustomID: unrecievedSlug,
Label: "I did not recieve the code",
Style: discordgo.DangerButton,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "✖️",
},
},
Expand Down Expand Up @@ -556,15 +556,15 @@ func invalidCode(s *discordgo.Session, i *discordgo.InteractionCreate, userEmail
CustomID: continueSlug,
Label: "yes",
Style: discordgo.SuccessButton,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "✔️",
},
},
discordgo.Button{
CustomID: quitSlug,
Label: "no",
Style: discordgo.DangerButton,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "✖️",
},
},
Expand Down Expand Up @@ -634,15 +634,15 @@ func invalidRITEmail(s *discordgo.Session, i *discordgo.InteractionCreate, userE
CustomID: continueSlug,
Label: "yes",
Style: discordgo.SuccessButton,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "✔️",
},
},
discordgo.Button{
CustomID: quitSlug,
Label: "no",
Style: discordgo.DangerButton,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "✖️",
},
},
Expand Down Expand Up @@ -787,15 +787,15 @@ func hasRITEmail(s *discordgo.Session, i *discordgo.InteractionCreate, ctx ddtra
CustomID: yesSlug,
Label: "Yes",
Style: discordgo.SuccessButton,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "✔️",
},
},
discordgo.Button{
CustomID: noSlug,
Label: "No",
Style: discordgo.DangerButton,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "✖️",
},
},
Expand Down Expand Up @@ -960,39 +960,39 @@ func manualVerification(s *discordgo.Session, i *discordgo.InteractionCreate, us
CustomID: memberSlug,
Label: "Member",
Style: discordgo.SuccessButton,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "✔️",
},
},
discordgo.Button{
CustomID: externalSlug,
Label: "External",
Style: discordgo.PrimaryButton,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "❓",
},
},
discordgo.Button{
CustomID: prosectiveSlug,
Label: "Prospective",
Style: discordgo.PrimaryButton,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "👶",
},
},
discordgo.Button{
CustomID: staffSlug,
Label: "Staff",
Style: discordgo.PrimaryButton,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "👨‍🏫",
},
},
discordgo.Button{
CustomID: alumniSlug,
Label: "Alumni",
Style: discordgo.PrimaryButton,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "🧓",
},
},
Expand All @@ -1004,7 +1004,7 @@ func manualVerification(s *discordgo.Session, i *discordgo.InteractionCreate, us
CustomID: denySlug,
Label: "Deny",
Style: discordgo.DangerButton,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "✖️",
},
},
Expand Down
2 changes: 1 addition & 1 deletion commands/slash/signin.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func Signin() (*discordgo.ApplicationCommand, func(s *discordgo.Session, i *disc
Label: "Signin",
Style: discordgo.SuccessButton,
CustomID: signinSlug,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "📝",
},
},
Expand Down
9 changes: 6 additions & 3 deletions commands/slash/vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func Vote() (*discordgo.ApplicationCommand, func(s *discordgo.Session, i *discor
Label: "Vote",
Style: discordgo.SuccessButton,
CustomID: voteSlug,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: "🗳️",
},
},
Expand Down Expand Up @@ -411,7 +411,7 @@ func voteGetVote(s *discordgo.Session, i *discordgo.InteractionCreate, rawOption
innerOptions = append(innerOptions, discordgo.SelectMenuOption{
Label: option,
Value: option,
Emoji: discordgo.ComponentEmoji{
Emoji: &discordgo.ComponentEmoji{
Name: emojis[j],
},
})
Expand Down Expand Up @@ -447,10 +447,13 @@ func voteGetVote(s *discordgo.Session, i *discordgo.InteractionCreate, rawOption
CustomID: messageSlug,
Options: func() []discordgo.SelectMenuOption {
var innerOptions []discordgo.SelectMenuOption
for _, option := range options {
for j, option := range options {
innerOptions = append(innerOptions, discordgo.SelectMenuOption{
Label: option,
Value: option,
Emoji: &discordgo.ComponentEmoji{
Name: emojis[j],
},
})
}
return innerOptions
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.20

require (
entgo.io/ent v0.12.1
github.com/bwmarrin/discordgo v0.27.1
github.com/bwmarrin/discordgo v0.28.1
github.com/fsnotify/fsnotify v1.6.0
github.com/gin-gonic/gin v1.9.1
github.com/google/uuid v1.3.0
Expand Down Expand Up @@ -54,7 +54,7 @@ require (
github.com/google/s2a-go v0.1.3 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.8.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/hcl/v2 v2.13.0 // indirect
github.com/joho/godotenv v1.4.0 // indirect
Expand Down Expand Up @@ -89,10 +89,10 @@ require (
go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // indirect
go4.org/unsafe/assume-no-moving-gc v0.0.0-20220617031537-928513b29760 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
Expand Down
Loading

0 comments on commit cdb1537

Please sign in to comment.