Documentation ¶
Index ¶
- Constants
- Variables
- func ErrCode(err error) int
- func WrapHandler[Action any](main context.Context, name string, handle func(context.Context, Action) error) func(*discordgo.Session, Action)
- type Bot
- type ChannelOrder
- type Client
- func (c *Client) ChannelSend(ch *discordgo.Channel, msg string) (string, error)
- func (c *Client) ChannelSendComponents(ch *discordgo.Channel, msg string, components []discordgo.MessageComponent) (string, error)
- func (c *Client) ChannelSendRawID(chID, msg string) error
- func (c *Client) CheckRateLimit(url string) *time.Time
- func (c *Client) Close() error
- func (c *Client) CreateCategory(name string, position int) (*discordgo.Channel, error)
- func (c *Client) CreateChannel(name string, category string, position int) (*discordgo.Channel, error)
- func (c *Client) CreateScheduledEvent(params *discordgo.GuildScheduledEventParams) (*discordgo.GuildScheduledEvent, error)
- func (c *Client) CreateUpdatePin(chanID, header string, embed *discordgo.MessageEmbed) error
- func (c *Client) DeleteScheduledEvent(event *discordgo.GuildScheduledEvent) error
- func (c *Client) GetChannel(id string) (*discordgo.Channel, bool)
- func (c *Client) GetGuildMember(user *discordgo.User) (*discordgo.Member, error)
- func (c *Client) GetMessage(ch *discordgo.Channel, messageID string) (*discordgo.Message, error)
- func (c *Client) GetOAuth2Session(ctx context.Context, token string) (*OAuth2Session, error)
- func (c *Client) GetScheduledEvent(id string) (*discordgo.GuildScheduledEvent, error)
- func (c *Client) GetTopReaction(channel *discordgo.Channel, messageID string) (string, error)
- func (c *Client) ListCategoriesByName() map[string]*discordgo.Channel
- func (c *Client) ListChannelsByID() map[string]*discordgo.Channel
- func (c *Client) ListScheduledEvents() (map[string]*discordgo.GuildScheduledEvent, error)
- func (c *Client) ListVoiceChannels() map[string]string
- func (c *Client) MakeQM(user *discordgo.User) error
- func (c *Client) RegisterBots(bots ...Bot)
- func (c *Client) SetChannelCategory(channel string, category string, position int) error
- func (c *Client) SetChannelName(chID, name string, position int) error
- func (c *Client) SortChannels(order []ChannelOrder) error
- func (c *Client) UnMakeQM(user *discordgo.User) error
- func (c *Client) UpdateScheduledEvent(event *discordgo.GuildScheduledEvent, ...) (*discordgo.GuildScheduledEvent, error)
- func (c *Client) UpdateStatus(data discordgo.UpdateStatusData) error
- type CommandInput
- type Config
- type OAuth2Session
Constants ¶
View Source
const DefaultHandlerTimeout = 120 * time.Second
View Source
const HandlerTimeout = 120 * time.Second
Variables ¶
View Source
var DevConfig = Config{
GuildID: "1058090773582721214",
QMRoleID: "1058092621475614751",
QMChannelID: "1058092560926646282",
HangingOutChannelID: "1058090774488678532",
MoreEyesChannelID: "1058092531688157266",
}
View Source
var EndpointOAuth2Session = discordgo.EndpointOAuth2 + "@me"
View Source
var ProdConfig = Config{
GuildID: "793599987694436374",
QMRoleID: "793618399322046515",
QMChannelID: "795780814846689321",
HangingOutChannelID: "793599987694436377",
MoreEyesChannelID: "793607709022748683",
}
Functions ¶
Types ¶
type Bot ¶
type Bot interface { Register() (cmd *discordgo.ApplicationCommand, async bool) Handle(context.Context, *CommandInput) (string, error) HandleScheduledEvent(context.Context, *discordgo.GuildScheduledEventUpdate) error }
type ChannelOrder ¶
type Client ¶
type Client struct { Guild *discordgo.Guild Application *discordgo.Application QMChannel *discordgo.Channel // for puzzle maintenance HangingOutChannel *discordgo.Channel // for solves, to celebrate MoreEyesChannel *discordgo.Channel // for verbose puzzle updates DefaultVoiceChannel *discordgo.Channel // for placeholder events QMRole *discordgo.Role // so QMs show up in the sidebar // contains filtered or unexported fields }
func (*Client) ChannelSend ¶
func (*Client) ChannelSendComponents ¶
func (*Client) ChannelSendRawID ¶
func (*Client) CreateCategory ¶
func (*Client) CreateChannel ¶
func (*Client) CreateScheduledEvent ¶
func (c *Client) CreateScheduledEvent( params *discordgo.GuildScheduledEventParams, ) (*discordgo.GuildScheduledEvent, error)
func (*Client) CreateUpdatePin ¶
func (c *Client) CreateUpdatePin(chanID, header string, embed *discordgo.MessageEmbed) error
Set the pinned status message, by posting one or editing the existing one. No-op if the status was already set.
func (*Client) DeleteScheduledEvent ¶
func (c *Client) DeleteScheduledEvent(event *discordgo.GuildScheduledEvent) error
func (*Client) GetGuildMember ¶
func (*Client) GetMessage ¶
func (*Client) GetOAuth2Session ¶
func (*Client) GetScheduledEvent ¶
func (c *Client) GetScheduledEvent(id string) (*discordgo.GuildScheduledEvent, error)
func (*Client) GetTopReaction ¶
func (*Client) ListCategoriesByName ¶
func (*Client) ListScheduledEvents ¶
func (c *Client) ListScheduledEvents() (map[string]*discordgo.GuildScheduledEvent, error)
func (*Client) ListVoiceChannels ¶
func (*Client) RegisterBots ¶
func (*Client) SetChannelCategory ¶
func (*Client) SetChannelName ¶
func (*Client) SortChannels ¶
func (c *Client) SortChannels(order []ChannelOrder) error
func (*Client) UpdateScheduledEvent ¶
func (c *Client) UpdateScheduledEvent( event *discordgo.GuildScheduledEvent, params *discordgo.GuildScheduledEventParams, ) (*discordgo.GuildScheduledEvent, error)
func (*Client) UpdateStatus ¶
func (c *Client) UpdateStatus(data discordgo.UpdateStatusData) error
type CommandInput ¶
type CommandInput struct { IC *discordgo.InteractionCreate User *discordgo.User Command string Subcommand string Options map[string]*discordgo.ApplicationCommandInteractionDataOption // contains filtered or unexported fields }
func (CommandInput) EditMessage ¶
func (i CommandInput) EditMessage(msg string) error
type OAuth2Session ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.