Documentation ¶
Overview ¶
Package DiscordState is an abstraction layer that gives proper structs and functions to get and set the current state of the cli server
Index ¶
- type Session
- type State
- func (State *State) AddMember(Member *discordgo.Member)
- func (State *State) AddMessage(Message *discordgo.Message)
- func (State *State) DelMember(Member *discordgo.Member)
- func (State *State) DelMessage(Message *discordgo.Message)
- func (State *State) EditMessage(Message *discordgo.Message)
- func (State *State) RetrieveMessages(Amount int) error
- func (State *State) SetChannel(ID string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct { User *discordgo.User Token string DiscordGo *discordgo.Session Guilds []*discordgo.UserGuild }
Session contains the 'state' of the attached server
func (*Session) NewState ¶
NewState (constructor) attaches a new state to the Guild inside a Session, and fills it.
type State ¶
type State struct { Guild *discordgo.Guild Channel *discordgo.Channel Channels []*discordgo.Channel Members map[string]*discordgo.Member Messages []*discordgo.Message Session *Session MessageAmount int //Amount of Messages to keep in State Enabled bool //Toggles State for Event handling }
State is the current state of the attached client
func (*State) AddMessage ¶
AddMessage adds Message to State
func (*State) DelMessage ¶
DelMessage deletes Message from State
func (*State) EditMessage ¶
EditMessage edits Message inside State
func (*State) RetrieveMessages ¶
RetrieveMessages retrieves last N Messages and puts it in state
func (*State) SetChannel ¶
SetChannel sets the channel of the current State
Click to show internal directories.
Click to hide internal directories.