Guilds: settings, channels, integrations, widgets, onboarding and pruning.
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
Whether a guild's widget is enabled, and the channel its invite leads to.
Functions
Removes inactive members from a guild, returning how many. Params: :days,
:include_roles, and compute_prune_count: false for large guilds, which
returns nil instead.
Removes an integration from a guild.
Fetches a guild. Pass with_counts: true for approximate member and presence counts.
Fetches a guild's onboarding settings.
Fetches the public preview of a discoverable guild.
Counts the members a prune would remove. Options: :days (1 to 30) and
:include_roles (role ids whose members may be pruned too).
Fetches a guild's vanity invite: its code (nil when none is set) and
uses.
Fetches a guild's welcome screen.
Fetches a guild's public widget.
Fetches a guild's widget as a PNG image. Pass style: to pick the banner style.
Fetches a guild's widget settings.
Lists a guild's integrations.
Lists the voice regions available to a guild, with VIP ones when it has them.
Edits a guild's settings.
Pauses invites or DMs in a guild, e.g. during a raid: :invites_disabled_until
and :dms_disabled_until, up to 24 hours ahead, or nil to lift a pause.
Edits a guild's onboarding settings: :prompts, :default_channel_ids,
:enabled and :mode, with Discord's fields and numbers.
Edits a guild's welcome screen: :enabled, :welcome_channels and :description.
Edits a guild's widget settings: :enabled and :channel_id.
Types
@type widget_settings() :: %{enabled: boolean(), channel_id: Lingo.Api.id() | nil}
Whether a guild's widget is enabled, and the channel its invite leads to.
Functions
@spec begin_prune(Lingo.Api.id(), Lingo.Api.params(), keyword()) :: Lingo.Api.result(non_neg_integer() | nil)
Removes inactive members from a guild, returning how many. Params: :days,
:include_roles, and compute_prune_count: false for large guilds, which
returns nil instead.
@spec delete_integration(Lingo.Api.id(), Lingo.Api.id(), keyword()) :: Lingo.Api.result()
Removes an integration from a guild.
@spec get( Lingo.Api.id(), keyword() ) :: Lingo.Api.result(Lingo.Type.Guild.t())
Fetches a guild. Pass with_counts: true for approximate member and presence counts.
@spec get_onboarding(Lingo.Api.id()) :: Lingo.Api.result(Lingo.Type.Onboarding.t())
Fetches a guild's onboarding settings.
@spec get_preview(Lingo.Api.id()) :: Lingo.Api.result(Lingo.Type.Guild.t())
Fetches the public preview of a discoverable guild.
@spec get_prune_count( Lingo.Api.id(), keyword() ) :: Lingo.Api.result(non_neg_integer())
Counts the members a prune would remove. Options: :days (1 to 30) and
:include_roles (role ids whose members may be pruned too).
@spec get_vanity_url(Lingo.Api.id()) :: Lingo.Api.result(Lingo.Type.Invite.t())
Fetches a guild's vanity invite: its code (nil when none is set) and
uses.
@spec get_welcome_screen(Lingo.Api.id()) :: Lingo.Api.result(Lingo.Type.WelcomeScreen.t())
Fetches a guild's welcome screen.
@spec get_widget(Lingo.Api.id()) :: Lingo.Api.result(Lingo.Type.GuildWidget.t())
Fetches a guild's public widget.
@spec get_widget_image( Lingo.Api.id(), keyword() ) :: Lingo.Api.result(binary())
Fetches a guild's widget as a PNG image. Pass style: to pick the banner style.
@spec get_widget_settings(Lingo.Api.id()) :: Lingo.Api.result(widget_settings())
Fetches a guild's widget settings.
@spec list_integrations(Lingo.Api.id()) :: Lingo.Api.result([Lingo.Type.Integration.t()])
Lists a guild's integrations.
@spec list_voice_regions(Lingo.Api.id()) :: Lingo.Api.result([Lingo.Type.VoiceRegion.t()])
Lists the voice regions available to a guild, with VIP ones when it has them.
@spec update(Lingo.Api.id(), Lingo.Api.params(), keyword()) :: Lingo.Api.result(Lingo.Type.Guild.t())
Edits a guild's settings.
@spec update_incident_actions(Lingo.Api.id(), Lingo.Api.params()) :: Lingo.Api.result(Lingo.Type.IncidentsData.t())
Pauses invites or DMs in a guild, e.g. during a raid: :invites_disabled_until
and :dms_disabled_until, up to 24 hours ahead, or nil to lift a pause.
@spec update_onboarding(Lingo.Api.id(), Lingo.Api.params(), keyword()) :: Lingo.Api.result(Lingo.Type.Onboarding.t())
Edits a guild's onboarding settings: :prompts, :default_channel_ids,
:enabled and :mode, with Discord's fields and numbers.
@spec update_welcome_screen(Lingo.Api.id(), Lingo.Api.params(), keyword()) :: Lingo.Api.result(Lingo.Type.WelcomeScreen.t())
Edits a guild's welcome screen: :enabled, :welcome_channels and :description.
@spec update_widget(Lingo.Api.id(), Lingo.Api.params(), keyword()) :: Lingo.Api.result(widget_settings())
Edits a guild's widget settings: :enabled and :channel_id.