Lobbies: groups of players for Discord's Social SDK, which a bot can create and manage, and link to a guild text channel.
These are the endpoints a bot token may use; joining, leaving, linking and messaging as a player take the player's own OAuth2 token.
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
Creates a lobby. Params: :metadata (string keys and values), :members
(up to 25, each with an :id and optional :metadata, :flags and
:additional_name) and :idle_timeout_seconds (5 to 604800).
Creates a single-use invite, valid for an hour, to the lobby's linked channel, for one of its members. Returns the invite code.
Deletes a lobby; fine if it's already gone.
Removes a member from a lobby; fine if they aren't in it.
Fetches a lobby.
Edits a lobby. :members replaces the whole member list, removing anyone
left out.
Adds a member to a lobby, or edits one already in it. Params: :metadata,
:flags (1: may link a channel) and :additional_name.
Adds, edits or removes up to 25 members at once. Each is a map with an
:id, the fields of update_member/3, and remove_member: true to
remove them. Returns the members added or edited.
Sets a lobby message's moderation metadata, sent on to game clients: up to 5 string keys and values.
Functions
@spec create(Lingo.Api.params()) :: Lingo.Api.result(Lingo.Type.Lobby.t())
Creates a lobby. Params: :metadata (string keys and values), :members
(up to 25, each with an :id and optional :metadata, :flags and
:additional_name) and :idle_timeout_seconds (5 to 604800).
@spec create_invite(Lingo.Api.id(), Lingo.Api.id()) :: Lingo.Api.result(String.t())
Creates a single-use invite, valid for an hour, to the lobby's linked channel, for one of its members. Returns the invite code.
@spec delete(Lingo.Api.id()) :: Lingo.Api.result()
Deletes a lobby; fine if it's already gone.
@spec delete_member(Lingo.Api.id(), Lingo.Api.id()) :: Lingo.Api.result()
Removes a member from a lobby; fine if they aren't in it.
@spec get(Lingo.Api.id()) :: Lingo.Api.result(Lingo.Type.Lobby.t())
Fetches a lobby.
@spec update(Lingo.Api.id(), Lingo.Api.params()) :: Lingo.Api.result(Lingo.Type.Lobby.t())
Edits a lobby. :members replaces the whole member list, removing anyone
left out.
@spec update_member(Lingo.Api.id(), Lingo.Api.id(), Lingo.Api.params()) :: Lingo.Api.result(Lingo.Type.LobbyMember.t())
Adds a member to a lobby, or edits one already in it. Params: :metadata,
:flags (1: may link a channel) and :additional_name.
@spec update_members(Lingo.Api.id(), [map()]) :: Lingo.Api.result([Lingo.Type.LobbyMember.t()])
Adds, edits or removes up to 25 members at once. Each is a map with an
:id, the fields of update_member/3, and remove_member: true to
remove them. Returns the members added or edited.
@spec update_moderation_metadata(Lingo.Api.id(), Lingo.Api.id(), %{ required(String.t()) => String.t() }) :: Lingo.Api.result()
Sets a lobby message's moderation metadata, sent on to game clients: up to 5 string keys and values.