2019-10-12 09:45:43 +07:00
|
|
|
package modules
|
2019-10-10 10:38:30 +07:00
|
|
|
|
2019-10-13 12:38:00 +07:00
|
|
|
import (
|
|
|
|
"github.com/bwmarrin/discordgo"
|
|
|
|
|
|
|
|
"TerraOceanBot/discord/message"
|
|
|
|
)
|
2019-10-10 10:38:30 +07:00
|
|
|
|
2019-10-10 13:59:00 +07:00
|
|
|
type voteType struct {
|
2019-10-13 11:48:24 +07:00
|
|
|
//TODO Add FormatName(name string) to clean up vote name
|
2019-10-13 12:38:00 +07:00
|
|
|
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
|
|
|
}
|