Documentation ¶
Index ¶
- Constants
- Variables
- func AnimeSubsWrite(animeSubs map[string][]*ShowSub) error
- func HandleNewGuild(guildID string)
- func IOReadDir(root string) ([]string, error)
- func InTimeSpan(start, end, check time.Time) bool
- func LoadSharedDB()
- func LoadSharedDBFile(file string)
- func RemindMeWrite(remindMe map[string]*RemindMeSlice) error
- func SetupGuildSub(guildID string)
- type ASAnime
- func (a *ASAnime) GetAirType() string
- func (a *ASAnime) GetDelayedFrom() time.Time
- func (a *ASAnime) GetDelayedUntil() time.Time
- func (a *ASAnime) GetDonghua() bool
- func (a *ASAnime) GetEpisodeDate() time.Time
- func (a *ASAnime) GetEpisodeNumber() int
- func (a *ASAnime) GetEpisodes() int
- func (a *ASAnime) GetImageVersionRoute() string
- func (a *ASAnime) GetRoute() string
- func (a *ASAnime) GetTitle() string
- func (a *ASAnime) SetAirType(airType string)
- func (a *ASAnime) SetDelayedFrom(delayedFrom time.Time)
- func (a *ASAnime) SetDelayedUntil(delayedUntil time.Time)
- func (a *ASAnime) SetDonghua(donghua bool)
- func (a *ASAnime) SetEpisodeDate(episodeDate time.Time)
- func (a *ASAnime) SetEpisodeNumber(episodeNumber int)
- func (a *ASAnime) SetEpisodes(episodes int)
- func (a *ASAnime) SetImageVersionRoute(imageVersionRoute string)
- func (a *ASAnime) SetRoute(route string)
- func (a *ASAnime) SetTitle(title string)
- type AnimeScheduleMap
- type Cha
- type Feed
- func (f Feed) GetAuthor() string
- func (f Feed) GetChannelID() string
- func (f Feed) GetPin() bool
- func (f Feed) GetPostType() string
- func (f Feed) GetSubreddit() string
- func (f Feed) GetTitle() string
- func (f Feed) SetAuthor(author string) Feed
- func (f Feed) SetChannelID(channelID string) Feed
- func (f Feed) SetPin(pin bool) Feed
- func (f Feed) SetPostType(postType string) Feed
- func (f Feed) SetSubreddit(subreddit string) Feed
- func (f Feed) SetTitle(title string) Feed
- type FeedCheck
- type GuildInfo
- func (g *GuildInfo) AppendToFeedChecks(feedCheck FeedCheck)
- func (g *GuildInfo) AppendToFeeds(feed Feed)
- func (g *GuildInfo) AppendToRaffles(raffle *Raffle)
- func (g *GuildInfo) AssignToAutoposts(key string, autopost Cha)
- func (g *GuildInfo) AssignToFeedChecks(index int, feedCheck FeedCheck)
- func (g *GuildInfo) AssignToFeeds(index int, feed Feed)
- func (g *GuildInfo) AssignToReactJoinMap(key string, reactJoin *ReactJoin)
- func (g *GuildInfo) GetAutoposts() map[string]Cha
- func (g *GuildInfo) GetFeedChecks() []FeedCheck
- func (g *GuildInfo) GetFeeds() []Feed
- func (g *GuildInfo) GetGuildSettings() GuildSettings
- func (g *GuildInfo) GetID() string
- func (g *GuildInfo) GetRaffles() []*Raffle
- func (g *GuildInfo) GetReactJoinMap() map[string]*ReactJoin
- func (g *GuildInfo) Load(file, guildID string) error
- func (g *GuildInfo) RemoveFromAutoposts(key string)
- func (g *GuildInfo) RemoveFromFeedChecks(index int)
- func (g *GuildInfo) RemoveFromFeeds(index int)
- func (g *GuildInfo) RemoveFromRaffles(index int)
- func (g *GuildInfo) RemoveFromReactJoinMap(key string)
- func (g *GuildInfo) SetAutoposts(autoposts map[string]Cha)
- func (g *GuildInfo) SetFeedChecks(feedChecks []FeedCheck)
- func (g *GuildInfo) SetFeeds(feeds []Feed)
- func (g *GuildInfo) SetGuildSettings(guildSettings GuildSettings)
- func (g *GuildInfo) SetID(id string)
- func (g *GuildInfo) SetRaffles(raffles []*Raffle)
- func (g *GuildInfo) SetReactJoinMap(reactJoinMap map[string]*ReactJoin)
- func (g *GuildInfo) WriteData(fileName string, data interface{})
- type GuildMap
- type GuildSettings
- func (g GuildSettings) AppendToCommandRoles(commandRole Role) GuildSettings
- func (g GuildSettings) AppendToVoiceChas(voiceCha VoiceCha) GuildSettings
- func (g GuildSettings) GetBotLog() Cha
- func (g GuildSettings) GetCommandRoles() []Role
- func (g GuildSettings) GetDonghua() bool
- func (g GuildSettings) GetModOnly() bool
- func (g GuildSettings) GetMutedRole() Role
- func (g GuildSettings) GetPingMessage() string
- func (g GuildSettings) GetPrefix() string
- func (g GuildSettings) GetPremium() bool
- func (g GuildSettings) GetReactsModule() bool
- func (g GuildSettings) GetVoiceChas() []VoiceCha
- func (g GuildSettings) RemoveFromCommandRoles(index int) GuildSettings
- func (g GuildSettings) RemoveFromVoiceChas(index int) GuildSettings
- func (g GuildSettings) SetBotLog(cha Cha) GuildSettings
- func (g GuildSettings) SetCommandRoles(roles []Role) GuildSettings
- func (g GuildSettings) SetDonghua(donghua bool) GuildSettings
- func (g GuildSettings) SetModOnly(modOnly bool) GuildSettings
- func (g GuildSettings) SetMutedRole(role Role) GuildSettings
- func (g GuildSettings) SetPingMessage(pingMessage string) GuildSettings
- func (g GuildSettings) SetPrefix(prefix string) GuildSettings
- func (g GuildSettings) SetPremium(premium bool) GuildSettings
- func (g GuildSettings) SetReactsModule(reactsModule bool) GuildSettings
- func (g GuildSettings) SetVoiceChas(voiceChas []VoiceCha) GuildSettings
- type Raffle
- func (r *Raffle) AppendToParticipantIDs(participantID string)
- func (r *Raffle) GetName() string
- func (r *Raffle) GetParticipantIDs() []string
- func (r *Raffle) GetReactMessageID() string
- func (r *Raffle) RemoveFromParticipantIDs(index int)
- func (r *Raffle) SetName(name string)
- func (r *Raffle) SetParticipantIDs(participantIDs []string)
- func (r *Raffle) SetReactMessageID(reactMessageID string)
- type ReactJoin
- type RemindMe
- func (r *RemindMe) AddToRemindID(remindID int)
- func (r *RemindMe) GetCommandChannel() string
- func (r *RemindMe) GetDate() time.Time
- func (r *RemindMe) GetMessage() string
- func (r *RemindMe) GetRemindID() int
- func (r *RemindMe) SetCommandChannel(commandChannel string)
- func (r *RemindMe) SetDate(date time.Time)
- func (r *RemindMe) SetMessage(message string)
- func (r *RemindMe) SetRemindID(remindID int)
- type RemindMeSlice
- func (r *RemindMeSlice) AppendToRemindMeSlice(remindMe *RemindMe)
- func (r *RemindMeSlice) GetGuild() bool
- func (r *RemindMeSlice) GetPremium() bool
- func (r *RemindMeSlice) GetRemindMeSlice() []*RemindMe
- func (r *RemindMeSlice) RemoveFromRemindMeSlice(index int)
- func (r *RemindMeSlice) SetGuild(guild bool)
- func (r *RemindMeSlice) SetPremium(premium bool)
- func (r *RemindMeSlice) SetRemindMeSlice(remindMeSlice []*RemindMe)
- type Role
- type ShowAirTime
- func (s *ShowAirTime) GetAirTime() string
- func (s *ShowAirTime) GetDelayed() string
- func (s *ShowAirTime) GetDonghua() bool
- func (s *ShowAirTime) GetEpisode() string
- func (s *ShowAirTime) GetImageUrl() string
- func (s *ShowAirTime) GetKey() string
- func (s *ShowAirTime) GetName() string
- func (s *ShowAirTime) GetSubbed() bool
- func (s *ShowAirTime) SetAirTime(airTime string)
- func (s *ShowAirTime) SetDelayed(delayed string)
- func (s *ShowAirTime) SetDonghua(donghua bool)
- func (s *ShowAirTime) SetEpisode(episode string)
- func (s *ShowAirTime) SetImageUrl(imageUrl string)
- func (s *ShowAirTime) SetKey(key string)
- func (s *ShowAirTime) SetName(name string)
- func (s *ShowAirTime) SetSubbed(subbed bool)
- type ShowSub
- type VoiceCha
- func (v VoiceCha) AppendToRoles(role Role) VoiceCha
- func (v VoiceCha) GetID() string
- func (v VoiceCha) GetName() string
- func (v VoiceCha) GetRoles() []Role
- func (v VoiceCha) RemoveFromRoles(index int) VoiceCha
- func (v VoiceCha) SetID(id string) VoiceCha
- func (v VoiceCha) SetName(name string) VoiceCha
- func (v VoiceCha) SetRoles(roles []Role) VoiceCha
Constants ¶
View Source
const DBPath = "database/guilds"
Variables ¶
View Source
var ( Mutex deadlock.RWMutex AnimeSchedule = &AnimeScheduleMap{AnimeSchedule: make(map[int][]*ShowAirTime)} )
View Source
var (
Guilds = NewGuildMap(make(map[string]*GuildInfo))
)
Functions ¶
func AnimeSubsWrite ¶
Writes anime notfication subscription to animeSubs.json
func HandleNewGuild ¶
func HandleNewGuild(guildID string)
HandleNewGuild initializes a guild if it's not in memory
func InTimeSpan ¶
func LoadSharedDBFile ¶
func LoadSharedDBFile(file string)
func RemindMeWrite ¶
func RemindMeWrite(remindMe map[string]*RemindMeSlice) error
RemindMeWrite writes RemindMes to remindMes.json
func SetupGuildSub ¶
func SetupGuildSub(guildID string)
Types ¶
type ASAnime ¶
type ASAnime struct { deadlock.RWMutex Title string `json:"title"` Route string `json:"route"` EpisodeDate time.Time `json:"episodeDate"` EpisodeNumber int `json:"episodeNumber"` Episodes int `json:"episodes` DelayedFrom time.Time `json:"delayedFrom"` DelayedUntil time.Time `json:"delayedUntil"` AirType string `json:"airType"` ImageVersionRoute string `json:"imageVersionRoute"` Donghua bool `json:"donghua"` }
func NewASAnime ¶
func (*ASAnime) GetAirType ¶
func (*ASAnime) GetDelayedFrom ¶
func (*ASAnime) GetDelayedUntil ¶
func (*ASAnime) GetDonghua ¶
func (*ASAnime) GetEpisodeDate ¶
func (*ASAnime) GetEpisodeNumber ¶
func (*ASAnime) GetEpisodes ¶
func (*ASAnime) GetImageVersionRoute ¶
func (*ASAnime) SetAirType ¶
func (*ASAnime) SetDelayedFrom ¶
func (*ASAnime) SetDelayedUntil ¶
func (*ASAnime) SetDonghua ¶
func (*ASAnime) SetEpisodeDate ¶
func (*ASAnime) SetEpisodeNumber ¶
func (*ASAnime) SetEpisodes ¶
func (*ASAnime) SetImageVersionRoute ¶
type AnimeScheduleMap ¶
type AnimeScheduleMap struct { deadlock.RWMutex AnimeSchedule map[int][]*ShowAirTime }
type Feed ¶
type Feed struct { deadlock.RWMutex Subreddit string `json:"Subreddit"` Title string `json:"Title"` Author string `json:"Author"` Pin bool `json:"Pin"` PostType string `json:"PostType"` ChannelID string `json:"ChannelID"` }
func (Feed) GetChannelID ¶
func (Feed) GetPostType ¶
func (Feed) GetSubreddit ¶
func (Feed) SetChannelID ¶
func (Feed) SetPostType ¶
func (Feed) SetSubreddit ¶
type FeedCheck ¶
type GuildInfo ¶
type GuildInfo struct { deadlock.RWMutex ID string GuildSettings GuildSettings Feeds []Feed FeedChecks []FeedCheck Raffles []*Raffle ReactJoinMap map[string]*ReactJoin Autoposts map[string]Cha }
GuildInfo contains all the data a guild can contain
func (*GuildInfo) AppendToFeedChecks ¶
func (*GuildInfo) AppendToFeeds ¶
func (*GuildInfo) AppendToRaffles ¶
func (*GuildInfo) AssignToAutoposts ¶
func (*GuildInfo) AssignToFeedChecks ¶
func (*GuildInfo) AssignToFeeds ¶
func (*GuildInfo) AssignToReactJoinMap ¶
func (*GuildInfo) GetAutoposts ¶
func (*GuildInfo) GetFeedChecks ¶
func (*GuildInfo) GetGuildSettings ¶
func (g *GuildInfo) GetGuildSettings() GuildSettings
func (*GuildInfo) GetRaffles ¶
func (*GuildInfo) GetReactJoinMap ¶
func (*GuildInfo) RemoveFromAutoposts ¶
func (*GuildInfo) RemoveFromFeedChecks ¶
func (*GuildInfo) RemoveFromFeeds ¶
func (*GuildInfo) RemoveFromRaffles ¶
func (*GuildInfo) RemoveFromReactJoinMap ¶
func (*GuildInfo) SetAutoposts ¶
func (*GuildInfo) SetFeedChecks ¶
func (*GuildInfo) SetGuildSettings ¶
func (g *GuildInfo) SetGuildSettings(guildSettings GuildSettings)
func (*GuildInfo) SetRaffles ¶
func (*GuildInfo) SetReactJoinMap ¶
type GuildMap ¶
GuildMap is a mutex-safe map of GuildInfo
func NewGuildMap ¶
type GuildSettings ¶
type GuildSettings struct { deadlock.RWMutex Prefix string `json:"Prefix"` BotLog Cha `json:"BotLogID"` CommandRoles []Role `json:"CommandRoles"` MutedRole Role `json:"MutedRole"` VoiceChas []VoiceCha `json:"VoiceChas"` ModOnly bool `json:"ModOnly"` Donghua bool `json:"Donghua"` ReactsModule bool `json:"ReactsModule"` PingMessage string `json:"PingMessage"` Premium bool `json:"Premium"` }
GuildSettings contains the guild-specific settings and toggled modules
func (GuildSettings) AppendToCommandRoles ¶
func (g GuildSettings) AppendToCommandRoles(commandRole Role) GuildSettings
func (GuildSettings) AppendToVoiceChas ¶
func (g GuildSettings) AppendToVoiceChas(voiceCha VoiceCha) GuildSettings
func (GuildSettings) GetBotLog ¶
func (g GuildSettings) GetBotLog() Cha
func (GuildSettings) GetCommandRoles ¶
func (g GuildSettings) GetCommandRoles() []Role
func (GuildSettings) GetDonghua ¶
func (g GuildSettings) GetDonghua() bool
func (GuildSettings) GetModOnly ¶
func (g GuildSettings) GetModOnly() bool
func (GuildSettings) GetMutedRole ¶
func (g GuildSettings) GetMutedRole() Role
func (GuildSettings) GetPingMessage ¶
func (g GuildSettings) GetPingMessage() string
func (GuildSettings) GetPrefix ¶
func (g GuildSettings) GetPrefix() string
func (GuildSettings) GetPremium ¶
func (g GuildSettings) GetPremium() bool
func (GuildSettings) GetReactsModule ¶
func (g GuildSettings) GetReactsModule() bool
func (GuildSettings) GetVoiceChas ¶
func (g GuildSettings) GetVoiceChas() []VoiceCha
func (GuildSettings) RemoveFromCommandRoles ¶
func (g GuildSettings) RemoveFromCommandRoles(index int) GuildSettings
func (GuildSettings) RemoveFromVoiceChas ¶
func (g GuildSettings) RemoveFromVoiceChas(index int) GuildSettings
func (GuildSettings) SetBotLog ¶
func (g GuildSettings) SetBotLog(cha Cha) GuildSettings
func (GuildSettings) SetCommandRoles ¶
func (g GuildSettings) SetCommandRoles(roles []Role) GuildSettings
func (GuildSettings) SetDonghua ¶
func (g GuildSettings) SetDonghua(donghua bool) GuildSettings
func (GuildSettings) SetModOnly ¶
func (g GuildSettings) SetModOnly(modOnly bool) GuildSettings
func (GuildSettings) SetMutedRole ¶
func (g GuildSettings) SetMutedRole(role Role) GuildSettings
func (GuildSettings) SetPingMessage ¶
func (g GuildSettings) SetPingMessage(pingMessage string) GuildSettings
func (GuildSettings) SetPrefix ¶
func (g GuildSettings) SetPrefix(prefix string) GuildSettings
func (GuildSettings) SetPremium ¶
func (g GuildSettings) SetPremium(premium bool) GuildSettings
func (GuildSettings) SetReactsModule ¶
func (g GuildSettings) SetReactsModule(reactsModule bool) GuildSettings
func (GuildSettings) SetVoiceChas ¶
func (g GuildSettings) SetVoiceChas(voiceChas []VoiceCha) GuildSettings
type Raffle ¶
type Raffle struct { deadlock.RWMutex Name string `json:"Name"` ParticipantIDs []string `json:"ParticipantIDs"` ReactMessageID string `json:"ReactMessageID"` }
func (*Raffle) AppendToParticipantIDs ¶
func (*Raffle) GetParticipantIDs ¶
func (*Raffle) GetReactMessageID ¶
func (*Raffle) RemoveFromParticipantIDs ¶
func (*Raffle) SetParticipantIDs ¶
func (*Raffle) SetReactMessageID ¶
type ReactJoin ¶
func (*ReactJoin) AppendToRoleEmojiMap ¶
func (*ReactJoin) GetRoleEmojiMap ¶
func (*ReactJoin) RemoveFromRoleEmojiMap ¶
func (*ReactJoin) SetRoleEmojiMap ¶
type RemindMe ¶
type RemindMe struct { deadlock.RWMutex Message string Date time.Time CommandChannel string RemindID int }
func NewRemindMe ¶
func (*RemindMe) AddToRemindID ¶
func (*RemindMe) GetCommandChannel ¶
func (*RemindMe) GetMessage ¶
func (*RemindMe) GetRemindID ¶
func (*RemindMe) SetCommandChannel ¶
func (*RemindMe) SetMessage ¶
func (*RemindMe) SetRemindID ¶
type RemindMeSlice ¶
func NewRemindMeSlice ¶
func NewRemindMeSlice(remindMeSlice []*RemindMe, premium bool) *RemindMeSlice
func (*RemindMeSlice) AppendToRemindMeSlice ¶
func (r *RemindMeSlice) AppendToRemindMeSlice(remindMe *RemindMe)
func (*RemindMeSlice) GetGuild ¶
func (r *RemindMeSlice) GetGuild() bool
func (*RemindMeSlice) GetPremium ¶
func (r *RemindMeSlice) GetPremium() bool
func (*RemindMeSlice) GetRemindMeSlice ¶
func (r *RemindMeSlice) GetRemindMeSlice() []*RemindMe
func (*RemindMeSlice) RemoveFromRemindMeSlice ¶
func (r *RemindMeSlice) RemoveFromRemindMeSlice(index int)
func (*RemindMeSlice) SetGuild ¶
func (r *RemindMeSlice) SetGuild(guild bool)
func (*RemindMeSlice) SetPremium ¶
func (r *RemindMeSlice) SetPremium(premium bool)
func (*RemindMeSlice) SetRemindMeSlice ¶
func (r *RemindMeSlice) SetRemindMeSlice(remindMeSlice []*RemindMe)
type Role ¶
type Role struct { deadlock.RWMutex Name string `json:"Name"` ID string `json:"ID"` Position int `json:"Position"` }
func (Role) GetPosition ¶
func (Role) SetPosition ¶
type ShowAirTime ¶
type ShowAirTime struct { deadlock.RWMutex Name string AirTime string Episode string Delayed string Key string ImageUrl string Subbed bool Donghua bool }
func NewShowAirTime ¶
func NewShowAirTime(name, airTime, episode, delayed, key, imageUrl string, subbed, donghua bool) *ShowAirTime
func (*ShowAirTime) GetAirTime ¶
func (s *ShowAirTime) GetAirTime() string
func (*ShowAirTime) GetDelayed ¶
func (s *ShowAirTime) GetDelayed() string
func (*ShowAirTime) GetDonghua ¶
func (s *ShowAirTime) GetDonghua() bool
func (*ShowAirTime) GetEpisode ¶
func (s *ShowAirTime) GetEpisode() string
func (*ShowAirTime) GetImageUrl ¶
func (s *ShowAirTime) GetImageUrl() string
func (*ShowAirTime) GetKey ¶
func (s *ShowAirTime) GetKey() string
func (*ShowAirTime) GetName ¶
func (s *ShowAirTime) GetName() string
func (*ShowAirTime) GetSubbed ¶
func (s *ShowAirTime) GetSubbed() bool
func (*ShowAirTime) SetAirTime ¶
func (s *ShowAirTime) SetAirTime(airTime string)
func (*ShowAirTime) SetDelayed ¶
func (s *ShowAirTime) SetDelayed(delayed string)
func (*ShowAirTime) SetDonghua ¶
func (s *ShowAirTime) SetDonghua(donghua bool)
func (*ShowAirTime) SetEpisode ¶
func (s *ShowAirTime) SetEpisode(episode string)
func (*ShowAirTime) SetImageUrl ¶
func (s *ShowAirTime) SetImageUrl(imageUrl string)
func (*ShowAirTime) SetKey ¶
func (s *ShowAirTime) SetKey(key string)
func (*ShowAirTime) SetName ¶
func (s *ShowAirTime) SetName(name string)
func (*ShowAirTime) SetSubbed ¶
func (s *ShowAirTime) SetSubbed(subbed bool)
type ShowSub ¶
type ShowSub struct { deadlock.RWMutex Show string `json:"Show"` Notified bool `json:"Notified"` Guild bool `json:"Guild"` }
func (*ShowSub) GetNotified ¶
func (*ShowSub) SetNotified ¶
type VoiceCha ¶
type VoiceCha struct { deadlock.RWMutex Name string `json:"Name"` ID string `json:"ID"` Roles []Role `json:"Roles"` }
func (VoiceCha) AppendToRoles ¶
func (VoiceCha) RemoveFromRoles ¶
Click to show internal directories.
Click to hide internal directories.