Documentation
¶
Index ¶
- Constants
- func Init(bot *bot.Bot) (clearCacheFunc func(discord.GuildID, ...discord.ChannelID), ...)
- func IsThread(ch *discord.Channel) bool
- type Bot
- func (bot *Bot) GetWebhook(id discord.ChannelID) (*Webhook, error)
- func (bot *Bot) HandleCache(iface interface{})
- func (bot *Bot) Invites(guildID discord.GuildID) ([]discord.Invite, error)
- func (bot *Bot) Member(guildID discord.GuildID, userID discord.UserID) (discord.Member, error)
- func (bot *Bot) MemberContext(ctx context.Context, guildID discord.GuildID, userID discord.UserID) (discord.Member, error)
- func (bot *Bot) Queue(wh *discord.Webhook, event string, embed discord.Embed)
- func (bot *Bot) ResetCache(id discord.GuildID, channels ...discord.ChannelID)
- func (bot *Bot) RootChannel(guildID discord.GuildID, id discord.ChannelID) (*discord.Channel, error)
- func (bot *Bot) Send(wh *discord.Webhook, event string, embeds ...discord.Embed)
- func (bot *Bot) SetInvites(guildID discord.GuildID, is []discord.Invite) error
- func (bot *Bot) SetWebhook(channelID discord.ChannelID, w *Webhook) error
- func (bot *Bot) State(id discord.GuildID) *state.State
- func (bot *Bot) WebhookClient(wh *discord.Webhook) *webhook.Client
- type GuildKeyRoleUpdateEvent
- type MemberKickEvent
- type Queue
- type Webhook
Constants ¶
View Source
const ( ErrNotExists = errors.Sentinel("webhook not found in cache") ErrInvalid = errors.Sentinel("invalid cache value") )
Errors for the webhook cache
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bot ¶
type Bot struct { *bot.Bot SentryEnricher *handler.SentryHandler ProxiedTriggers *concurrent.Set[discord.MessageID] HandledMessages *concurrent.Set[discord.MessageID] Queues *concurrent.Map[discord.WebhookID, *Queue] WebhookClients *concurrent.Map[discord.WebhookID, *webhook.Client] BotJoinLeaveLog discord.ChannelID Start time.Time EventHandler *handler.Handler // contains filtered or unexported fields }
Bot ...
func (*Bot) GetWebhook ¶
GetWebhook gets a cached webhook from redis
func (*Bot) HandleCache ¶
func (bot *Bot) HandleCache(iface interface{})
func (*Bot) MemberContext ¶
func (*Bot) ResetCache ¶
ResetCache ...
func (*Bot) RootChannel ¶
func (bot *Bot) RootChannel(guildID discord.GuildID, id discord.ChannelID) (*discord.Channel, error)
RootChannel returns the given channel's root channel--either the channel itself, or the parent channel if it's a thread.
func (*Bot) SetInvites ¶
func (*Bot) SetWebhook ¶
SetWebhook ...
type GuildKeyRoleUpdateEvent ¶
type GuildKeyRoleUpdateEvent struct { *gateway.GuildMemberUpdateEvent ChannelID discord.ChannelID AddedRoles []discord.RoleID RemovedRoles []discord.RoleID }
GuildKeyRoleUpdateEvent ...
type MemberKickEvent ¶
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue is a webhook embed queue.
func (*Queue) TotalLength ¶
TotalLength returns the total length of all embeds in this Queue.
Source Files
¶
- bulk_message_delete.go
- cache.go
- channel_create.go
- channel_delete.go
- channel_update.go
- guild_ban_add.go
- guild_ban_remove.go
- guild_create.go
- guild_delete.go
- guild_emojis_update.go
- guild_key_role_update.go
- guild_member_add.go
- guild_member_remove.go
- guild_member_update.go
- guild_update.go
- ignore.go
- invite.go
- invites.go
- kick.go
- member_cache.go
- message_create.go
- message_delete.go
- message_update.go
- module.go
- queue.go
- role_create.go
- role_delete.go
- role_update.go
- stats.go
- status.go
- timeout.go
- webhooks.go
Click to show internal directories.
Click to hide internal directories.