API Reference EDA v#0.5.0-beta.2

Copy Markdown View Source

Modules

EDA

EDA - Elixir Discord API

REST API endpoints for the bot's own application.

REST API endpoints for Discord Auto Moderation rules.

REST API endpoints for Discord guild bans.

REST API endpoints for Discord channels.

REST API endpoints for Discord application commands.

REST API endpoints for Discord guild emojis.

REST API endpoints for Discord Entitlements (monetization).

REST API endpoint for Discord gateway info.

REST API endpoints for Discord guilds.

REST API endpoints for Discord guild templates.

REST API endpoints for Discord interaction responses.

REST API endpoints for Discord invites.

REST API endpoints for Discord guild members.

REST API endpoints for Discord messages.

REST API endpoints for Discord message polls.

REST API endpoints for Discord message reactions.

REST API endpoints for Discord guild roles.

REST API endpoints for Discord SKUs (monetization).

REST API endpoints for Discord guild scheduled events.

REST API endpoints for soundboard sounds.

REST API endpoints for Discord stage instances.

REST API endpoints for Discord stickers.

REST API endpoints for Discord Subscriptions (monetization).

REST API endpoints for Discord threads.

REST API endpoints for Discord users.

REST API endpoints for voice: regions, and voice states in Stage channels.

REST API endpoints for Discord webhooks.

Represents a Discord presence activity.

The Discord application a bot belongs to — its public profile, install settings and flags.

Main application supervisor for EDA.

Represents a Discord message attachment.

Audit log types, action type mappings, and pagination helpers.

Represents a single change within an audit log entry.

A single audit log entry.

Automatic message deletion scheduler.

Represents a Discord Auto Moderation rule.

Represents an action taken by an Auto Moderation rule.

Metadata for an Auto Moderation action.

Metadata for an Auto Moderation rule trigger.

Unified cache interface for EDA.

Storage backend for EDA's caches.

Default EDA.Cache.Adapter: named public ETS tables, read-optimised.

An EDA.Cache.Adapter backed by Mnesia, for caches shared across a cluster.

An EDA.Cache.Adapter that stores nothing.

ETS-based cache for Discord channels.

Resolves cache configuration at startup and stores it in :persistent_term for O(1) access.

Periodic LRW (Least Recently Written) evictor for caches with max_size.

ETS-based cache for Discord guilds.

ETS-based cache for Discord guild members.

Cache admission policy behaviour and dispatcher.

ETS-based cache for Discord presences.

ETS-based cache for Discord roles.

Supervisor for cache processes.

ETS-based cache for Discord users.

ETS-based cache for Discord voice states.

Represents a Discord channel.

Event collector for awaiting Discord gateway events.

Discord embed and component color utilities.

Builder for Discord Application Commands (slash commands, user commands, message commands).

Builder for command option objects.

Who may use one of the app's commands in a guild — or every command, when id is the application id.

Builder for Discord Components V2.

Behaviour for handling Discord Gateway events.

Builder for Discord embed objects.

Represents a Discord emoji (unicode or custom guild emoji).

A user's or a guild's access to one of the app's SKUs — what a premium app checks before granting a perk.

Shared behaviour for EDA entity modules that support fetch, modify, and changeset operations.

Lightweight changeset for batching entity mutations into a single API call.

Discord JSON error codes with bidirectional lookup and named constants.

Typed event structs for Discord Gateway events.

Fired once when all shards have finished loading their guilds.

Dispatched when who may use one of the app's commands in a guild changes.

Dispatched when an Auto Moderation rule action is executed.

Dispatched when an Auto Moderation rule is created.

Dispatched when an Auto Moderation rule is deleted.

Dispatched when an Auto Moderation rule is updated.

Dispatched when a channel is created.

Dispatched when a channel is deleted.

A guild's ephemeral channel data — voice channel statuses and session start times — sent in answer to EDA.Channel.request_info/2 (opcode 43). These fields are not part of the channel object, so this is the only way to read them.

Dispatched when a channel's pins are updated.

Dispatched when a channel is updated.

Dispatched when a user or guild gains an entitlement to one of the app's SKUs.

Dispatched when an entitlement is deleted: a refund, or removal by Discord or the app. Not sent on expiry.

Dispatched when an entitlement changes — a subscription renewing sets a new ends_at.

Fired when a shard disconnects from the gateway.

Dispatched when a guild audit log entry is created. Requires GUILD_MODERATION intent.

Dispatched when a user is banned from a guild.

Dispatched when a user is unbanned from a guild.

Dispatched when a guild becomes available or the bot joins a guild.

Dispatched when a guild becomes unavailable or the bot is removed.

Dispatched when a guild's emojis are updated.

Dispatched when a guild's integrations change. Carries only the guild id.

Dispatched when a user joins a guild.

Dispatched when a user is removed from a guild.

Dispatched when a guild member is updated.

Dispatched in response to a guild members request.

Dispatched when a guild role is created.

Dispatched when a guild role is deleted.

Dispatched when a guild role is updated.

Dispatched when a guild scheduled event is created.

Dispatched when a guild scheduled event is deleted.

Dispatched when a guild scheduled event is updated.

Dispatched when a user subscribes to a guild scheduled event.

Dispatched when a user unsubscribes from a guild scheduled event.

Dispatched when a guild soundboard sound is created. Needs the :guild_expressions intent.

Dispatched when a guild soundboard sound is deleted. Needs the :guild_expressions intent.

Dispatched when a guild soundboard sound is modified. Needs the :guild_expressions intent.

Dispatched when several of a guild's soundboard sounds change at once. Needs the :guild_expressions intent.

Dispatched when a guild's stickers are updated.

Dispatched when a guild is updated.

Dispatched when an integration is added to a guild. Needs the :guild_integrations intent.

Dispatched when an integration is removed from a guild. Needs the :guild_integrations intent.

Dispatched when an integration changes. Needs the :guild_integrations intent.

Dispatched when a user uses an application command or component.

Dispatched when a new invite is created.

Dispatched when an invite is deleted.

Dispatched when a message is created in a channel.

Dispatched when a message is deleted.

Dispatched when multiple messages are deleted at once.

Dispatched when a user votes on a poll answer.

Dispatched when a user removes their vote from a poll.

Dispatched when a user adds a reaction to a message.

Dispatched when a user removes a reaction from a message.

Dispatched when all reactions are removed from a message.

Dispatched when all reactions for a given emoji are removed from a message.

Dispatched when a message is updated.

Dispatched when a user's presence is updated. Needs the :guild_presences intent.

Dispatched when the app hits a gateway rate limit for an opcode.

Fallback for unrecognized Discord events.

Dispatched when the client has completed the initial handshake.

Fired when a shard successfully resumes a previous session.

Fired when a shard finishes loading all its guilds.

A guild's soundboard sounds, dispatched in answer to EDA.SoundboardSound.request/1 — one event per guild requested.

Dispatched when a stage instance is created.

Dispatched when a stage instance is deleted.

Dispatched when a stage instance is updated.

Dispatched when a premium app subscription is created. Its status may still be inactive: grant perks on entitlements, not here.

Dispatched when a premium app subscription is deleted.

Dispatched when a premium app subscription changes, such as becoming active or ending.

Dispatched when a thread is created.

Dispatched when a thread is deleted.

Dispatched when the current user gains access to a channel.

Dispatched when the thread member object for the current user is updated.

Dispatched when members are added or removed from a thread.

Dispatched when a thread is updated.

Dispatched when a user starts typing in a channel.

Dispatched when the bot's own user changes — its name or avatar. EDA.Cache.me/0 is updated before the consumer sees it.

Dispatched when voice audio data is received.

Dispatched when someone sends an effect — an emoji reaction or a soundboard sound — in a voice channel the bot is connected to. Needs the :guild_voice_states intent.

Dispatched when a voice channel's session start time changes: someone joined an empty channel, or the last person left (voice_start_time: nil).

Dispatched when a voice channel's status is set or cleared.

Dispatched when voice playback finishes.

