Documentation ¶
Index ¶
- Constants
- func NewEvent(guildEvent *discordgo.GuildScheduledEvent) common.Event
- func NewUser(user *discordgo.User) common.User
- type ActionRow
- type Button
- type Component
- type Discord
- func (discord *Discord) ArchiveChannel(channel *core.Channel) error
- func (discord *Discord) AssignRole(user common.User, role *Role) error
- func (discord *Discord) ClearCommands()
- func (discord *Discord) CreateEmoji(name string, image image.Image) *Emoji
- func (discord *Discord) CreateEvent(event common.Event) error
- func (discord *Discord) CreateMessageComponent(channelID string, content string, components []Component) string
- func (discord *Discord) DeleteChannel(channel *core.Channel) (bool, error)
- func (discord *Discord) GetAvatar(user common.User) image.Image
- func (discord *Discord) GetAvatarBase64(user common.User) string
- func (discord *Discord) GetEmoji(name string) *Emoji
- func (discord *Discord) GetRole(name string) *Role
- func (discord *Discord) GetRoleAndCreate(name string) *Role
- func (discord *Discord) GetVerifiedChannel(channel *core.Channel) *core.Channel
- func (discord *Discord) HasAtLeastOneRole(user common.User, roles []*Role) bool
- func (discord *Discord) HasRole(user common.User, role *Role) bool
- func (discord *Discord) MoveChannelToCategory(channel *core.Channel, categoryID string) error
- func (discord *Discord) NewActionRow() *ActionRow
- func (discord *Discord) NewActionRowWith(comp []Component) *ActionRow
- func (discord *Discord) NewButton(id string, label string) *Button
- func (discord *Discord) NewButtonWithEmoji(id string, label string, emoji *Emoji) *Button
- func (discord *Discord) NewChannelFromID(ID string) *core.Channel
- func (discord *Discord) NewChannelFromName(channel_name string) (*core.Channel, error)
- func (discord *Discord) OnEventCreate(handler func(*Discord, common.Event))
- func (discord *Discord) OnEventDelete(handler func(*Discord, common.Event))
- func (discord *Discord) OnEventUpdate(handler func(*Discord, common.Event))
- func (discord *Discord) OnMessageRecieved(handler func(*Discord, string, common.User, string))
- func (discord *Discord) OnReady(handler func(*Discord))
- func (discord *Discord) RefreshWebhookState()
- func (discord *Discord) RegisterCommand(name string, config common.ChatCommandConfiguration, ...)
- func (discord *Discord) Run() error
- func (discord *Discord) SendMessage(channel *core.Channel, message string) error
- func (discord *Discord) SetStatus(status string)
- func (discord *Discord) Stop()
- func (discord *Discord) UnassignRole(user common.User, role *Role) error
- func (discord *Discord) UpdateMessageComponent(messageID string, channelID string, content string, components []Component) string
- func (discord *Discord) WebhookSendMessage(channel *core.Channel, displayName string, message string)
- type Emoji
- type Role
Constants ¶
const WebhookName = "BirdBot"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActionRow ¶ added in v0.3.0
type ActionRow struct {
// contains filtered or unexported fields
}
func (*ActionRow) AddComponent ¶ added in v0.3.0
AddComponent adds a component to the action row
type Button ¶ added in v0.3.0
type Component ¶ added in v0.3.0
type Component interface {
// contains filtered or unexported methods
}
Component is an object that can be formatted as a discord component
type Discord ¶
func (*Discord) ArchiveChannel ¶
ArchiveChannel archives a channel
func (*Discord) AssignRole ¶ added in v0.3.0
AssignRole adds a role to a user
func (*Discord) ClearCommands ¶ added in v0.4.2
func (discord *Discord) ClearCommands()
ClearCommands deregisters all commands from the discord API
func (*Discord) CreateEmoji ¶ added in v0.4.4
CreateEmoji creates a new emoji on Discord
func (*Discord) CreateEvent ¶ added in v0.2.0
CreateEvent creates a new discord event
func (*Discord) CreateMessageComponent ¶ added in v0.3.0
func (discord *Discord) CreateMessageComponent(channelID string, content string, components []Component) string
CreateMessageComponent creates a discord component
func (*Discord) DeleteChannel ¶
DeleteChannel deletes a channel
func (*Discord) GetAvatarBase64 ¶ added in v0.4.4
GetAvatarBase64 returns the base64 encoded avatar of a user
func (*Discord) GetRoleAndCreate ¶ added in v0.3.0
GetRoleAndCreate gets a role and creates it if it doesn't exist
func (*Discord) GetVerifiedChannel ¶
GetVerifiedChannel looks up channel data and returns a verified objec
func (*Discord) HasAtLeastOneRole ¶ added in v0.3.0
HasAtLeastOneRole returns true when a user has at one role from a given array
func (*Discord) MoveChannelToCategory ¶
MoveChannelToCategory places a channel in a given category
func (*Discord) NewActionRow ¶ added in v0.3.0
NewActionRow creates an empty action row component
func (*Discord) NewActionRowWith ¶ added in v0.3.0
NewActionRowWith creates an action row with a set of components
func (*Discord) NewButtonWithEmoji ¶ added in v0.4.4
NewButtonWithEmoji creates a new button component with a emoji
func (*Discord) NewChannelFromID ¶
NewChannelFromID creates a channel from a given ID
func (*Discord) NewChannelFromName ¶
NewChannelFromName creates a channel object with its name
func (*Discord) OnEventCreate ¶
OnEventCreate registers a handler when a guild scheduled event is created
func (*Discord) OnEventDelete ¶
OnEventDelete registers a handler when a guild scheduled event is deleted
func (*Discord) OnEventUpdate ¶
OnEventUpdate registers a handler when a guild scheduled event is updated
func (*Discord) OnMessageRecieved ¶ added in v0.4.2
OnMessageRecieved registers a handler when a message is recieved
func (*Discord) RefreshWebhookState ¶ added in v0.4.4
func (discord *Discord) RefreshWebhookState()
RefreshWebhookState refreshes the state of all webhooks
func (*Discord) RegisterCommand ¶ added in v0.4.2
func (discord *Discord) RegisterCommand(name string, config common.ChatCommandConfiguration, handler func(common.User, map[string]any) string)
RegisterCommand creates an new command that can be used to interact with bird bot
func (*Discord) SendMessage ¶
SendMessage sends a message to a given channel
func (*Discord) UnassignRole ¶ added in v0.3.0
UnassignRole removes a role from a user