NewMessageCreate (discord/message_create.go)

disgo · discord/message_create.go · go · Apache-2.0
voice, Voice / Speech

Builds Discord message payloads with content, embeds, components, and attachments for API calls.

// Source: https://github.com/disgoorg/disgo | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
package discord

import (
	"fmt"
	"io"
	"slices"

	"github.com/disgoorg/json/v2"
	"github.com/disgoorg/snowflake/v2"
)

// NewMessageCreate returns a new MessageCreate to create a message without any fields set.
func NewMessageCreate() MessageCreate {
	return MessageCreate{}
}

// NewMessageCreateV2 returns a new MessageCreate with [MessageFlagIsComponentsV2] flag set & allows to directly pass components.
func NewMessageCreateV2(components ...LayoutComponent) MessageCreate {
	return MessageCreate{
		Flags:      MessageFlagIsComponentsV2,
		Components: components,
	}
}

// MessageCreate is 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key