Channels: settings, permission overwrites, pins, invites and typing.
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 channel in a guild.
Deletes a channel, or closes a DM.
Removes a permission overwrite from a channel.
Follows an announcement channel into another channel. Returns the followed channel's id and the id of the webhook posting its messages.
Fetches a channel or thread.
Lists a guild's channels, without threads.
Lists a channel's pinned messages, up to 50 at a time. Options: :limit,
and :before to page on from the last pin's pinned_at.
Pins a message.
Sets the status text of a voice channel.
Shows the bot as typing in a channel for a few seconds.
Unpins a message.
Edits a channel or thread.
Sets a permission overwrite for a role or member in a channel.
Moves channels in a guild, from a list of %{id:, position:} maps.
Functions
@spec create(Lingo.Api.id(), Lingo.Api.params(), keyword()) :: Lingo.Api.result(Lingo.Type.Channel.t())
Creates a channel in a guild.
@spec delete( Lingo.Api.id(), keyword() ) :: Lingo.Api.result(Lingo.Type.Channel.t())
Deletes a channel, or closes a DM.
@spec delete_permission(Lingo.Api.id(), Lingo.Api.id(), keyword()) :: Lingo.Api.result()
Removes a permission overwrite from a channel.
@spec follow_announcement(Lingo.Api.id(), Lingo.Api.id(), keyword()) :: Lingo.Api.result(%{channel_id: Lingo.Api.id(), webhook_id: Lingo.Api.id()})
Follows an announcement channel into another channel. Returns the followed channel's id and the id of the webhook posting its messages.
@spec get(Lingo.Api.id()) :: Lingo.Api.result(Lingo.Type.Channel.t())
Fetches a channel or thread.
@spec list(Lingo.Api.id()) :: Lingo.Api.result([Lingo.Type.Channel.t()])
Lists a guild's channels, without threads.
@spec list_pins( Lingo.Api.id(), keyword() ) :: Lingo.Api.result(%{ items: [%{pinned_at: DateTime.t(), message: Lingo.Type.Message.t()}], has_more: boolean() })
Lists a channel's pinned messages, up to 50 at a time. Options: :limit,
and :before to page on from the last pin's pinned_at.
@spec pin_message(Lingo.Api.id(), Lingo.Api.id(), keyword()) :: Lingo.Api.result()
Pins a message.
@spec set_voice_status(Lingo.Api.id(), Lingo.Api.params(), keyword()) :: Lingo.Api.result()
Sets the status text of a voice channel.
@spec trigger_typing(Lingo.Api.id()) :: Lingo.Api.result()
Shows the bot as typing in a channel for a few seconds.
@spec unpin_message(Lingo.Api.id(), Lingo.Api.id(), keyword()) :: Lingo.Api.result()
Unpins a message.
@spec update(Lingo.Api.id(), Lingo.Api.params(), keyword()) :: Lingo.Api.result(Lingo.Type.Channel.t())
Edits a channel or thread.
@spec update_permission(Lingo.Api.id(), Lingo.Api.id(), Lingo.Api.params(), keyword()) :: Lingo.Api.result()
Sets a permission overwrite for a role or member in a channel.
@spec update_positions(Lingo.Api.id(), [map()]) :: Lingo.Api.result()
Moves channels in a guild, from a list of %{id:, position:} maps.