Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Text: "by draven#4562\ngithub.com/rmccrystal/discord-selfbot",
}Functions ¶
This section is empty.
Types ¶
type CommandList ¶
type CommandList struct {
Commands []Command
}
func NewCommandList ¶
func NewCommandList() CommandList
func (*CommandList) AddCommand ¶
func (list *CommandList) AddCommand(command Command)
func (CommandList) FindCommand ¶
func (list CommandList) FindCommand(command string) *Command
FindCommand finds a command in the commandlist using the name or alias. If no commands with the specified command or alias exist, it will return nil.
type Config ¶
type Config struct { Token string `json:"token"` Prefix string `json:"prefix"` DefaultAsciiFont string `json:"default_ascii_font"` }
Config represents what can be configured about a selfbotsession. Usually loaded from a JSON Config file.
func NewConfigDefault ¶
func NewConfigFromJson ¶
func NewConfigsFromJson ¶
type Interactive ¶
type Interactive struct {
// contains filtered or unexported fields
}
Interactive is an interactive session for selfbot users. While this session is active, the selfbot will not accept commands and instead input will be sent to this struct.
To Read from an interactive session, you can use a bufio.Reader. Messages are separated by a null character ('\000')
func (*Interactive) Close ¶
func (i *Interactive) Close() error
func (*Interactive) Read ¶
func (i *Interactive) Read(p []byte) (n int, err error)
Read reads data from the read buffer which is updated every new message sent. This can be easily read from using a Reader
func (*Interactive) ReadString ¶
func (i *Interactive) ReadString() (message string, eof bool)
ReadString reads a single message from the session. If there are no messages waiting, it will wait until a message is sent. If the session is closed, eof will be true
func (*Interactive) Write ¶
func (i *Interactive) Write(p []byte) (n int, err error)
Write writes a response to the channel
func (*Interactive) WriteString ¶
func (i *Interactive) WriteString(message string) (eof bool)
type Selfbot ¶
type Selfbot struct { Session *discordgo.Session User *discordgo.User Config Config CommandList CommandList Log *log.Entry RemovedPins []discordgo.Message // contains filtered or unexported fields }
Selfbot represents all information required to run a selfbot. Multiple selfbots can be created with this struct
func NewSelfbot ¶
func NewSelfbot(config Config, commands CommandList) (Selfbot, error)
func (*Selfbot) StartInteractive ¶
func (bot *Selfbot) StartInteractive(channelID string, consumeMessages bool) *Interactive
StartInteractive starts a new interactive session