bot

package
v0.0.0-...-9ab1851 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2018 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	Logger            *logger.Logger
	Config            *config.Config
	Session           *discordgo.Session
	DefaultPrefixes   []string
	GuildPrefixes     map[string]string                         // id:prefix
	MessageTimestamps map[string]map[string]discordgo.Timestamp // channelID: userID: timestmp
}

Main bot struct

func New

func New() *Bot

Returns new Bot instance

func (*Bot) GetAllChannels

func (b *Bot) GetAllChannels() (channels []*discordgo.Channel)

Returns all cached channels

func (*Bot) GetAllEmojis

func (b *Bot) GetAllEmojis() (emojis []*discordgo.Emoji)

Returns all cached emojis

func (*Bot) GetAllUsers

func (b *Bot) GetAllUsers() []*discordgo.User

Returns all cached users

func (*Bot) GetLatsUserMessageTimestamp

func (bot *Bot) GetLatsUserMessageTimestamp(channelID, userID string) time.Time

Gets timestamp of last user's message TODO: fix data race?

func (*Bot) InitPrefixes

func (bot *Bot) InitPrefixes(defaultPrefix string)

func (*Bot) RegisterMessageTimestamp

func (bot *Bot) RegisterMessageTimestamp(m *discordgo.Message)

Registers timestamp of last user's message TODO: fix data race?

func (*Bot) Stop

func (bot *Bot) Stop(exitCode int, forceStop bool)

Stops bot

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL