TerraOceanPlugin/GoBot/discord/modules/vote.go

25 lines
553 B
Go

2019-10-12 09:45:43 +07:00
package modules
import (
"github.com/bwmarrin/discordgo"
"TerraOceanBot/discord/message"
)
2019-10-10 13:59:00 +07:00
type voteType struct {
//TODO Add FormatName(name string) to clean up vote name
EmbedBuilder func(id int, name string) *message.Embed
2019-10-10 13:59:00 +07:00
ResultHandler func(s *discordgo.Session, id int, name string, isPositive bool)
}
var voteTypes = map[string]voteType{
"custom": voteType{
EmbedBuilder: createCustomEmbed,
ResultHandler: announceCustomResult,
},
2019-10-12 06:40:46 +07:00
"invite": voteType{
EmbedBuilder: createInviteEmbed,
ResultHandler: handleInviteResult,
},
2019-10-10 13:59:00 +07:00
}