Skip to content

Commit

Permalink
implemented protocol for web
Browse files Browse the repository at this point in the history
  • Loading branch information
1nv8rzim committed Dec 13, 2023
1 parent 1b04ac8 commit a505114
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion commands/slash/vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func Vote() (*discordgo.ApplicationCommand, func(s *discordgo.Session, i *discor
return
}

out := "```\n" + entVoteResults.Plain + "\n```" + "\nResults Graph:\nhttp://" + config.Web.Hostname + ":" + config.Web.Port + "/vote/" + voteSlug + "\n"
out := "```\n" + entVoteResults.Plain + "\n```" + "\nResults Graph:\n" + config.Web.Protocol + "://" + config.Web.Hostname + ":" + config.Web.Port + "/vote/" + voteSlug + "\n"

_, err = s.InteractionResponseEdit(i.Interaction, &discordgo.WebhookEdit{
Content: &out,
Expand Down
1 change: 1 addition & 0 deletions config/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func web() structs.WebConfig {
return structs.WebConfig{
Port: viper.GetString("web.port"),
Hostname: viper.GetString("web.hostname"),
Protocol: viper.GetString("web.protocol"),
}
}

Expand Down
3 changes: 3 additions & 0 deletions structs/webConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ type WebConfig struct {

// Hostname is the hostname to listen on
Hostname string

// Protocol is the protocol to use
Protocol string
}

0 comments on commit a505114

Please sign in to comment.