Documentation ¶
Index ¶
- Variables
- type Command
- type Components
- func (c *Components) AddCommand(cmd Command)
- func (c *Components) AddCommands(cmds ...Command)
- func (c *Components) Config() Config
- func (c *Components) DB() *ent.Client
- func (c *Components) GetLock(namespace string) *Mu
- func (c *Components) GuildCreate(ctx context.Context, ownerID snowflake.ID, g *events.GenericGuild) (*ent.Guild, error)
- func (c *Components) GuildCreateID(ctx context.Context, gid snowflake.ID) (*ent.Guild, error)
- func (c *Components) GuildRequest(client bot.Client, gid snowflake.ID) (*discord.Guild, error)
- func (c *Components) Initialize(client bot.Client) error
- func (c *Components) MemberCreate(ctx context.Context, u discord.User, gid snowflake.ID) (*ent.Member, error)
- func (c *Components) OnEvent() func(bot bot.Event)
- func (c *Components) OnGuildJoin() func(event *events.GuildJoin)
- func (c *Components) OnGuildLeave() func(event *events.GuildLeave)
- func (c *Components) UserCreate(ctx context.Context, u discord.User) (*ent.User, error)
- type Config
- type ConfigDebug
- type ConfigMessage
- type Mu
- type Scheduler
- type SchedulerFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultCommands []Command
)
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface { Name() string Create() []discord.ApplicationCommandCreate IsPrivate() bool CommandHandler() func(event *events.ApplicationCommandInteractionCreate) error ComponentHandler() func(event *events.ComponentInteractionCreate) error ModalHandler() func(event *events.ModalSubmitInteractionCreate) error AutocompleteHandler() func(event *events.AutocompleteInteractionCreate) error OnEvent() func(event bot.Event) error Scheduler() []Scheduler }
type Components ¶
type Components struct { Version string // contains filtered or unexported fields }
func (*Components) AddCommand ¶
func (c *Components) AddCommand(cmd Command)
func (*Components) AddCommands ¶
func (c *Components) AddCommands(cmds ...Command)
func (*Components) Config ¶
func (c *Components) Config() Config
func (*Components) DB ¶
func (c *Components) DB() *ent.Client
func (*Components) GetLock ¶
func (c *Components) GetLock(namespace string) *Mu
func (*Components) GuildCreate ¶
func (c *Components) GuildCreate(ctx context.Context, ownerID snowflake.ID, g *events.GenericGuild) (*ent.Guild, error)
func (*Components) GuildCreateID ¶
func (*Components) GuildRequest ¶
func (*Components) Initialize ¶
func (c *Components) Initialize(client bot.Client) error
func (*Components) MemberCreate ¶
func (*Components) OnEvent ¶
func (c *Components) OnEvent() func(bot bot.Event)
func (*Components) OnGuildJoin ¶
func (c *Components) OnGuildJoin() func(event *events.GuildJoin)
func (*Components) OnGuildLeave ¶
func (c *Components) OnGuildLeave() func(event *events.GuildLeave)
func (*Components) UserCreate ¶
type Config ¶
type Config struct { TranslateDir string `yaml:"translate_dir"` Debug ConfigDebug `yaml:"debug"` Message ConfigMessage `yaml:"message"` MySQL string `yaml:"mysql"` Redis []string `yaml:"redis"` BumpUserID snowflake.ID `yaml:"bump_user"` BumpImage string `yaml:"bump_image"` UpUserID snowflake.ID `yaml:"up_user"` UpColor int `yaml:"up_color"` }
type ConfigDebug ¶
type ConfigDebug struct { DebugUsers []snowflake.ID `yaml:"users"` DebugGuilds []snowflake.ID `yaml:"guilds"` }
type ConfigMessage ¶
type ConfigMessage struct {
PinIconImage string `yaml:"pin_icon_image"`
}
type Scheduler ¶
type Scheduler struct { Duration time.Duration Worker SchedulerFunc }
type SchedulerFunc ¶
type SchedulerFunc func(c *Components, client bot.Client) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.