Skip to content

Commit

Permalink
Merge pull request #1 from e-zk/updates
Browse files Browse the repository at this point in the history
Fix getconfig
  • Loading branch information
foxtrot authored Oct 15, 2021
2 parents ce8bd4d + f73ae36 commit 6ceb5be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions commands/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ func (c *Commands) handleGetConfig(s *discordgo.Session, m *discordgo.MessageCre

msg := ""

rt := reflect.TypeOf(c.Config)
rt := reflect.TypeOf(*c.Config)
for i := 0; i < rt.NumField(); i++ {
x := rt.Field(i)
tagVal := strings.Split(x.Tag.Get("json"), ",")[0]
tagName := x.Name
prop := reflect.ValueOf(&c.Config).Elem().FieldByName(tagName)
prop := reflect.ValueOf(c.Config).Elem().FieldByName(tagName)

if configKey == "all" {
switch prop.Interface().(type) {
Expand Down

0 comments on commit 6ceb5be

Please sign in to comment.