Versions in this module Expand all Collapse all v0 v0.5.0 Jun 15, 2023 v0.4.2 Jun 14, 2023 v0.4.1 Jun 14, 2023 v0.4.0 Jun 13, 2023 v0.3.2 Jun 12, 2023 v0.3.1 Jun 12, 2023 v0.3.0 Jun 12, 2023 v0.2.4 Jun 12, 2023 v0.2.3 Jun 8, 2023 v0.2.2 Jun 8, 2023 v0.2.1 May 26, 2023 v0.2.0 Jan 28, 2023 v0.1.1 Jan 27, 2023 v0.1.0 Jan 17, 2023 Changes in this version + type AllowedMentions struct + Parse []string + Roles []snowflake.ID + Users []snowflake.ID + type Attachment struct + ContentType string + Description string + Ephemeral bool + Filename string + Height int + ID int + ProxyURL string + Size int + URL string + Width int + type Client interface + Do func(*http.Request) (*http.Response, error) + type CodeBlockBuilder interface + Build func(w io.Writer, value []any) error + BuildError func(w io.Writer, err error) error + type DataEncoder interface + ContentType func() string + Encode func(w io.Writer, value any) error + FileExtension func() string + type Discord struct + func NewDiscordBot(webhook string, opts ...DiscordOption) *Discord + func (d *Discord) Name() string + func (d *Discord) PostWebhookJSON(ctx context.Context, web *WebhookContext) error + func (d *Discord) PostWebhookMultipart(ctx context.Context, web *WebhookContext) error + func (d *Discord) SendMessage(ctx context.Context, msg maleo.MessageContext) + func (d *Discord) Wait(ctx context.Context) error + type DiscordErrorResponse struct + Code int + Message string + Raw json.RawMessage + StatusCode int + func (d DiscordErrorResponse) Error() string + func (d DiscordErrorResponse) PrintJSON() + func (d DiscordErrorResponse) String() string + type DiscordOption interface + func WithBucket(bucket bucket.Bucket) DiscordOption + func WithClient(client Client) DiscordOption + func WithCodeBlockBuilder(codeBlockBuilder CodeBlockBuilder) DiscordOption + func WithCooldown(cooldown time.Duration) DiscordOption + func WithDataEncoder(dataEncoder DataEncoder) DiscordOption + func WithEmbedBuilder(builder EmbedBuilder) DiscordOption + func WithGlobalKey(key string) DiscordOption + func WithHook(hook Hook) DiscordOption + func WithLock(lock locker.Locker) DiscordOption + func WithName(name string) DiscordOption + func WithSemaphore(sem chan struct{}) DiscordOption + func WithTrace(trace maleo.TraceCapturer) DiscordOption + type Embed struct + Author *EmbedAuthor + Color int + Description string + Fields []*EmbedField + Footer *EmbedFooter + Image *EmbedImage + Provider *EmbedProvider + Thumbnail *EmbedThumbnail + Timestamp string + Title string + Type string + Url string + Video *EmbedVideo + type EmbedAuthor struct + IconUrl string + Name string + ProxyIconUrl string + Url string + type EmbedBuilder interface + BuildEmbed func(ctx context.Context, msg maleo.MessageContext, info *ExtraInformation) ([]*Embed, []bucket.File) + type EmbedBuilderFunc func(ctx context.Context, msg maleo.MessageContext, info *ExtraInformation) ([]*Embed, []bucket.File) + func (e EmbedBuilderFunc) BuildEmbed(ctx context.Context, msg maleo.MessageContext, info *ExtraInformation) ([]*Embed, []bucket.File) + type EmbedField struct + Inline bool + Name string + Value string + type EmbedFooter struct + IconUrl string + ProxyIconUrl string + Text string + type EmbedImage struct + Height int + ProxyUrl string + Url string + Width int + type EmbedProvider struct + Name string + Url string + type EmbedThumbnail struct + Height int + ProxyUrl string + Url string + Width int + type EmbedVideo struct + Height int + ProxyUrl string + Url string + Width int + type ExtraInformation struct + CacheKey string + CooldownTimeEnds time.Time + Iteration int + ThreadID snowflake.ID + type HighlightHint interface + DiscordHighlight func() string + type Hook interface + PostBucketUploadHook func(ctx context.Context, web *WebhookContext, results []bucket.UploadResult) + PostMessageHook func(ctx context.Context, web *WebhookContext, err error) + PreBucketUploadHook func(ctx context.Context, web *WebhookContext) context.Context + PreMessageHook func(ctx context.Context, web *WebhookContext) context.Context + type ImageSizeHint interface + ImageSize func() (height, width int) + type JSONCodeBlockBuilder struct + func (J JSONCodeBlockBuilder) Build(w io.Writer, value []any) error + func (J JSONCodeBlockBuilder) BuildError(w io.Writer, e error) error + type JSONDataEncoder struct + func (J JSONDataEncoder) ContentType() string + func (J JSONDataEncoder) Encode(w io.Writer, value any) error + func (J JSONDataEncoder) FileExtension() string + type Job struct + Context context.Context + Message maleo.MessageContext + func NewJob(ctx context.Context, message maleo.MessageContext) *Job + type MimetypeHint interface + Mimetype func() string + type NoopHook struct + func (n NoopHook) PostBucketUploadHook(context.Context, *WebhookContext, []bucket.UploadResult) + func (n NoopHook) PostMessageHook(context.Context, *WebhookContext, error) + func (n NoopHook) PreBucketUploadHook(ctx context.Context, _ *WebhookContext) context.Context + func (n NoopHook) PreMessageHook(ctx context.Context, _ *WebhookContext) context.Context + type WebhookContext struct + Extra *ExtraInformation + Files []bucket.File + Maleo *maleo.Maleo + Message maleo.MessageContext + Payload *WebhookPayload + Response *http.Response + ResponseBody []byte + type WebhookFile struct + ContentType string + Name string + type WebhookPayload struct + AllowedMentions *AllowedMentions + Attachments []*Attachment + AvatarURL string + Content string + Embeds []*Embed + TTS bool + ThreadID snowflake.ID + Username string + Wait bool + func (w *WebhookPayload) BuildMultipartPayloadJSON() ([]byte, error)