Documentation ¶
Index ¶
- func DeleteWithToken(ctx context.Context, id, token string) error
- func Exec(ctx context.Context, id, token string, p *discord.WebhookParameters, wait bool) (*discord.Message, error)
- func GetWithToken(ctx context.Context, id, token string) (*discord.Webhook, error)
- func ModifyWithToken(ctx context.Context, id, token string, s *discord.WebhookSettings) (*discord.Webhook, error)
- type Resource
- func (r *Resource) Delete(ctx context.Context) error
- func (r *Resource) DeleteWithReason(ctx context.Context, reason string) error
- func (r *Resource) Get(ctx context.Context) (*discord.Webhook, error)
- func (r *Resource) Modify(ctx context.Context, settings *discord.WebhookSettings) (*discord.Webhook, error)
- func (r *Resource) ModifyWithReason(ctx context.Context, settings *discord.WebhookSettings, reason string) (*discord.Webhook, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteWithToken ¶
DeleteWithToken is like Delete on a webhook resource except it does not require authentication.
func Exec ¶
func Exec(ctx context.Context, id, token string, p *discord.WebhookParameters, wait bool) (*discord.Message, error)
Exec executes the webhook with the id id given its token and some execution parameters. wait indicates if we should wait for server confirmation of message send before response. If wait is set to false, the returned Message will be nil even if there is no error.
func GetWithToken ¶
GetWithToken returns a webhook given its ID an a token. The user field in the returned webhook will be nil.
func ModifyWithToken ¶
func ModifyWithToken(ctx context.Context, id, token string, s *discord.WebhookSettings) (*discord.Webhook, error)
ModifyWithToken is like Modify on a Webhook resource except this call does not require authentication, does not allow to change the channel_id parameter in the webhook settings, and does not return a user in the webhook.
Types ¶
type Resource ¶
type Resource struct {
// contains filtered or unexported fields
}
Resource is a resource that allows to perform various actions on a Discord webhook. Create one with Client.Webhook.
func NewResource ¶
func NewResource(c resource.RestClient, id string) *Resource
func (*Resource) DeleteWithReason ¶
DeleteWithReason deletes the webhook. The given reason will be set in the audit log entry for this action.
func (*Resource) Modify ¶
func (r *Resource) Modify(ctx context.Context, settings *discord.WebhookSettings) (*discord.Webhook, error)
Modify is like ModifyWithReason but with no particular reason.
func (*Resource) ModifyWithReason ¶
func (r *Resource) ModifyWithReason(ctx context.Context, settings *discord.WebhookSettings, reason string) (*discord.Webhook, error)
ModifyWithReason modifies the webhook. Requires the 'MANAGE_WEBHOOKS' permission. The given reason will be set in the audit log entry for this action.