TerraOceanPlugin/GoBot/discord/modules/vote.go

21 lines
506 B
Go

2019-10-12 09:45:43 +07:00
package modules
2019-10-12 15:33:06 +07:00
import "github.com/bwmarrin/discordgo"
2019-10-10 13:59:00 +07:00
type voteType struct {
//TODO Add FormatName(name string) to clean up vote name
2019-10-12 15:33:06 +07:00
EmbedBuilder func(id int, name string) *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
}