TerraOceanPlugin/GoBot/discord/modules/vote_custom.go

27 lines
653 B
Go

package modules
import (
"strconv"
"github.com/bwmarrin/discordgo"
"TerraOceanBot/discord/config"
"TerraOceanBot/discord/message"
)
func createCustomEmbed(id int, name string) *message.Embed {
return message.InitNewEmbed(config.CustomVoteTitle, "", config.CustomVoteColour).
AddField(config.CustomVoteVoteID, strconv.Itoa(id)).
AddField(config.CustomVoteContent, name)
}
func formatCustomName(internalName string) string {
return internalName
}
func announceCustomResult(s *discordgo.Session, id int, name string, isPositive bool) {
createCustomEmbed(id, name).
UpdateVoteStatus(isPositive).
Send(s, config.AnnounceCustomChannel)
}