bot

package
v0.0.0-...-ab45ee7 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: AGPL-3.0 Imports: 19 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 {
	*bot.Bot

	DB          *db.DB
	Redis       radix.Client
	MemberStore mstore.Store

	Channels *concurrent.Map[discord.ChannelID, discord.Channel]
	Roles    *concurrent.Map[discord.RoleID, discord.Role]
	Guilds   *concurrent.Map[discord.GuildID, discord.Guild]
	// contains filtered or unexported fields
}

Bot ...

func New

func New(redisURL string, r *bcr.Router, db *db.DB) (b *Bot, err error)

New ...

func (*Bot) ForEach

func (bot *Bot) ForEach(fn func(s *state.State))

ForEach runs the given function on each shard

func (*Bot) MultiDo

func (bot *Bot) MultiDo(ctx context.Context, actions ...radix.Action) error

MultiDo executes the given Actions in order, and returns the error of the first to return a non-nil error.

func (*Bot) SetUser

func (bot *Bot) SetUser(u discord.User)

func (*Bot) User

func (bot *Bot) User(id discord.UserID) (*discord.User, error)

Jump to

Keyboard shortcuts

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