Documentation
¶
Index ¶
- type Channel
- type ChannelMetadata
- type Client
- func (c *Client) CreateMessage(channelID string, req CreateMessageRequest) (*Message, error)
- func (c *Client) GetChannel(channelID string) (*Channel, error)
- func (c *Client) GetCurrentUser() (*User, error)
- func (c *Client) GetCurrentUserGuilds() ([]Guild, error)
- func (c *Client) GetGuildChannels(guildID string) ([]Channel, error)
- type Configuration
- type CreateMessageRequest
- type Discord
- func (d *Discord) Actions() []core.Action
- func (d *Discord) Cleanup(ctx core.IntegrationCleanupContext) error
- func (d *Discord) Components() []core.Component
- func (d *Discord) Configuration() []configuration.Field
- func (d *Discord) Description() string
- func (d *Discord) HandleAction(ctx core.IntegrationActionContext) error
- func (d *Discord) HandleRequest(ctx core.HTTPRequestContext)
- func (d *Discord) Icon() string
- func (d *Discord) Instructions() string
- func (d *Discord) Label() string
- func (d *Discord) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
- func (d *Discord) Name() string
- func (d *Discord) Sync(ctx core.SyncContext) error
- func (d *Discord) Triggers() []core.Trigger
- type Embed
- type EmbedAuthor
- type EmbedField
- type EmbedFooter
- type EmbedMedia
- type Guild
- type Message
- type Metadata
- type SendTextMessage
- func (c *SendTextMessage) Actions() []core.Action
- func (c *SendTextMessage) Cancel(ctx core.ExecutionContext) error
- func (c *SendTextMessage) Cleanup(ctx core.SetupContext) error
- func (c *SendTextMessage) Color() string
- func (c *SendTextMessage) Configuration() []configuration.Field
- func (c *SendTextMessage) Description() string
- func (c *SendTextMessage) Documentation() string
- func (c *SendTextMessage) ExampleOutput() map[string]any
- func (c *SendTextMessage) Execute(ctx core.ExecutionContext) error
- func (c *SendTextMessage) HandleAction(ctx core.ActionContext) error
- func (c *SendTextMessage) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
- func (c *SendTextMessage) Icon() string
- func (c *SendTextMessage) Label() string
- func (c *SendTextMessage) Name() string
- func (c *SendTextMessage) OutputChannels(configuration any) []core.OutputChannel
- func (c *SendTextMessage) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *SendTextMessage) Setup(ctx core.SetupContext) error
- type SendTextMessageConfiguration
- type SendTextMessageMetadata
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct {
ID string `json:"id"`
Type int `json:"type"`
GuildID string `json:"guild_id,omitempty"`
Name string `json:"name,omitempty"`
}
Channel represents a Discord channel object
type ChannelMetadata ¶
type Client ¶
type Client struct {
BotToken string
}
func (*Client) CreateMessage ¶
func (c *Client) CreateMessage(channelID string, req CreateMessageRequest) (*Message, error)
CreateMessage sends a message to a channel
func (*Client) GetChannel ¶
GetChannel retrieves a channel by ID
func (*Client) GetCurrentUser ¶
GetCurrentUser retrieves the current bot user
func (*Client) GetCurrentUserGuilds ¶
GetCurrentUserGuilds retrieves the guilds the bot is a member of
type Configuration ¶
type Configuration struct {
BotToken string `json:"botToken" mapstructure:"botToken"`
}
type CreateMessageRequest ¶
type CreateMessageRequest struct {
Content string `json:"content,omitempty"`
Embeds []Embed `json:"embeds,omitempty"`
}
CreateMessageRequest represents the request body for creating a message
type Discord ¶
type Discord struct{}
func (*Discord) Components ¶
func (*Discord) Configuration ¶
func (d *Discord) Configuration() []configuration.Field
func (*Discord) Description ¶
func (*Discord) HandleAction ¶
func (d *Discord) HandleAction(ctx core.IntegrationActionContext) error
func (*Discord) HandleRequest ¶
func (d *Discord) HandleRequest(ctx core.HTTPRequestContext)
func (*Discord) Instructions ¶
func (*Discord) ListResources ¶
func (d *Discord) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
type Embed ¶
type Embed struct {
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
URL string `json:"url,omitempty"`
Color int `json:"color,omitempty"`
Timestamp string `json:"timestamp,omitempty"`
Author *EmbedAuthor `json:"author,omitempty"`
Fields []EmbedField `json:"fields,omitempty"`
Thumbnail *EmbedMedia `json:"thumbnail,omitempty"`
Image *EmbedMedia `json:"image,omitempty"`
}
Embed represents a Discord message embed
type EmbedAuthor ¶
type EmbedField ¶
type EmbedFooter ¶
type EmbedFooter struct {
}
type EmbedMedia ¶
type EmbedMedia struct {
URL string `json:"url"`
}
type Message ¶
type Message struct {
ID string `json:"id"`
Type int `json:"type"`
Content string `json:"content"`
ChannelID string `json:"channel_id"`
Author User `json:"author"`
Timestamp string `json:"timestamp"`
Embeds []Embed `json:"embeds,omitempty"`
}
Message represents a Discord message object
type SendTextMessage ¶
type SendTextMessage struct{}
func (*SendTextMessage) Actions ¶
func (c *SendTextMessage) Actions() []core.Action
func (*SendTextMessage) Cancel ¶
func (c *SendTextMessage) Cancel(ctx core.ExecutionContext) error
func (*SendTextMessage) Cleanup ¶ added in v0.7.0
func (c *SendTextMessage) Cleanup(ctx core.SetupContext) error
func (*SendTextMessage) Color ¶
func (c *SendTextMessage) Color() string
func (*SendTextMessage) Configuration ¶
func (c *SendTextMessage) Configuration() []configuration.Field
func (*SendTextMessage) Description ¶
func (c *SendTextMessage) Description() string
func (*SendTextMessage) Documentation ¶
func (c *SendTextMessage) Documentation() string
func (*SendTextMessage) ExampleOutput ¶
func (c *SendTextMessage) ExampleOutput() map[string]any
func (*SendTextMessage) Execute ¶
func (c *SendTextMessage) Execute(ctx core.ExecutionContext) error
func (*SendTextMessage) HandleAction ¶
func (c *SendTextMessage) HandleAction(ctx core.ActionContext) error
func (*SendTextMessage) HandleWebhook ¶
func (c *SendTextMessage) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
func (*SendTextMessage) Icon ¶
func (c *SendTextMessage) Icon() string
func (*SendTextMessage) Label ¶
func (c *SendTextMessage) Label() string
func (*SendTextMessage) Name ¶
func (c *SendTextMessage) Name() string
func (*SendTextMessage) OutputChannels ¶
func (c *SendTextMessage) OutputChannels(configuration any) []core.OutputChannel
func (*SendTextMessage) ProcessQueueItem ¶
func (c *SendTextMessage) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*SendTextMessage) Setup ¶
func (c *SendTextMessage) Setup(ctx core.SetupContext) error
type SendTextMessageConfiguration ¶
type SendTextMessageConfiguration struct {
Channel string `json:"channel" mapstructure:"channel"`
Content string `json:"content" mapstructure:"content"`
EmbedTitle string `json:"embedTitle" mapstructure:"embedTitle"`
EmbedDescription string `json:"embedDescription" mapstructure:"embedDescription"`
EmbedColor string `json:"embedColor" mapstructure:"embedColor"`
EmbedURL string `json:"embedUrl" mapstructure:"embedUrl"`
}
type SendTextMessageMetadata ¶
type SendTextMessageMetadata struct {
HasEmbed bool `json:"hasEmbed" mapstructure:"hasEmbed"`
Channel *ChannelMetadata `json:"channel" mapstructure:"channel"`
}
Click to show internal directories.
Click to hide internal directories.