2019-10-12 15:33:06 +07:00
|
|
|
package modules
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strconv"
|
|
|
|
|
|
|
|
"github.com/bwmarrin/discordgo"
|
|
|
|
|
|
|
|
"TerraOceanBot/discord/config"
|
2019-10-13 12:38:00 +07:00
|
|
|
"TerraOceanBot/discord/message"
|
2019-10-12 15:33:06 +07:00
|
|
|
)
|
|
|
|
|
2019-10-13 12:38:00 +07:00
|
|
|
func createCustomEmbed(id int, name string) *message.Embed {
|
|
|
|
return message.InitNewEmbed(config.CustomVoteTitle, "", config.CustomVoteColour).
|
2019-10-12 15:33:06 +07:00
|
|
|
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)
|
|
|
|
}
|