Skip to content

Commit

Permalink
Updated discordgo
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTipo01 committed Aug 6, 2021
1 parent b3fc3b3 commit c43e5f3
Show file tree
Hide file tree
Showing 5 changed files with 370 additions and 116 deletions.
17 changes: 9 additions & 8 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ var (
)

// If there's a specified channel, use it in the query
if len(i.Data.Options) > 0 {
mex, err = db.Query("SELECT message FROM messages WHERE guildID=? AND channelID=?", i.GuildID, i.Data.Options[0].ChannelValue(s).ID)
if len(i.ApplicationCommandData().Options) > 0 {
mex, err = db.Query("SELECT message FROM messages WHERE guildID=? AND channelID=?", i.GuildID, i.ApplicationCommandData().Options[0].ChannelValue(s).ID)
} else {
mex, err = db.Query("SELECT message FROM messages WHERE guildID=?", i.GuildID)
}
Expand Down Expand Up @@ -134,8 +134,8 @@ var (
)

// If there's a specified channel, use it in the query
if len(i.Data.Options) > 0 {
mex, err = db.Query("SELECT message FROM messages WHERE guildID=? AND channelID=?", i.GuildID, i.Data.Options[0].ChannelValue(s).ID)
if len(i.ApplicationCommandData().Options) > 0 {
mex, err = db.Query("SELECT message FROM messages WHERE guildID=? AND channelID=?", i.GuildID, i.ApplicationCommandData().Options[0].ChannelValue(s).ID)
} else {
mex, err = db.Query("SELECT message FROM messages WHERE guildID=?", i.GuildID)
}
Expand Down Expand Up @@ -188,8 +188,9 @@ var (
)

// If there's a specified channel, use it in the query
if len(i.Data.Options) > 0 {
mex, err = db.Query("SELECT message FROM messages WHERE guildID=? AND channelID=?", i.GuildID, i.Data.Options[0].ChannelValue(s).ID)

if len(i.ApplicationCommandData().Options) > 0 {
mex, err = db.Query("SELECT message FROM messages WHERE guildID=? AND channelID=?", i.GuildID, i.ApplicationCommandData().Options[0].ChannelValue(s).ID)
} else {
mex, err = db.Query("SELECT message FROM messages WHERE guildID=?", i.GuildID)
}
Expand Down Expand Up @@ -244,8 +245,8 @@ var (
)

// If there's a specified channel, use it in the query
if len(i.Data.Options) > 0 {
mex, err = db.Query("SELECT message FROM messages WHERE guildID=? AND channelID=?", i.GuildID, i.Data.Options[0].ChannelValue(s).ID)
if len(i.ApplicationCommandData().Options) > 0 {
mex, err = db.Query("SELECT message FROM messages WHERE guildID=? AND channelID=?", i.GuildID, i.ApplicationCommandData().Options[0].ChannelValue(s).ID)
} else {
mex, err = db.Query("SELECT message FROM messages WHERE guildID=?", i.GuildID)
}
Expand Down
23 changes: 7 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,14 @@ module messageCounter
go 1.16

require (
github.com/bwmarrin/discordgo v0.23.3-0.20210410202908-577e7dd4f6cc
github.com/bwmarrin/discordgo v0.23.3-0.20210730152208-ab47f123ba40
github.com/bwmarrin/lit v0.0.0-20190813132558-fd4b44871312
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/go-co-op/gocron v1.5.0
github.com/go-co-op/gocron v1.6.2
github.com/go-sql-driver/mysql v1.6.0
github.com/goccy/go-json v0.5.0
github.com/magiconair/properties v1.8.5 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/pelletier/go-toml v1.9.1 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.7.1
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 // indirect
github.com/goccy/go-json v0.7.4
github.com/spf13/cast v1.4.0 // indirect
github.com/spf13/viper v1.8.1
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
golang.org/x/text v0.3.6 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Loading

0 comments on commit c43e5f3

Please sign in to comment.