Skip to content

Commit

Permalink
Improved: Inline fields for more compact embeds
Browse files Browse the repository at this point in the history
  • Loading branch information
danielunderwood committed Mar 6, 2022
1 parent e60170d commit 52c927d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ type Provider struct {
}

type Field struct {
Name string `json:"name"`
Value string `json:"value"`
Name string `json:"name"`
Value string `json:"value"`
Inline bool `json:"inline,omitempty"`
}

// https://discord.com/developers/docs/resources/channel#embed-object
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func main() {
}
for i, name := range re.SubexpNames() {
if i != 0 && name != "" {
fields = append(fields, Field{Name: name, Value: match[i]})
fields = append(fields, Field{Name: name, Value: match[i], Inline: true})
}
}

Expand Down

0 comments on commit 52c927d

Please sign in to comment.