TerraOceanPlugin/GoBot/discord/modules/vote_custom.go

21 lines
525 B
Go

2019-10-12 15:33:06 +07:00
package modules
import (
"strconv"
"github.com/bwmarrin/discordgo"
"TerraOceanBot/discord/config"
)
func createCustomEmbed(id int, name string) *embed {
return initNewEmbed(config.CustomVoteTitle, "", config.CustomVoteColour).
AddField(config.CustomVoteVoteID, strconv.Itoa(id)).
AddField(config.CustomVoteContent, name)
}
func announceCustomResult(s *discordgo.Session, id int, name string, isPositive bool) {
createCustomEmbed(id, name).UpdateVoteStatus(isPositive).
Send(s, config.AnnounceCustomChannel)
}