discord

package
v0.0.0-...-b3e7a1a Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2016 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TooManyLookupFailures = Error.NewClass("too many skill rank lookup failures")
	BTagNotFound          = Error.NewClass("couldn't find a BattleTag for rank")
)
View Source
var (
	CommandNotFound = Error.NewClass("command not found",
		errors.NoCaptureStack())
)
View Source
var (
	Error = errors.NewClass("discord")
)
View Source
var (
	PermissionDenied = Error.NewClass("permission denied")
)

Functions

func New

func New(redis_client *redis.Client) *bot

Types

type BattleTagCache

type BattleTagCache struct {
	// contains filtered or unexported fields
}

func NewBattleTagCache

func NewBattleTagCache(c cache.Cache) *BattleTagCache

func (*BattleTagCache) Clear

func (c *BattleTagCache) Clear() error

func (*BattleTagCache) Get

func (c *BattleTagCache) Get(key string) (string, error)

func (*BattleTagCache) Iter

func (c *BattleTagCache) Iter(fn func(key string, btag string) bool)

func (*BattleTagCache) Set

func (c *BattleTagCache) Set(key string, value string) error

type BattleTagQueue

type BattleTagQueue struct {
	// contains filtered or unexported fields
}

func (*BattleTagQueue) Clear

func (q *BattleTagQueue) Clear() error

func (*BattleTagQueue) DequeueN

func (q *BattleTagQueue) DequeueN(n int) (
	taken []*userBattleTag, num_left int, err error)

func (*BattleTagQueue) Enqueue

func (q *BattleTagQueue) Enqueue(datum *userBattleTag) (int, error)

func (*BattleTagQueue) Iter

func (q *BattleTagQueue) Iter(fn func(int, *userBattleTag) bool) error

func (*BattleTagQueue) Position

func (q *BattleTagQueue) Position(ubt *userBattleTag) (int, error)

func (*BattleTagQueue) Remove

func (q *BattleTagQueue) Remove(ubt *userBattleTag) error

func (*BattleTagQueue) Size

func (q *BattleTagQueue) Size() (int, error)

type DiscordHandler

type DiscordHandler interface {
	Handle(s Session, m *discordgo.MessageCreate, argv ...string) error
	commands.CommandWithHelp
}

type Message

type Message interface {
	ChannelId() string
}

type Session

type Session interface {
	Channel(channel_id string) (*discordgo.Channel, error)
	ChannelMessageSend(channel_id, message string) error
	Member(guild_id, user_id string) (*discordgo.Member, error)
	User(user_id string) (*discordgo.User, error)
	UserChannelCreate(user_id string) (*discordgo.Channel, error)
	UserChannelPermissions(user_id, channel_id string) (int, error)
}

Jump to

Keyboard shortcuts

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