Documentation ¶
Index ¶
- type Bot
- func (b *Bot) AddMessageHandler(cmd string, f msgFunc)
- func (b *Bot) AddReactionHandler(title string, f reactFunc)
- func (b *Bot) MessageCreate(s *discordgo.Session, m *discordgo.MessageCreate)
- func (b *Bot) ReactionAdd(s *discordgo.Session, m *discordgo.MessageReactionAdd)
- func (b *Bot) Ready(s *discordgo.Session, event *discordgo.Ready)
- func (b *Bot) ResetDemocracy(c *discordgo.Channel, s *discordgo.Session, m *discordgo.MessageCreate)
- type Vote
- type VoteHandler
- func (v *VoteHandler) AddVoteEntry(vote Vote, author string, value bool) error
- func (v *VoteHandler) DeleteVote(vote Vote) error
- func (v *VoteHandler) DeleteVoteEntries(vote Vote) error
- func (v *VoteHandler) GetVote(guild, id string) (Vote, error)
- func (v *VoteHandler) GetVoteCount(vote Vote) (Vote, error)
- func (v *VoteHandler) InitDB(host, name, user, password string) error
- func (v *VoteHandler) InsertVote(vote Vote) error
- func (v *VoteHandler) MessageCallback(s *discordgo.Session, m *discordgo.MessageCreate, r result)
- func (v *VoteHandler) React(c *discordgo.Channel, s *discordgo.Session, m *discordgo.MessageReactionAdd)
- func (v *VoteHandler) ReadVotes(guild string) ([]Vote, error)
- func (v *VoteHandler) ReloadVotes(c *discordgo.Channel, s *discordgo.Session, m *discordgo.MessageCreate)
- func (v *VoteHandler) UpdateVote(id string, vote Vote) error
- func (v *VoteHandler) UpdateVoteEntry(vote Vote, author string, value bool) error
- func (v *VoteHandler) Vote(c *discordgo.Channel, s *discordgo.Session, m *discordgo.MessageCreate)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
Bot for creating and managing votes
func (*Bot) AddMessageHandler ¶
AddMessageHandler to Bot
func (*Bot) AddReactionHandler ¶
AddReactionHandler to Bot
func (*Bot) MessageCreate ¶
func (b *Bot) MessageCreate(s *discordgo.Session, m *discordgo.MessageCreate)
MessageCreate Event Handler
func (*Bot) ReactionAdd ¶
func (b *Bot) ReactionAdd(s *discordgo.Session, m *discordgo.MessageReactionAdd)
ReactionAdd Event Handler
func (*Bot) ResetDemocracy ¶
func (b *Bot) ResetDemocracy(c *discordgo.Channel, s *discordgo.Session, m *discordgo.MessageCreate)
ResetDemocracy for the provied guild
type Vote ¶
type Vote struct { Guild string ID string CurrentID string Title string Description string Author string Created time.Time Expires time.Time Pro int Con int }
Vote stores a primitive Vote object
type VoteHandler ¶
type VoteHandler struct {
// contains filtered or unexported fields
}
VoteHandler for primitive votes
func (*VoteHandler) AddVoteEntry ¶
func (v *VoteHandler) AddVoteEntry(vote Vote, author string, value bool) error
AddVoteEntry for user
func (*VoteHandler) DeleteVote ¶
func (v *VoteHandler) DeleteVote(vote Vote) error
DeleteVote from guild
func (*VoteHandler) DeleteVoteEntries ¶
func (v *VoteHandler) DeleteVoteEntries(vote Vote) error
DeleteVoteEntries from guild
func (*VoteHandler) GetVote ¶
func (v *VoteHandler) GetVote(guild, id string) (Vote, error)
GetVote by (current) ID
func (*VoteHandler) GetVoteCount ¶
func (v *VoteHandler) GetVoteCount(vote Vote) (Vote, error)
GetVoteCount for vote
func (*VoteHandler) InitDB ¶
func (v *VoteHandler) InitDB(host, name, user, password string) error
InitDB for persisting votes
func (*VoteHandler) InsertVote ¶
func (v *VoteHandler) InsertVote(vote Vote) error
InsertVote to guild
func (*VoteHandler) MessageCallback ¶
func (v *VoteHandler) MessageCallback(s *discordgo.Session, m *discordgo.MessageCreate, r result)
MessageCallback for handling errors and success messages
func (*VoteHandler) React ¶
func (v *VoteHandler) React(c *discordgo.Channel, s *discordgo.Session, m *discordgo.MessageReactionAdd)
React Handler
func (*VoteHandler) ReadVotes ¶
func (v *VoteHandler) ReadVotes(guild string) ([]Vote, error)
ReadVotes for guild
func (*VoteHandler) ReloadVotes ¶
func (v *VoteHandler) ReloadVotes(c *discordgo.Channel, s *discordgo.Session, m *discordgo.MessageCreate)
ReloadVotes to channel
func (*VoteHandler) UpdateVote ¶
func (v *VoteHandler) UpdateVote(id string, vote Vote) error
UpdateVote to guild
func (*VoteHandler) UpdateVoteEntry ¶
func (v *VoteHandler) UpdateVoteEntry(vote Vote, author string, value bool) error
UpdateVoteEntry for user
func (*VoteHandler) Vote ¶
func (v *VoteHandler) Vote(c *discordgo.Channel, s *discordgo.Session, m *discordgo.MessageCreate)
Vote Message Handler
Click to show internal directories.
Click to hide internal directories.