Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface { // NewUnit creates a new unit with given guild parameters and registers it with the manager. NewUnit(*bot.AttachedGuild) // SpawnUnits is the high-level method responsible for creating bot units for all attached guilds. SpawnUnits() error // BotCommandPrefix returns the bot commaand prefix of the unit mapped to given guild ID. BotCommandPrefix(string) (string, error) // UnitGuild returns the guild of the unit mapped to given guild ID. UnitGuild(string) (*discordgo.Guild, error) // SetUnitGuild sets the guild of the unit mapped to given guild ID. SetUnitGuild(string, *discordgo.Guild) error // SetUnitState transitions a bot unit instance from its current state to given state. // If the target state is Ready, it also broadcasts a wake-up signal to goroutines // waiting for this unit to be ready. SetUnitState(string, UnitState) error // WaitUntilUnitIsReady waits for a bot unit to be in ready state. WaitForReadyUnit(string) error // contains filtered or unexported methods }
Manager is the type responsible for keeping track of bot units (i.e. abstractions of actual bots within Discord guilds).
It is meant to be created exactly one time, on an application-wide level. A Manager instance is obtained using the GetManager() function.
Click to show internal directories.
Click to hide internal directories.