discord

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAndStart

func CreateAndStart() bool

constructor

func GuildCreate

func GuildCreate(guild structure.Guild) bool

func GuildExist

func GuildExist(guild structure.Guild) (bool, error)

func GuildGet

func GuildGet(guild structure.Guild) (structure.Guild, error)

func HCooldownGet added in v0.2.0

func HCooldownGet(user structure.Member, command string, exp time.Duration) (bool, error)

func HCooldownset added in v0.2.0

func HCooldownset(user structure.Member, command string)

func LCooldownGet added in v0.2.0

func LCooldownGet(user structure.Member, command string, exp time.Duration) (bool, error)

Exp is in sec => true cooldown active / false cooldown expired

func LCooldownset added in v0.2.0

func LCooldownset(user structure.Member, command string)

func MessageCreate

func MessageCreate(s *discordgo.Session, m *discordgo.MessageCreate)

Types

type BotCache

type BotCache struct {
	sync.RWMutex
	GuildCache  *bigcache.BigCache
	MemberCache *bigcache.BigCache
	ConfigCache *bigcache.BigCache
	Lcooldown   *bigcache.BigCache
	Hcooldown   *bigcache.BigCache
	// contains filtered or unexported fields
}

func NewBotCache

func NewBotCache() BotCache

func (*BotCache) GetGuild

func (BotCache *BotCache) GetGuild(id string) (bool, structure.Guild)

func (*BotCache) GetHcooldown added in v0.2.0

func (BotCache *BotCache) GetHcooldown(id string, cooldowncmd string) (bool, time.Time)

func (*BotCache) GetLcooldown added in v0.2.0

func (BotCache *BotCache) GetLcooldown(id string, cooldowncmd string) (bool, time.Time)

func (*BotCache) GetMember

func (BotCache *BotCache) GetMember(id string) (bool, structure.Member)

func (*BotCache) LockAllCache

func (botcache *BotCache) LockAllCache() bool

func (*BotCache) SetGuild

func (botcache *BotCache) SetGuild(guildobj structure.Guild)

func (*BotCache) SetHcool added in v0.2.0

func (botcache *BotCache) SetHcool(memberobj structure.Member, cooldowncmd string, t time.Time)

func (*BotCache) SetLcool added in v0.2.0

func (botcache *BotCache) SetLcool(memberobj structure.Member, cooldowncmd string, t time.Time)

func (*BotCache) SetMember

func (botcache *BotCache) SetMember(memberobj structure.Member)

func (*BotCache) UnlockAllCache

func (botcache *BotCache) UnlockAllCache() bool

type BotStruct

type BotStruct struct {
	sync.RWMutex
	// contains filtered or unexported fields
}
var BotVar *BotStruct

func (*BotStruct) GetCache

func (bot *BotStruct) GetCache() *BotCache

Get the cache struct

func (*BotStruct) Shutdown

func (bot *BotStruct) Shutdown()

type Cmd

type Cmd interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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