Documentation
¶
Index ¶
- Constants
- Variables
- func DescribePerms(bitmask int64) []string
- func HasPerm(bitmask, required int64) bool
- func IntentsAll() int64
- func IntentsDefault() int64
- func IntentsNone() int64
- func PermsAll() int64
- type Attachment
- type BadArgument
- type BanterError
- type Bot
- func (b *Bot) AutoNotFoundReply()
- func (b *Bot) CreateCategory(ctx context.Context, guildID, name string) (*Category, error)
- func (b *Bot) CreateChannel(ctx context.Context, guildID, name string, opts ChannelOpts) (*Channel, error)
- func (b *Bot) DeleteCategory(ctx context.Context, categoryID string) error
- func (b *Bot) DeleteChannel(ctx context.Context, channelID string) error
- func (b *Bot) Done() <-chan struct{}
- func (b *Bot) DownloadAttachment(ctx context.Context, att *Attachment) (*File, error)
- func (b *Bot) EnsureCategory(ctx context.Context, guildID, name string) (*Category, error)
- func (b *Bot) EnsureChannel(ctx context.Context, guildID, name string, opts ChannelOpts) (*Channel, error)
- func (b *Bot) EveryoneRole(ctx context.Context, guildID string) (*Role, error)
- func (b *Bot) GetChannel(ctx context.Context, channelID string) (*Channel, error)
- func (b *Bot) GetGuild(ctx context.Context, guildID string) (*Guild, error)
- func (b *Bot) ListCategories(ctx context.Context, guildID string) ([]*Category, error)
- func (b *Bot) ListChannels(ctx context.Context, guildID string) ([]*Channel, error)
- func (b *Bot) OnButton(customID string, handler ButtonHandler)
- func (b *Bot) OnError(h ErrorHandler)
- func (b *Bot) OnMemberJoin(h MemberJoinHandler)
- func (b *Bot) OnMessage(h MessageHandler)
- func (b *Bot) OnMessageDelete(h MessageDeleteHandler)
- func (b *Bot) OnMessageEdit(h MessageEditHandler)
- func (b *Bot) OnReactionAdd(h ReactionAddHandler)
- func (b *Bot) OnReactionRemove(h ReactionRemoveHandler)
- func (b *Bot) OnReady(h ReadyHandler)
- func (b *Bot) OnResumed(h ResumedHandler)
- func (b *Bot) PrefixCommand(name, help, category string, handler PrefixHandler, aliases ...string)
- func (b *Bot) Run(ctx context.Context, token string) error
- func (b *Bot) SendEmbed(ctx context.Context, channelID string, embed *Embed) (*Message, error)
- func (b *Bot) SendFile(ctx context.Context, channelID string, file *File, opts SendFileOpts) (*Message, error)
- func (b *Bot) SendMessage(ctx context.Context, channelID, content string) (*Message, error)
- func (b *Bot) SlashCommand(name, description string, options []SlashOption, handler SlashHandler)
- type BotOpts
- type BuildEmbedFn
- type ButtonHandler
- type ButtonOpts
- type Category
- type Channel
- type ChannelOpts
- type CommandError
- type CommandNotFound
- type Context
- type CreateCategoryBody
- type CreateChannelBody
- type CreateRoleBody
- type Dispatcher
- type DuplicateCommand
- type EditCategoryPatch
- type EditChannelPatch
- type EditGuildPatch
- type Embed
- func (e *Embed) AddButton(label string, opts ButtonOpts) *Embed
- func (e *Embed) AddField(name, value string, inline bool) *Embed
- func (e *Embed) Author(name, url, iconURL string) *Embed
- func (e *Embed) ColorHex(s string) *Embed
- func (e *Embed) ColorInt(c int) *Embed
- func (e *Embed) Description(s string) *Embed
- func (e *Embed) Footer(text, iconURL string) *Embed
- func (e *Embed) Image(url string) *Embed
- func (e *Embed) PendingComponents() []map[string]any
- func (e *Embed) Thumbnail(url string) *Embed
- func (e *Embed) Title(s string) *Embed
- func (e *Embed) ToDict() map[string]any
- func (e *Embed) URL(s string) *Embed
- type ErrorHandler
- type FetchFn
- type File
- type Forbidden
- type Gateway
- func (g *Gateway) Close() error
- func (g *Gateway) CloseInfo() (int, string)
- func (g *Gateway) Connect(ctx context.Context) error
- func (g *Gateway) InvalidSession() bool
- func (g *Gateway) LastSeq() int
- func (g *Gateway) Run(ctx context.Context) error
- func (g *Gateway) SetResume(sessionID string, seq int)
- type GatewayError
- type Guild
- type HTTPClient
- func (h *HTTPClient) AddReaction(ctx context.Context, channelID, messageID, emoji string) ([]byte, error)
- func (h *HTTPClient) AddRole(ctx context.Context, guildID, userID, roleID string) ([]byte, error)
- func (h *HTTPClient) BanMember(ctx context.Context, guildID, userID, reason string) ([]byte, error)
- func (h *HTTPClient) Close() error
- func (h *HTTPClient) CreateCategory(ctx context.Context, guildID string, body CreateCategoryBody) ([]byte, error)
- func (h *HTTPClient) CreateChannel(ctx context.Context, guildID string, body CreateChannelBody) ([]byte, error)
- func (h *HTTPClient) CreateRole(ctx context.Context, guildID string, body CreateRoleBody) ([]byte, error)
- func (h *HTTPClient) DeleteCategory(ctx context.Context, categoryID string) ([]byte, error)
- func (h *HTTPClient) DeleteChannel(ctx context.Context, channelID string) ([]byte, error)
- func (h *HTTPClient) DeleteMessage(ctx context.Context, messageID string) ([]byte, error)
- func (h *HTTPClient) DeleteRole(ctx context.Context, roleID string) ([]byte, error)
- func (h *HTTPClient) DownloadAttachment(ctx context.Context, attachmentID string) ([]byte, error)
- func (h *HTTPClient) EditCategory(ctx context.Context, categoryID string, patch EditCategoryPatch) ([]byte, error)
- func (h *HTTPClient) EditChannel(ctx context.Context, channelID string, patch EditChannelPatch) ([]byte, error)
- func (h *HTTPClient) EditGuild(ctx context.Context, guildID string, patch EditGuildPatch) ([]byte, error)
- func (h *HTTPClient) EditMessage(ctx context.Context, messageID, content string) ([]byte, error)
- func (h *HTTPClient) EditRole(ctx context.Context, roleID string, patch map[string]any) ([]byte, error)
- func (h *HTTPClient) GetChannel(ctx context.Context, channelID string) ([]byte, error)
- func (h *HTTPClient) GetGuild(ctx context.Context, guildID string) ([]byte, error)
- func (h *HTTPClient) GetMember(ctx context.Context, guildID, userID string) ([]byte, error)
- func (h *HTTPClient) GetRole(ctx context.Context, roleID string) ([]byte, error)
- func (h *HTTPClient) GetUser(ctx context.Context, userID string) ([]byte, error)
- func (h *HTTPClient) KickMember(ctx context.Context, guildID, userID string) ([]byte, error)
- func (h *HTTPClient) ListCategories(ctx context.Context, guildID string) ([]byte, error)
- func (h *HTTPClient) ListChannelMembers(ctx context.Context, channelID string, limit, offset int, search string) ([]byte, error)
- func (h *HTTPClient) ListChannels(ctx context.Context, guildID string) ([]byte, error)
- func (h *HTTPClient) ListCommands(ctx context.Context) ([]byte, error)
- func (h *HTTPClient) ListGuildBans(ctx context.Context, guildID string) ([]byte, error)
- func (h *HTTPClient) ListMessages(ctx context.Context, channelID, before string, limit int) ([]byte, error)
- func (h *HTTPClient) ListRoles(ctx context.Context, guildID string) ([]byte, error)
- func (h *HTTPClient) Me(ctx context.Context) ([]byte, error)
- func (h *HTTPClient) PurgeChannel(ctx context.Context, channelID string, limit int) ([]byte, error)
- func (h *HTTPClient) RegisterCommands(ctx context.Context, commands []map[string]any) ([]byte, error)
- func (h *HTTPClient) RemoveReaction(ctx context.Context, channelID, messageID, emoji string) ([]byte, error)
- func (h *HTTPClient) RemoveRole(ctx context.Context, guildID, userID, roleID string) ([]byte, error)
- func (h *HTTPClient) ReorderCategories(ctx context.Context, guildID string, items []ReorderItem) ([]byte, error)
- func (h *HTTPClient) ReorderChannels(ctx context.Context, guildID string, items []ReorderItem) ([]byte, error)
- func (h *HTTPClient) Request(ctx context.Context, method, path string, body any, params map[string]string, ...) ([]byte, error)
- func (h *HTTPClient) RespondInteraction(ctx context.Context, interactionID, token string, body map[string]any) error
- func (h *HTTPClient) SendMessage(ctx context.Context, channelID string, body SendMessageBody) ([]byte, error)
- func (h *HTTPClient) SetCategoryPermissions(ctx context.Context, categoryID, roleID string, allow, deny int64) ([]byte, error)
- func (h *HTTPClient) SetChannelPermissions(ctx context.Context, channelID, roleID string, allow, deny int64) ([]byte, error)
- func (h *HTTPClient) TriggerTyping(ctx context.Context, channelID string) ([]byte, error)
- func (h *HTTPClient) UnbanMember(ctx context.Context, guildID, userID string) ([]byte, error)
- func (h *HTTPClient) UploadAttachment(ctx context.Context, channelID string, f *File) ([]byte, error)
- type HTTPException
- type HelpCommand
- type Interaction
- func (i *Interaction) Defer(ctx context.Context, ephemeral bool) error
- func (i *Interaction) Followup(ctx context.Context, content string, opts RespondOpts) error
- func (i *Interaction) IsButton() bool
- func (i *Interaction) IsSlash() bool
- func (i *Interaction) OptBool(name string, fallback bool) bool
- func (i *Interaction) OptInt(name string, fallback int) int
- func (i *Interaction) OptString(name, fallback string) string
- func (i *Interaction) Respond(ctx context.Context, content string, opts RespondOpts) error
- func (i *Interaction) Update(ctx context.Context, content string, opts RespondOpts) error
- type Logger
- type LoginFailure
- type Member
- type MemberJoinHandler
- type Message
- type MessageDeleteHandler
- type MessageEditHandler
- type MessageHandler
- type MissingArgument
- type MissingPermissions
- type NotFound
- type Paginator
- type PermissionOverride
- type PrefixHandler
- type RateLimited
- type ReactionAddHandler
- type ReactionRemoveHandler
- type ReadyHandler
- type ReorderItem
- type RespondOpts
- type ResumedHandler
- type Role
- type SendFileOpts
- type SendMessageBody
- type SlashHandler
- type SlashOption
- type User
Constants ¶
View Source
const ( ChannelTypeText = "text" ChannelTypeVoice = "voice" )
View Source
const ( OptionString = "STRING" OptionInteger = "INTEGER" OptionBoolean = "BOOLEAN" OptionUser = "USER" OptionChannel = "CHANNEL" OptionRole = "ROLE" )
View Source
const ( DefaultBaseURL = "https://banterchat.org" DefaultGatewayPath = "/api/v1/bot/gateway" DefaultCommandPrefix = "!" DefaultHelpColorInt = 0x5865f2 )
View Source
const ( MsgDupSlashCommand = "duplicate slash command %q — fix your command loader and restart" MsgDupPrefixCommand = "duplicate prefix command %q — fix your command loader and restart" MsgDupButtonHandler = "duplicate button handler %q — fix your loader and restart" MsgEmptyButtonID = "OnButton: custom_id must be non-empty" MsgCommandSyncDup = "" /* 218-byte string literal not displayed */ MsgSlashHandlerFailed = "Command failed." )
View Source
const ( IntentGuilds int64 = 1 << 0 IntentGuildMembers int64 = 1 << 1 IntentGuildModeration int64 = 1 << 2 IntentGuildPresences int64 = 1 << 3 IntentGuildMessages int64 = 1 << 4 IntentGuildReactions int64 = 1 << 5 IntentGuildTyping int64 = 1 << 6 IntentGuildVoiceStates int64 = 1 << 7 IntentDirectMessages int64 = 1 << 8 IntentDirectReactions int64 = 1 << 9 IntentDirectTyping int64 = 1 << 10 IntentMessageContent int64 = 1 << 11 IntentBotEvents int64 = 1 << 12 )
View Source
const ( PermSendMessages int64 = 1 << 0 PermManageChannels int64 = 1 << 1 PermManageRoles int64 = 1 << 2 PermManageMessages int64 = 1 << 3 PermAdministrator int64 = 1 << 4 PermMentionEveryone int64 = 1 << 5 PermViewChannels int64 = 1 << 6 PermAttachFiles int64 = 1 << 7 PermBanMembers int64 = 1 << 8 PermUseSlashCommands int64 = 1 << 9 PermManageGuild int64 = 1 << 10 PermKickMembers int64 = 1 << 11 )
View Source
const Version = "0.1.0"
Variables ¶
View Source
var ( ErrInteractionDetached = errors.New("interaction has no attached client") ErrBotAlreadyRunning = errors.New("banter: bot already running") ErrBotNotRunning = errors.New("banter: bot not running; call HTTP methods from handlers (e.g. OnReady) or after Run starts") ErrDownloadNilAttachment = errors.New("banter: DownloadAttachment called with nil attachment") ErrSendFileNilFile = errors.New("banter: SendFile called with nil file") ErrInteractionHTTPMissing = errors.New("interaction has no attached HTTP client") ErrInteractionResponded = errors.New("interaction already responded to") ErrRespondEmpty = errors.New("respond requires non-empty content or an embed") ErrFollowupEmpty = errors.New("followup requires non-empty content or an embed") ErrUpdateNotButton = errors.New("update is only valid for button interactions — use Respond or Followup for slash commands") ErrContextDetached = errors.New("context detached from bot") ErrFileNeedsFilename = errors.New("file constructors require a filename") ErrHTTPRetriesExhausted = errors.New("http: exhausted retries without returning") ErrUploadRetriesExhausted = errors.New("upload: exhausted retries") ErrEveryoneNotFound = errors.New("@everyone role not found in guild") )
View Source
var NoHelpCommand = &HelpCommand{disabled: true}
Functions ¶
func DescribePerms ¶
func IntentsAll ¶
func IntentsAll() int64
func IntentsDefault ¶
func IntentsDefault() int64
func IntentsNone ¶
func IntentsNone() int64
Types ¶
type Attachment ¶
type BadArgument ¶
type BadArgument struct {
CommandError
Name string
Value string
Expected string
}
type BanterError ¶
type BanterError struct {
Msg string
}
func (*BanterError) Error ¶
func (e *BanterError) Error() string
type Bot ¶
type Bot struct {
User *User
SessionID string
Guilds map[string]*Guild
HTTP *HTTPClient
// contains filtered or unexported fields
}
func (*Bot) AutoNotFoundReply ¶ added in v0.1.9
func (b *Bot) AutoNotFoundReply()
func (*Bot) CreateCategory ¶
func (*Bot) CreateChannel ¶
func (*Bot) DeleteCategory ¶ added in v0.1.3
func (*Bot) DeleteChannel ¶ added in v0.1.3
func (*Bot) DownloadAttachment ¶ added in v0.1.2
func (*Bot) EnsureCategory ¶ added in v0.1.1
func (*Bot) EnsureChannel ¶ added in v0.1.1
func (*Bot) EveryoneRole ¶
func (*Bot) GetChannel ¶
func (*Bot) ListCategories ¶ added in v0.1.1
func (*Bot) ListChannels ¶
func (*Bot) OnButton ¶
func (b *Bot) OnButton(customID string, handler ButtonHandler)
func (*Bot) OnError ¶
func (b *Bot) OnError(h ErrorHandler)
func (*Bot) OnMemberJoin ¶
func (b *Bot) OnMemberJoin(h MemberJoinHandler)
func (*Bot) OnMessage ¶
func (b *Bot) OnMessage(h MessageHandler)
func (*Bot) OnMessageDelete ¶
func (b *Bot) OnMessageDelete(h MessageDeleteHandler)
func (*Bot) OnMessageEdit ¶
func (b *Bot) OnMessageEdit(h MessageEditHandler)
func (*Bot) OnReactionAdd ¶
func (b *Bot) OnReactionAdd(h ReactionAddHandler)
func (*Bot) OnReactionRemove ¶
func (b *Bot) OnReactionRemove(h ReactionRemoveHandler)
func (*Bot) OnReady ¶
func (b *Bot) OnReady(h ReadyHandler)
func (*Bot) OnResumed ¶
func (b *Bot) OnResumed(h ResumedHandler)
func (*Bot) PrefixCommand ¶
func (b *Bot) PrefixCommand(name, help, category string, handler PrefixHandler, aliases ...string)
func (*Bot) SendMessage ¶
func (*Bot) SlashCommand ¶
func (b *Bot) SlashCommand(name, description string, options []SlashOption, handler SlashHandler)
type BuildEmbedFn ¶
type ButtonHandler ¶
type ButtonHandler func(ctx context.Context, i *Interaction) error
type ButtonOpts ¶
type ChannelOpts ¶ added in v0.1.1
type CommandError ¶
type CommandError struct{ Msg string }
func (*CommandError) Error ¶
func (e *CommandError) Error() string
type CommandNotFound ¶
type CommandNotFound struct {
CommandError
Name string
Message *Message
}
type CreateCategoryBody ¶
type CreateCategoryBody struct {
Name string `json:"name"`
PermissionOverrides []PermissionOverride `json:"permission_overrides,omitempty"`
}
type CreateChannelBody ¶
type CreateChannelBody struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
CategoryID string `json:"category_id,omitempty"`
Type string `json:"type,omitempty"`
PermissionOverrides []PermissionOverride `json:"permission_overrides,omitempty"`
}
type CreateRoleBody ¶
type CreateRoleBody struct {
Name string `json:"name"`
Color string `json:"color,omitempty"`
Description string `json:"description,omitempty"`
Permissions int64 `json:"permissions,omitempty"`
Deny int64 `json:"deny,omitempty"`
Position int `json:"position,omitempty"`
Mentionable bool `json:"mentionable,omitempty"`
}
type Dispatcher ¶
type Dispatcher func(ctx context.Context, eventType string, payload json.RawMessage)
type DuplicateCommand ¶
type DuplicateCommand struct {
BanterError
Name string
Source string
HTTPExc *HTTPException
}
type EditCategoryPatch ¶
type EditChannelPatch ¶
type EditGuildPatch ¶
type Embed ¶
type Embed struct {
// contains filtered or unexported fields
}
func DefaultNotFoundEmbed ¶ added in v0.1.9
func (*Embed) Description ¶
func (*Embed) PendingComponents ¶
type ErrorHandler ¶
type File ¶
func NewFileFromPath ¶
type Forbidden ¶
type Forbidden struct{ HTTPException }
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
func NewGateway ¶
func NewGateway(token string, intents int64, wsURL string, dispatcher Dispatcher) *Gateway
func (*Gateway) InvalidSession ¶
type GatewayError ¶
type GatewayError struct{ BanterError }
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
func NewHTTPClient ¶
func NewHTTPClient(token, baseURL string) *HTTPClient
func (*HTTPClient) AddReaction ¶
func (*HTTPClient) Close ¶
func (h *HTTPClient) Close() error
func (*HTTPClient) CreateCategory ¶
func (h *HTTPClient) CreateCategory(ctx context.Context, guildID string, body CreateCategoryBody) ([]byte, error)
func (*HTTPClient) CreateChannel ¶
func (h *HTTPClient) CreateChannel(ctx context.Context, guildID string, body CreateChannelBody) ([]byte, error)
func (*HTTPClient) CreateRole ¶
func (h *HTTPClient) CreateRole(ctx context.Context, guildID string, body CreateRoleBody) ([]byte, error)
func (*HTTPClient) DeleteCategory ¶
func (*HTTPClient) DeleteChannel ¶
func (*HTTPClient) DeleteMessage ¶
func (*HTTPClient) DeleteRole ¶
func (*HTTPClient) DownloadAttachment ¶
func (*HTTPClient) EditCategory ¶
func (h *HTTPClient) EditCategory(ctx context.Context, categoryID string, patch EditCategoryPatch) ([]byte, error)
func (*HTTPClient) EditChannel ¶
func (h *HTTPClient) EditChannel(ctx context.Context, channelID string, patch EditChannelPatch) ([]byte, error)
func (*HTTPClient) EditGuild ¶
func (h *HTTPClient) EditGuild(ctx context.Context, guildID string, patch EditGuildPatch) ([]byte, error)
func (*HTTPClient) EditMessage ¶
func (*HTTPClient) GetChannel ¶
func (*HTTPClient) KickMember ¶
func (*HTTPClient) ListCategories ¶
func (*HTTPClient) ListChannelMembers ¶
func (*HTTPClient) ListChannels ¶
func (*HTTPClient) ListCommands ¶
func (h *HTTPClient) ListCommands(ctx context.Context) ([]byte, error)
func (*HTTPClient) ListGuildBans ¶
func (*HTTPClient) ListMessages ¶
func (*HTTPClient) PurgeChannel ¶
func (*HTTPClient) RegisterCommands ¶
func (*HTTPClient) RemoveReaction ¶
func (*HTTPClient) RemoveRole ¶
func (*HTTPClient) ReorderCategories ¶
func (h *HTTPClient) ReorderCategories(ctx context.Context, guildID string, items []ReorderItem) ([]byte, error)
func (*HTTPClient) ReorderChannels ¶
func (h *HTTPClient) ReorderChannels(ctx context.Context, guildID string, items []ReorderItem) ([]byte, error)
func (*HTTPClient) RespondInteraction ¶
func (*HTTPClient) SendMessage ¶
func (h *HTTPClient) SendMessage(ctx context.Context, channelID string, body SendMessageBody) ([]byte, error)
func (*HTTPClient) SetCategoryPermissions ¶
func (*HTTPClient) SetChannelPermissions ¶
func (*HTTPClient) TriggerTyping ¶
func (*HTTPClient) UnbanMember ¶
func (*HTTPClient) UploadAttachment ¶
type HTTPException ¶
type HelpCommand ¶
type HelpCommand struct {
// contains filtered or unexported fields
}
func CustomHelpCommand ¶
func CustomHelpCommand(handler PrefixHandler) *HelpCommand
func DefaultHelpCommand ¶
func DefaultHelpCommand() *HelpCommand
type Interaction ¶
type Interaction struct {
ID string
Token string
AppID string
Type string
CommandName string
CustomID string
MessageID string
Options map[string]any
GuildID string
ChannelID string
UserID string
// contains filtered or unexported fields
}
func (*Interaction) Followup ¶
func (i *Interaction) Followup(ctx context.Context, content string, opts RespondOpts) error
func (*Interaction) IsButton ¶
func (i *Interaction) IsButton() bool
func (*Interaction) IsSlash ¶
func (i *Interaction) IsSlash() bool
func (*Interaction) OptString ¶
func (i *Interaction) OptString(name, fallback string) string
func (*Interaction) Respond ¶
func (i *Interaction) Respond(ctx context.Context, content string, opts RespondOpts) error
func (*Interaction) Update ¶
func (i *Interaction) Update(ctx context.Context, content string, opts RespondOpts) error
type LoginFailure ¶
type LoginFailure struct{ BanterError }
type MemberJoinHandler ¶
type Message ¶
type Message struct {
ID string `json:"id"`
ChannelID string `json:"channel_id"`
GuildID string `json:"guild_id"`
UserID string `json:"user_id"`
Content string `json:"content"`
CreatedAt string `json:"created_at"`
EditedAt string `json:"edited_at"`
ReplyTo string `json:"reply_to"`
Attachments []Attachment `json:"attachments"`
IsBot bool `json:"is_bot"`
// contains filtered or unexported fields
}
type MessageDeleteHandler ¶
type MessageDeleteHandler func(ctx context.Context, payload json.RawMessage)
type MessageEditHandler ¶
type MessageEditHandler func(ctx context.Context, payload json.RawMessage)
type MessageHandler ¶
type MissingArgument ¶
type MissingArgument struct {
CommandError
Name string
}
type MissingPermissions ¶
type MissingPermissions struct {
BanterError
Missing []string
}
type NotFound ¶
type NotFound struct{ HTTPException }
type Paginator ¶
type Paginator struct {
Fetch FetchFn
PerPage int
BuildEmbed BuildEmbedFn
Prefix string
EmptyMessage string
}
func NewPaginator ¶
func NewPaginator(fetch FetchFn, perPage int, build BuildEmbedFn) *Paginator
type PermissionOverride ¶
type PermissionOverride struct {
RoleID string `json:"role_id"`
Allow int64 `json:"allow"`
Deny int64 `json:"deny"`
}
func AllowingOverride ¶
func AllowingOverride(roleID string, bits int64) PermissionOverride
func DenyingOverride ¶
func DenyingOverride(roleID string, bits int64) PermissionOverride
type RateLimited ¶
type RateLimited struct {
HTTPException
RetryAfter float64
}
type ReactionAddHandler ¶
type ReactionAddHandler func(ctx context.Context, payload json.RawMessage)
type ReactionRemoveHandler ¶
type ReactionRemoveHandler func(ctx context.Context, payload json.RawMessage)
type ReadyHandler ¶
type ReorderItem ¶
type RespondOpts ¶
type ResumedHandler ¶
type SendFileOpts ¶ added in v0.1.2
type SendMessageBody ¶
type SlashHandler ¶
type SlashHandler func(ctx context.Context, i *Interaction) error
func HasPermissions ¶
func HasPermissions(required int64, handler SlashHandler) SlashHandler
type SlashOption ¶
func NewSlashOption ¶
func NewSlashOption(name, optType string) SlashOption
func (SlashOption) Describe ¶
func (o SlashOption) Describe(s string) SlashOption
func (SlashOption) Optional ¶
func (o SlashOption) Optional() SlashOption
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
createchannel
command
|
|
|
fileinfo
command
|
|
|
listguilds
command
|
|
|
prefix
command
|
|
|
randomfile
command
|
|
|
slash
command
|
Click to show internal directories.
Click to hide internal directories.