Documentation ¶
Index ¶
- Variables
- type Bot
- func (b *Bot) EditMessageInChannel(ctx context.Context, channelID string, messageID string, ...) (*discordgo.Message, error)
- func (b *Bot) FindWebhookForChannel(ctx context.Context, channelID string) (*discordgo.Webhook, error)
- func (b *Bot) GetSessionForGuild(ctx context.Context, guildId string) (*discordgo.Session, error)
- func (b *Bot) GetWebhookForChannel(ctx context.Context, channelID string, webhookID string) (*discordgo.Webhook, error)
- func (b *Bot) HandleEntitlementEvent(e *Entitlement)
- func (b *Bot) RegisterCommand() error
- func (b *Bot) SendMessageToChannel(ctx context.Context, channelID string, params *discordgo.WebhookParams) (*discordgo.Message, error)
- func (b *Bot) Start() error
- type Entitlement
Constants ¶
This section is empty.
Variables ¶
View Source
var MessageIDRe = regexp.MustCompile("https?://(?:canary\\.|ptb\\.)?discord\\.com/channels/[0-9]+/([0-9]+)/([0-9]+)")
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct { *sharding.ShardManager ActionHandler *handler.ActionHandler ActionParser *parser.ActionParser // contains filtered or unexported fields }
func (*Bot) EditMessageInChannel ¶
func (b *Bot) EditMessageInChannel(ctx context.Context, channelID string, messageID string, params *discordgo.WebhookEdit) (*discordgo.Message, error)
EditMessageInChannel edits a message in a channel, either sent by a webhook or by the configured custom bot.
func (*Bot) FindWebhookForChannel ¶
func (b *Bot) FindWebhookForChannel(ctx context.Context, channelID string) (*discordgo.Webhook, error)
FindWebhookForChannel returns a webhook for the given channel that was created by the bot or the configured custom bot.
func (*Bot) GetSessionForGuild ¶
GetSessionForGuild returns the session for the given guild. If a custom bot is configured for the guild, the token of the custom bot will be used to create the session.
func (*Bot) GetWebhookForChannel ¶
func (b *Bot) GetWebhookForChannel(ctx context.Context, channelID string, webhookID string) (*discordgo.Webhook, error)
GetWebhookForChannel returns the webhook for the given channel if available.
func (*Bot) HandleEntitlementEvent ¶
func (b *Bot) HandleEntitlementEvent(e *Entitlement)
func (*Bot) RegisterCommand ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.