discord

package
v0.0.0-...-19ad383 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

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

Bot is an object representing a Discord bot

func New

func New(c ifaces.IConfigurator, wg *sync.WaitGroup, exit chan struct{}) *Bot

New returns a new instance of discord.Bot

func (*Bot) ChatPipe

func (b *Bot) ChatPipe() chan ifaces.ChatData

ChatPipe returns the current channel to pipe chats into

func (*Bot) Loglevel

func (b *Bot) Loglevel() int

Loglevel returns the current loglevel for the object

func (*Bot) Mention

func (b *Bot) Mention() string

Mention returns the sesions bot mention

func (*Bot) SetChatPipe

func (b *Bot) SetChatPipe(cd chan ifaces.ChatData)

SetChatPipe sets the current channel to pipe chats into

func (*Bot) SetLoglevel

func (b *Bot) SetLoglevel(l int)

SetLoglevel sets the current loglevel for the object

func (*Bot) Start

func (b *Bot) Start(gs ifaces.IGameServer)

Start initializes the discordgo backend

func (*Bot) UUID

func (b *Bot) UUID() string

UUID returns the UUID for the Logger

type CachedColor

type CachedColor struct {
	Integer int
	String  string
	Short   string
}

CachedColor describes a role color that has been cached with its Number, hex code, and shortcode

type DataCache

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

DataCache represents a cache of member nicknames on registered Guilds

func (*DataCache) AddGuild

func (d *DataCache) AddGuild(gid string)

AddGuild adds a guild to the known guilds cache

func (*DataCache) GetColor

func (d *DataCache) GetColor(s *discordgo.Session, gid,
	uid string) (int, string, string)

GetColor returns the cached discord role color for that guildmember

func (*DataCache) GetName

func (d *DataCache) GetName(s *discordgo.Session, gid,
	uid string) (string, bool)

GetName returns the cached nickname for that guildmember

func (*DataCache) Loglevel

func (d *DataCache) Loglevel() int

Loglevel returns the current loglevel for the object

func (*DataCache) SetLoglevel

func (d *DataCache) SetLoglevel(l int)

SetLoglevel sets the current loglevel for the object

func (*DataCache) UUID

func (d *DataCache) UUID() string

UUID returns the UUID for the Logger

func (*DataCache) UpdateCache

func (d *DataCache) UpdateCache(s *discordgo.Session, gs ifaces.IGameServer)

UpdateCache updates the internal name cache for nicknames and linked player names. Linked player names takes precedence.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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