Documentation
¶
Index ¶
- Constants
- 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) GetChannelMessages(channelID string, limit int) ([]Message, 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) Configuration() []configuration.Field
- func (d *Discord) Description() string
- func (d *Discord) HandleHook(ctx core.IntegrationHookContext) error
- func (d *Discord) HandleRequest(ctx core.HTTPRequestContext)
- func (d *Discord) Hooks() []core.Hook
- 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 GetLastMention
- func (c *GetLastMention) Cancel(ctx core.ExecutionContext) error
- func (c *GetLastMention) Cleanup(ctx core.SetupContext) error
- func (c *GetLastMention) Color() string
- func (c *GetLastMention) Configuration() []configuration.Field
- func (c *GetLastMention) Description() string
- func (c *GetLastMention) Documentation() string
- func (c *GetLastMention) ExampleOutput() map[string]any
- func (c *GetLastMention) Execute(ctx core.ExecutionContext) error
- func (c *GetLastMention) HandleHook(ctx core.ActionHookContext) error
- func (c *GetLastMention) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *GetLastMention) Hooks() []core.Hook
- func (c *GetLastMention) Icon() string
- func (c *GetLastMention) Label() string
- func (c *GetLastMention) Name() string
- func (c *GetLastMention) OutputChannels(configuration any) []core.OutputChannel
- func (c *GetLastMention) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *GetLastMention) Setup(ctx core.SetupContext) error
- type GetLastMentionConfiguration
- type GetLastMentionMetadata
- type Guild
- type Message
- type Metadata
- type SendTextMessage
- 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) HandleHook(ctx core.ActionHookContext) error
- func (c *SendTextMessage) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *SendTextMessage) Hooks() []core.Hook
- 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 ¶
View Source
const ( GetLastMentionOutputChannelFound = "found" GetLastMentionOutputChannelNotFound = "notFound" )
View Source
const GetLastMentionPayloadType = "discord.getLastMention.result"
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) GetChannelMessages ¶ added in v0.13.0
GetChannelMessages retrieves recent messages from a channel.
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) Configuration ¶
func (d *Discord) Configuration() []configuration.Field
func (*Discord) Description ¶
func (*Discord) HandleHook ¶ added in v0.18.0
func (d *Discord) HandleHook(ctx core.IntegrationHookContext) 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 GetLastMention ¶ added in v0.13.0
type GetLastMention struct{}
func (*GetLastMention) Cancel ¶ added in v0.13.0
func (c *GetLastMention) Cancel(ctx core.ExecutionContext) error
func (*GetLastMention) Cleanup ¶ added in v0.13.0
func (c *GetLastMention) Cleanup(ctx core.SetupContext) error
func (*GetLastMention) Color ¶ added in v0.13.0
func (c *GetLastMention) Color() string
func (*GetLastMention) Configuration ¶ added in v0.13.0
func (c *GetLastMention) Configuration() []configuration.Field
func (*GetLastMention) Description ¶ added in v0.13.0
func (c *GetLastMention) Description() string
func (*GetLastMention) Documentation ¶ added in v0.13.0
func (c *GetLastMention) Documentation() string
func (*GetLastMention) ExampleOutput ¶ added in v0.13.0
func (c *GetLastMention) ExampleOutput() map[string]any
func (*GetLastMention) Execute ¶ added in v0.13.0
func (c *GetLastMention) Execute(ctx core.ExecutionContext) error
func (*GetLastMention) HandleHook ¶ added in v0.18.0
func (c *GetLastMention) HandleHook(ctx core.ActionHookContext) error
func (*GetLastMention) HandleWebhook ¶ added in v0.13.0
func (c *GetLastMention) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*GetLastMention) Hooks ¶ added in v0.18.0
func (c *GetLastMention) Hooks() []core.Hook
func (*GetLastMention) Icon ¶ added in v0.13.0
func (c *GetLastMention) Icon() string
func (*GetLastMention) Label ¶ added in v0.13.0
func (c *GetLastMention) Label() string
func (*GetLastMention) Name ¶ added in v0.13.0
func (c *GetLastMention) Name() string
func (*GetLastMention) OutputChannels ¶ added in v0.13.0
func (c *GetLastMention) OutputChannels(configuration any) []core.OutputChannel
func (*GetLastMention) ProcessQueueItem ¶ added in v0.13.0
func (c *GetLastMention) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*GetLastMention) Setup ¶ added in v0.13.0
func (c *GetLastMention) Setup(ctx core.SetupContext) error
type GetLastMentionConfiguration ¶ added in v0.13.0
type GetLastMentionMetadata ¶ added in v0.13.0
type GetLastMentionMetadata struct {
Channel *ChannelMetadata `json:"channel,omitempty" mapstructure:"channel,omitempty"`
}
type Message ¶
type Message struct {
ID string `json:"id"`
Type int `json:"type"`
Content string `json:"content"`
ChannelID string `json:"channel_id"`
GuildID string `json:"guild_id,omitempty"`
Author User `json:"author"`
Timestamp string `json:"timestamp"`
Embeds []Embed `json:"embeds,omitempty"`
Mentions []User `json:"mentions,omitempty"`
}
Message represents a Discord message object
type SendTextMessage ¶
type SendTextMessage struct{}
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) HandleHook ¶ added in v0.18.0
func (c *SendTextMessage) HandleHook(ctx core.ActionHookContext) error
func (*SendTextMessage) HandleWebhook ¶
func (c *SendTextMessage) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*SendTextMessage) Hooks ¶ added in v0.18.0
func (c *SendTextMessage) Hooks() []core.Hook
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.