Skip to content

Commit aa3fb8b

Browse files
committed
fix wrong FormatType value in db
1 parent 318658f commit aa3fb8b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

redditbot/database.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const (
2424

2525
type FormatType string
2626

27-
func (f FormatType) String() string {
27+
func (f FormatType) Name() string {
2828
switch f {
2929
case FormatTypeEmbed:
3030
return "Embed"

redditbot/discord.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@ var typeChoices = []discord.ApplicationCommandOptionChoiceString{
3434

3535
var formatTypeChoices = []discord.ApplicationCommandOptionChoiceString{
3636
{
37-
Name: FormatTypeEmbed.String(),
37+
Name: FormatTypeEmbed.Name(),
3838
Value: string(FormatTypeEmbed),
3939
},
4040
{
41-
Name: FormatTypeText.String(),
41+
Name: FormatTypeText.Name(),
4242
Value: string(FormatTypeText),
4343
},
4444
{
45-
Name: FormatTypeLink.String(),
45+
Name: FormatTypeLink.Name(),
4646
Value: string(FormatTypeLink),
4747
},
4848
{
49-
Name: FormatTypeLinkWithTitle.String(),
49+
Name: FormatTypeLinkWithTitle.Name(),
5050
Value: string(FormatTypeLinkWithTitle),
5151
},
5252
}
@@ -404,7 +404,7 @@ func (b *Bot) OnSubredditList(data discord.SlashCommandInteractionData, event *e
404404
if !sub.LinkButton {
405405
linkButton = "disabled"
406406
}
407-
content += fmt.Sprintf("- %s - type: `%s` - format: `%s` - role: %s - proxy: %s - link-button: `%s`\n", formatSubreddit(sub.Subreddit, true), strings.Title(sub.Type), sub.FormatType.String(), role, proxy, linkButton)
407+
content += fmt.Sprintf("- %s - type: `%s` - format: `%s` - role: %s - proxy: %s - link-button: `%s`\n", formatSubreddit(sub.Subreddit, true), strings.Title(sub.Type), sub.FormatType.Name(), role, proxy, linkButton)
408408
}
409409

410410
_ = event.CreateMessage(discord.MessageCreate{

0 commit comments

Comments
 (0)