Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) Close(ctx context.Context)
- func (c *Client) CreateContent(content string, opts ...rest.RequestOpt) (*discord.Message, error)
- func (c *Client) CreateEmbeds(embeds []discord.Embed, opts ...rest.RequestOpt) (*discord.Message, error)
- func (c *Client) CreateMessage(messageCreate discord.WebhookMessageCreate, ...) (*discord.Message, error)
- func (c *Client) CreateMessageInThread(messageCreate discord.WebhookMessageCreate, threadID snowflake.ID, ...) (*discord.Message, error)
- func (c *Client) DeleteMessage(messageID snowflake.ID, opts ...rest.RequestOpt) error
- func (c *Client) DeleteMessageInThread(messageID snowflake.ID, threadID snowflake.ID, opts ...rest.RequestOpt) error
- func (c *Client) DeleteWebhook(opts ...rest.RequestOpt) error
- func (c *Client) GetMessage(messageID snowflake.ID, opts ...rest.RequestOpt) (*discord.Message, error)
- func (c *Client) GetWebhook(opts ...rest.RequestOpt) (*discord.IncomingWebhook, error)
- func (c *Client) URL() string
- func (c *Client) UpdateContent(messageID snowflake.ID, content string, opts ...rest.RequestOpt) (*discord.Message, error)
- func (c *Client) UpdateEmbeds(messageID snowflake.ID, embeds []discord.Embed, opts ...rest.RequestOpt) (*discord.Message, error)
- func (c *Client) UpdateMessage(messageID snowflake.ID, messageUpdate discord.WebhookMessageUpdate, ...) (*discord.Message, error)
- func (c *Client) UpdateMessageInThread(messageID snowflake.ID, messageUpdate discord.WebhookMessageUpdate, ...) (*discord.Message, error)
- func (c *Client) UpdateWebhook(webhookUpdate discord.WebhookUpdateWithToken, opts ...rest.RequestOpt) (*discord.IncomingWebhook, error)
- type ConfigOpt
- func WithDefaultAllowedMentions(allowedMentions discord.AllowedMentions) ConfigOpt
- func WithLogger(logger *slog.Logger) ConfigOpt
- func WithRestClient(restClient rest.Client) ConfigOpt
- func WithRestClientConfigOpts(opts ...rest.ClientConfigOpt) ConfigOpt
- func WithWebhooks(webhooks rest.Webhooks) ConfigOpt
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidWebhookURL = errors.New("invalid webhook URL")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
ID snowflake.ID
Token string
Rest rest.Webhooks
RestClient rest.Client
// contains filtered or unexported fields
}
func NewWithURL ¶ added in v0.14.1
NewWithURL creates a new Client by parsing the given webhookURL for the ID and Token.
func (*Client) CreateContent ¶
func (*Client) CreateEmbeds ¶
func (*Client) CreateMessage ¶
func (c *Client) CreateMessage(messageCreate discord.WebhookMessageCreate, params rest.CreateWebhookMessageParams, opts ...rest.RequestOpt) (*discord.Message, error)
func (*Client) CreateMessageInThread ¶
func (c *Client) CreateMessageInThread(messageCreate discord.WebhookMessageCreate, threadID snowflake.ID, opts ...rest.RequestOpt) (*discord.Message, error)
func (*Client) DeleteMessage ¶
func (*Client) DeleteMessageInThread ¶
func (*Client) DeleteWebhook ¶
func (c *Client) DeleteWebhook(opts ...rest.RequestOpt) error
func (*Client) GetMessage ¶ added in v0.18.16
func (*Client) GetWebhook ¶
func (c *Client) GetWebhook(opts ...rest.RequestOpt) (*discord.IncomingWebhook, error)
func (*Client) UpdateContent ¶
func (*Client) UpdateEmbeds ¶
func (*Client) UpdateMessage ¶
func (c *Client) UpdateMessage(messageID snowflake.ID, messageUpdate discord.WebhookMessageUpdate, params rest.UpdateWebhookMessageParams, opts ...rest.RequestOpt) (*discord.Message, error)
func (*Client) UpdateMessageInThread ¶
func (*Client) UpdateWebhook ¶
func (c *Client) UpdateWebhook(webhookUpdate discord.WebhookUpdateWithToken, opts ...rest.RequestOpt) (*discord.IncomingWebhook, error)
type ConfigOpt ¶
type ConfigOpt func(config *config)
ConfigOpt is used to provide optional parameters to the webhook client
func WithDefaultAllowedMentions ¶
func WithDefaultAllowedMentions(allowedMentions discord.AllowedMentions) ConfigOpt
WithDefaultAllowedMentions sets the default allowed mentions for the webhook client
func WithLogger ¶
WithLogger sets the logger for the webhook client
func WithRestClient ¶
WithRestClient sets the rest client for the webhook client
func WithRestClientConfigOpts ¶
func WithRestClientConfigOpts(opts ...rest.ClientConfigOpt) ConfigOpt
WithRestClientConfigOpts sets the rest client configuration for the webhook client
func WithWebhooks ¶
WithWebhooks sets the webhook service for the webhook client
Click to show internal directories.
Click to hide internal directories.