Documentation ¶
Index ¶
- func GetDatabaseInstance(file string) (*bolt.DB, error)
- func GetGuildValue(bucket, key string) ([]byte, error)
- func GetInstance() (*bolt.DB, error)
- func IsReserved(state Type) bool
- func SetGuildState(guildID string, state Type) error
- func SetGuildValue(bucket, key string, val []byte) error
- func ToStr(state Type) string
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDatabaseInstance ¶
GetDatabaseInstance get a bolt database instance. TODO: defer close?
func GetGuildValue ¶
GetGuildValue retrieves a value using guildID and a key bucket == GuildID
func GetInstance ¶
GetInstance get a bolt database instance using the default database file
func IsReserved ¶
IsReserved check if given state is reserved. These cannot be used for custom states. Custom states starts at 11 and ends at 255. custom state range [11, 255].
func SetGuildState ¶
SetGuildState updates the guild state in database
func SetGuildValue ¶
SetGuildValue sets a value using guildID, key and a value bucket == GuildID
Types ¶
type Type ¶
type Type uint8
Type state type
const ( // MissingState is used when no state was specified MissingState Type = iota // 0 // Normal is the default bot state Normal // 1 // Pause is used when the bot should not react to events Pause // 2 // Debug should gives more detailed discord feedback Debug // 3 // Silence Respond to nothing Silence // 4 // Reserved5 .. Reserved5 // Reserved6 .. Reserved6 // Reserved7 .. Reserved7 // Reserved8 .. Reserved8 // Reserved9 .. Reserved9 // Reserved10 .. Reserved10 )
Different reserved states
func GetGuildState ¶
GetGuildState returns the state of guild
Click to show internal directories.
Click to hide internal directories.