Documentation ¶
Index ¶
- Constants
- func GetAlisesForGroup(targetGroup string) (bool, []string)
- func GetMatchingGroup(searchGroup string, activeOnly bool) (bool, string)
- func RefreshAllIdolBiasgameStats(msg *discordgo.Message)
- func RefreshIdolBiasgameStats(targetIdol *Idol)
- func UpdateIdolGameStats(game models.BiasGameEntry)
- type Idol
- type IdolImage
- type Module
- func (i *Module) Action(command string, content string, msg *discordgo.Message, ...)
- func (i *Module) Commands() []string
- func (i *Module) Init(session *shardmanager.Manager)
- func (i *Module) OnGuildBanAdd(user *discordgo.GuildBanAdd, session *discordgo.Session)
- func (i *Module) OnGuildBanRemove(user *discordgo.GuildBanRemove, session *discordgo.Session)
- func (i *Module) OnGuildMemberAdd(member *discordgo.Member, session *discordgo.Session)
- func (i *Module) OnGuildMemberRemove(member *discordgo.Member, session *discordgo.Session)
- func (i *Module) OnMessage(content string, msg *discordgo.Message, session *discordgo.Session)
- func (i *Module) OnMessageDelete(msg *discordgo.MessageDelete, session *discordgo.Session)
- func (i *Module) OnReactionAdd(reaction *discordgo.MessageReactionAdd, session *discordgo.Session)
- func (i *Module) OnReactionRemove(reaction *discordgo.MessageReactionRemove, session *discordgo.Session)
- func (i *Module) Uninit(session *shardmanager.Manager)
Constants ¶
const ( CHECKMARK_EMOJI = "✅" X_EMOJI = "❌" QUESTIONMARK_EMOJI = "❓" NAV_NUMBERS_EMOJI = "🔢" MAX_IMAGE_SIZE = 2000 // 2000x2000px MIN_IMAGE_SIZE = 150 // 150x150px IMAGE_RESIZE_HEIGHT = 150 )
const (
ALL_IDOLS_CACHE_KEY = "allidols"
)
const (
GROUP_ALIAS_KEY = "groupAliases"
)
Variables ¶
This section is empty.
Functions ¶
func GetAlisesForGroup ¶
getAlisesForGroup gets the aliases for a group if it exists.
first return will be false if the group was not found
func GetMatchingGroup ¶
getMatchingGroup will do a loose comparison of the group name to see if it exists return 1: if a matching group exists return 2: what the real group name is
func RefreshAllIdolBiasgameStats ¶
RefreshIdolBiasgameStats is a slow operation that will check every game the idol has ever been in and update its game stats
func RefreshIdolBiasgameStats ¶
func RefreshIdolBiasgameStats(targetIdol *Idol)
RefreshIdolBiasgameStats is a slow operation that will check every game the idol has ever been in and update its game stats
func UpdateIdolGameStats ¶
func UpdateIdolGameStats(game models.BiasGameEntry)
UpdateIdolGameStats is called every time a biasgame finished
Types ¶
type Idol ¶
type Idol struct { ID bson.ObjectId Name string NameAliases []string GroupName string Gender string NameAndGroup string Images []IdolImage Deleted bool BGGames int BGGameWins int BGRounds int BGRoundWins int }
func GetActiveIdols ¶
func GetActiveIdols() []*Idol
GetActiveIdols will return only active idols and idols with images
func GetMatchingIdolAndGroup ¶
GetMatchingIdolAndGroup will do a loose comparison of the name and group passed to the ones that already exist
1st return is true if group exists 2nd return is true if idol exists in the group 3rd will be a reference to the matching idol
func GetMatchingIdolById ¶
GetMatchingIdolById will get a matching idol based on the given id, will return nil if non is found
func (*Idol) GetRandomImage ¶
GetRandomImage returns a random idol image
type IdolImage ¶
func (IdolImage) GetImgBytes ¶
GetImgBytes will get the bytes for the image with a default size of 150x150
func (IdolImage) GetResizeImgBytes ¶
GetImageBytesWithResize will get the bytes to the correctly sized image bytes
type Module ¶
type Module struct{}
module struct
func (*Module) Action ¶
func (i *Module) Action(command string, content string, msg *discordgo.Message, session *discordgo.Session)
Main Entry point for the plugin
func (*Module) Init ¶
func (i *Module) Init(session *shardmanager.Manager)
func (*Module) OnGuildBanAdd ¶
func (i *Module) OnGuildBanAdd(user *discordgo.GuildBanAdd, session *discordgo.Session)
func (*Module) OnGuildBanRemove ¶
func (i *Module) OnGuildBanRemove(user *discordgo.GuildBanRemove, session *discordgo.Session)
func (*Module) OnGuildMemberAdd ¶
func (*Module) OnGuildMemberRemove ¶
func (*Module) OnMessageDelete ¶
func (i *Module) OnMessageDelete(msg *discordgo.MessageDelete, session *discordgo.Session)
func (*Module) OnReactionAdd ¶
func (i *Module) OnReactionAdd(reaction *discordgo.MessageReactionAdd, session *discordgo.Session)
Called whenever a reaction is added to any message
func (*Module) OnReactionRemove ¶
func (i *Module) OnReactionRemove(reaction *discordgo.MessageReactionRemove, session *discordgo.Session)
func (*Module) Uninit ¶
func (i *Module) Uninit(session *shardmanager.Manager)
Uninit called when bot is shutting down