Documentation
¶
Index ¶
- Constants
- func IsThread(ch *discord.Channel) bool
- type Bot
- func (bot *Bot) CheckIfReady()
- func (bot *Bot) Prefix() string
- func (bot *Bot) Ready(*gateway.ReadyEvent)
- func (bot *Bot) Report(ctx *bcr.Context, err error) error
- func (bot *Bot) RootChannel(id discord.ChannelID) (*discord.Channel, error)
- func (bot *Bot) SendError(tmpl string, args ...interface{})
- func (bot *Bot) SendLog(tmpl string, args ...interface{})
- func (bot *Bot) WaitForGuild(ev *gateway.GuildCreateEvent)
- type Checker
- type Event
- type Scheduler
Constants ¶
View Source
const Colour = 0x2A52BE
Colour is the embed colour used throughout the bot
View Source
const ErrUnknownEvent = errors.Sentinel("unknown event type")
View Source
const Intents = gateway.IntentGuilds | gateway.IntentGuildMembers | gateway.IntentGuildBans | gateway.IntentGuildInvites | gateway.IntentGuildPresences | gateway.IntentGuildMessages | gateway.IntentGuildMessageReactions | gateway.IntentDirectMessages | gateway.IntentDirectMessageReactions
Intents are the bot's gateway intents
View Source
const Reschedule = errors.Sentinel("reschedule event")
Return Reschedule if the event should be rescheduled (offset by the duration returned from Offset)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bot ¶
type Bot struct {
*bot.Bot
Colour discord.Color
Interactions *bcr2.Router
State *state.State
DB *db.DB
Scheduler *Scheduler
Checker *Checker
PK *pkgo.Session
}
Bot ...
func (*Bot) RootChannel ¶
RootChannel returns the given channel's root channel--either the channel itself, or the parent channel if it's a thread.
func (*Bot) WaitForGuild ¶
func (bot *Bot) WaitForGuild(ev *gateway.GuildCreateEvent)
WaitForGuild ...
type Event ¶
type Event interface {
Execute(ctx context.Context, id int64, bot *Bot) error
Offset() time.Duration
}
Event is any event that can be scheduled. Execute is called when the event is due to fire, Offset is called to determine how much to move the event.
Click to show internal directories.
Click to hide internal directories.