webhook

package
v0.0.0-...-7245f98 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EditMessageOptions

type EditMessageOptions struct {
	Content         null.String            `json:"content,omitempty"`
	Embeds          []*sigil.Embed         `json:"embeds,omitempty"`
	AllowedMentions *sigil.AllowedMentions `json:"allowed_mentions,omitempty"`
	Components      []*sigil.ActionRow     `json:"components,omitempty"`
	Files           []*sigil.File          `json:"-"`
}

EditMessageOptions are used to edit a Message sent by a Webhook.

type Fly

type Fly struct {
	// contains filtered or unexported fields
}

Fly is a resource used to interact with Webhooks using a Bot OAuth2 token.

func NewFly

func NewFly(rc flies.RestClient, id, token string) *Fly

NewFly creates a new Fly resource.

func (*Fly) Delete

func (f *Fly) Delete(ctx context.Context) error

Delete deletes the webhook.

func (*Fly) Get

func (f *Fly) Get(ctx context.Context) (*sigil.Webhook, error)

Get fetches the Webhook.

func (*Fly) Modify

func (f *Fly) Modify(ctx context.Context, opts *ModifyWebhookOptions) (*sigil.Webhook, error)

Modify modifies the webhook.

type ModifyTokenWebhookOptions

type ModifyTokenWebhookOptions struct {
	Name   string      `json:"name,omitempty"`
	Avatar null.String `json:"avatar,omitempty"`
}

ModifyTokenWebhookOptions is used to modify a webhook, using the associated token.

type ModifyWebhookOptions

type ModifyWebhookOptions struct {
	Name      string      `json:"name,omitempty"`
	Avatar    null.String `json:"avatar,omitempty"`
	ChannelID string      `json:"channel_id,omitempty"`
}

ModifyWebhookOptions are used to modify the webhook.

type TokenFly

type TokenFly struct {
	// contains filtered or unexported fields
}

TokenFly is a resource used to interact with Webhooks in an unauthenticated manner, rather using tokens generated with the Webhook itself.

func NewTokenFly

func NewTokenFly(rc flies.RestClient, id, token string) *TokenFly

NewTokenFly creates a new TokenFly resource.

func (*TokenFly) Delete

func (f *TokenFly) Delete(ctx context.Context) error

Delete deletes the Webhook.

func (*TokenFly) DeleteMessage

func (f *TokenFly) DeleteMessage(ctx context.Context, mid, threadID string) error

DeleteMessage deletes a Message sent by the Webhook.

func (*TokenFly) EditMessage

func (f *TokenFly) EditMessage(ctx context.Context, mid, threadID string, opts *EditMessageOptions) (*sigil.Message, error)

EditMessage edits a Message senty by the Webhook.

func (*TokenFly) Get

func (f *TokenFly) Get(ctx context.Context) (*sigil.Webhook, error)

Get fetches the Webhook.

func (*TokenFly) GetMessage

func (f *TokenFly) GetMessage(ctx context.Context, mid, threadID string) (*sigil.Message, error)

GetMessage fetches a Message sent by a Webhook.

func (*TokenFly) Modify

Modify fetches a Webhook by its ID and token.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL