REST API endpoints for the bot's own application.
All functions return raw maps: {:ok, map} or {:error, reason}. EDA.App wraps them in
a struct. (The struct is not called EDA.Application: that is EDA's OTP application.)
Summary
Functions
Gets an Activity instance of this application, if it exists.
Gets the application the bot belongs to.
Edits the application the bot belongs to. Only the fields passed change.
Gets the app's role connection metadata: the fields a guild can require of a linked account to grant a role.
Replaces the app's role connection metadata — the list sent is the whole list, at most 5.
Functions
Gets an Activity instance of this application, if it exists.
GET /applications/{application_id}/activity-instances/{instance_id}. Useful to check that a
user joining an Activity session is really in it.
Gets the application the bot belongs to.
GET /applications/@me
Edits the application the bot belongs to. Only the fields passed change.
PATCH /applications/@me
Options
:description— the app's description:icon,:cover_image— image data: a path, raw PNG/JPEG/GIF bytes or a data URI, seeEDA.ImageData;nilremoves it:tags— up to 5 tags of up to 20 characters each. Discord stores them in an order of its own, so compare them as sets;[]clears them:flags— only the limited intents can be set here::gateway_presence_limited,:gateway_guild_members_limited,:gateway_message_content_limited, as a list of those atoms or as an integer. Discord refuses any other flag:install_params— the default in-app authorization link, as%{scopes: [...], permissions: ...};permissionsmay be an integer, a string or a list ofEDA.Permissionatoms:integration_types_config— the default scopes and permissions per installation context, keyed by:guild_installand:user_install, each with aninstall_paramsvalue:%{guild_install: %{scopes: ["bot", "applications.commands"], permissions: [:send_messages]}}:custom_install_url,:role_connections_verification_url,:interactions_endpoint_url— URLs. Discord checks an interactions endpoint before accepting it:event_webhooks_url,:event_webhooks_types— webhook events, and:event_webhooks_statusas:enabledor:disabled
Example
EDA.API.Application.modify_me(description: "Moderation for busy servers", tags: ["moderation"])
Gets the app's role connection metadata: the fields a guild can require of a linked account to grant a role.
Replaces the app's role connection metadata — the list sent is the whole list, at most 5.
Each record is a map with :type, :key, :name, :description, and optionally
:name_localizations and :description_localizations. :type may be an atom:
:integer_less_than_or_equal, :integer_greater_than_or_equal, :integer_equal,
:integer_not_equal, :datetime_less_than_or_equal, :datetime_greater_than_or_equal,
:boolean_equal, :boolean_not_equal. A :key is 1–50 characters of a-z, 0-9 and _.
EDA.API.Application.update_role_connection_metadata([
%{type: :integer_greater_than_or_equal, key: "level", name: "Level", description: "Minimum level"}
])