Invites, including restricting them to target users.
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
Types
The progress of processing an invite's target users file. status is
:unspecified, :processing, :completed or :failed (see
error_message).
Functions
Adds a user to an invite's allowed users.
Adds up to 1000 users to an invite's allowed users.
Removes up to 1000 users from an invite's allowed users.
Creates an invite to a channel. :target_users_file limits who can use
it: a list of user ids, a CSV string, or {filename, csv}.
Deletes an invite.
Fetches an invite by code.
Fetches the progress of processing an invite's target users file.
Lists a channel's invites.
Lists a guild's invites.
Fetches the users an invite is restricted to.
Removes a user from an invite's allowed users.
Restricts an invite to the given users.
Types
@type target_users_job() :: %{ status: :unspecified | :processing | :completed | :failed | integer(), total_users: non_neg_integer(), processed_users: non_neg_integer(), created_at: DateTime.t() | nil, completed_at: DateTime.t() | nil, error_message: String.t() | nil }
The progress of processing an invite's target users file. status is
:unspecified, :processing, :completed or :failed (see
error_message).
Functions
@spec add_target_user(String.t(), Lingo.Api.id()) :: Lingo.Api.result()
Adds a user to an invite's allowed users.
@spec bulk_add_target_users(String.t(), [Lingo.Api.id()]) :: Lingo.Api.result()
Adds up to 1000 users to an invite's allowed users.
@spec bulk_delete_target_users(String.t(), [Lingo.Api.id()]) :: Lingo.Api.result()
Removes up to 1000 users from an invite's allowed users.
@spec create(Lingo.Api.id(), Lingo.Api.params(), keyword()) :: Lingo.Api.result(Lingo.Type.Invite.t())
Creates an invite to a channel. :target_users_file limits who can use
it: a list of user ids, a CSV string, or {filename, csv}.
@spec delete( String.t(), keyword() ) :: Lingo.Api.result(Lingo.Type.Invite.t())
Deletes an invite.
@spec get( String.t(), keyword() ) :: Lingo.Api.result(Lingo.Type.Invite.t())
Fetches an invite by code.
@spec get_target_users_status(String.t()) :: Lingo.Api.result(target_users_job())
Fetches the progress of processing an invite's target users file.
@spec list_channel(Lingo.Api.id()) :: Lingo.Api.result([Lingo.Type.Invite.t()])
Lists a channel's invites.
@spec list_guild(Lingo.Api.id()) :: Lingo.Api.result([Lingo.Type.Invite.t()])
Lists a guild's invites.
@spec list_target_users(String.t()) :: Lingo.Api.result([Lingo.Api.id()])
Fetches the users an invite is restricted to.
@spec remove_target_user(String.t(), Lingo.Api.id()) :: Lingo.Api.result()
Removes a user from an invite's allowed users.
@spec set_target_users(String.t(), [Lingo.Api.id()]) :: Lingo.Api.result()
Restricts an invite to the given users.