Dispatched when the voice connection is ready.

Dispatched when a guild's voice server is updated.

Dispatched when a user starts speaking in voice.

Dispatched when a user stops speaking in voice.

Dispatched when a user's voice state changes.

Dispatched when a guild channel's webhook is created, updated, or deleted.

Represents a file to upload to Discord.

The file type filters Discord shows the user when picking a file.

Represents a tag available in a Discord Forum or Media channel.

Gateway capabilities — opt-in protocol behaviour sent in the IDENTIFY payload.

Classifies Discord Gateway close codes into actionable categories.

WebSocket connection to Discord Gateway.

Behaviour for encoding/decoding Discord Gateway payloads.

Erlang External Term Format encoding for Discord Gateway payloads.

JSON encoding for Discord Gateway payloads via Jason.

Handles dispatching Gateway events to consumers and updating caches.

Manages heartbeat timing for the Gateway connection.

Discord Gateway Intents.

Orchestrates OP 8 (Request Guild Members) requests with nonce-based tracking.

Tracks guild loading progress after READY to distinguish startup loads from runtime joins.

Orchestrates the lifecycle of all gateway shards.

Top-level supervisor for the Gateway sharding system.

Zlib-stream decompressor for Discord gateway transport compression.

Represents a Discord guild.

Represents a Discord Guild Template.

A serialized guild snapshot within a template.

Computes rate limit bucket keys from HTTP method and path.

Encodes multipart/form-data requests for Discord file uploads.

Concurrent rate limiter for Discord REST API.

Builds the data URIs Discord calls image data.

A guild integration: a Twitch or YouTube connection, a guild subscription, or a bot or OAuth2 application added to the guild (type: "discord").

Helpers for working with Discord interactions.

Represents a Discord invite.

Represents a Discord guild member.

Discord mention and timestamp formatting helpers.

Represents a Discord message.

Builder for Discord Modal dialogs.

OAuth2 helpers for Discord bot applications.

A guild's onboarding: the questions new members answer, and the channels they join by default.

An answer to an onboarding prompt. Build one with EDA.Onboarding.option/2.

A question in a guild's onboarding. Build one with EDA.Onboarding.prompt/3.

Generic lazy pagination helper for Discord API endpoints.

Discord permission flags and calculator.

Represents a Discord channel permission overwrite.

Represents a Discord message poll.

Represents a single answer option in a Discord poll.

Represents the vote count for a specific poll answer.

Presence and activity builder for Discord bots.

Represents a Discord message reaction.

Represents a Discord guild role.

A role's colours: solid, gradient, or holographic.

Utilities for extracting timestamps from Discord snowflake IDs.

Builds the data URI a soundboard sound is uploaded as.

A soundboard sound: one of Discord's defaults, available to everyone, or a guild's own.

Represents a Discord sticker.

Represents a Discord sticker pack (collection of standard Nitro stickers).

Represents a Discord subscription — a user's recurring access to one or more SKUs.

Represents a Discord user.

A user's primary guild — the "server tag" shown next to their name.

Public API for Discord voice support.

Handles UDP socket management, IP discovery, audio encoding via FFmpeg, and the player loop for sending opus frames over RTP.

Encryption dispatch for Discord voice.

AES-256-GCM encryption for Discord voice.

XChaCha20-Poly1305 encryption for Discord voice.

Per-frame AES-128-GCM encryption for the DAVE (Discord Audio Video E2EE) protocol.

Stores per-sender encryption keys across MLS epochs for DAVE E2EE.

Coordinates the DAVE (Discord Audio Video E2EE) protocol.

NIF bindings for the DAVE (Discord Audio Video E2EE) MLS session.

Handles Voice Gateway events received by EDA.Voice.Session.

OGG page parser for extracting Opus frames from an OGG/Opus stream.

Voice Gateway JSON payload builders (v8).

WebSocket connection to a Discord Voice Gateway (one per guild).

Holds per-guild voice connection state.

Supervision tree for the voice subsystem.

Represents a Discord voice state.

Represents a Discord webhook.