Lingo.Api.Application (Lingo v0.4.2)

Copy Markdown View Source

The bot's application, its Activity instances and its role connection metadata.

Every function returns {:ok, result}, :ok when Discord sends no body, or {:error, %Lingo.Error{}}. Calls go to the current bot (see Lingo.with_bot/2).

Summary

Functions

Fetches a running instance of the app's Activity, with its location (guild and channel) and the users in it. Ended instances are 404s.

Fetches the bot's application.

Fetches the application's role connection metadata.

Edits the bot's application.

Replaces the application's role connection metadata with a list of up to 5 records, each with Discord's fields (:type as Discord's number, :key, :name, :description...).

Functions

get_activity_instance(instance_id)

@spec get_activity_instance(String.t()) ::
  Lingo.Api.result(Lingo.Type.ActivityInstance.t())

Fetches a running instance of the app's Activity, with its location (guild and channel) and the users in it. Ended instances are 404s.

get_current()

@spec get_current() :: Lingo.Api.result(Lingo.Type.Application.t())

Fetches the bot's application.

get_role_connection_metadata()

@spec get_role_connection_metadata() ::
  Lingo.Api.result([Lingo.Type.RoleConnectionMetadata.t()])

Fetches the application's role connection metadata.

update_current(params)

Edits the bot's application.

update_role_connection_metadata(records)

@spec update_role_connection_metadata([Lingo.Api.params()]) ::
  Lingo.Api.result([Lingo.Type.RoleConnectionMetadata.t()])

Replaces the application's role connection metadata with a list of up to 5 records, each with Discord's fields (:type as Discord's number, :key, :name, :description...).