Nostrum.Api.modify_channel
You're seeing just the function
modify_channel
, go back to Nostrum.Api module for more information.
Specs
modify_channel( Nostrum.Struct.Channel.id(), options(), Nostrum.Struct.Guild.AuditLogEntry.reason() ) :: error() | {:ok, Nostrum.Struct.Channel.t()}
Modifies a channel's settings.
An optional reason
can be given for the guild audit log.
If a Nostrum.Struct.Channel.guild_channel/0
is being modified, this
endpoint requires the MANAGE_CHANNEL
permission. It fires a
Nostrum.Consumer.channel_update/0
event. If a
Nostrum.Struct.Channel.channel_category/0
is being modified, then this
endpoint fires multiple Nostrum.Consumer.channel_update/0
events.
If successful, returns {:ok, channel}
. Otherwise, returns a Nostrum.Api.error/0
.
Options
:name
(string) - 2-100 character channel name:position
(integer) - the position of the channel in the left-hand listing:topic
(string) (Nostrum.Struct.Channel.text_channel/0
only) - 0-1024 character channel topic:nsfw
(boolean) (Nostrum.Struct.Channel.text_channel/0
only) - if the channel is nsfw:bitrate
(integer) (Nostrum.Struct.Channel.voice_channel/0
only) - the bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers):user_limit
(integer) (Nostrum.Struct.Channel.voice_channel/0
only) - the user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit:permission_overwrites
(list ofNostrum.Struct.Overwrite.t/0
or equivalent map) - channel or category-specific permissions:parent_id
(Nostrum.Struct.Channel.id/0
) (Nostrum.Struct.Channel.guild_channel/0
only) - id of the new parent category for a channel
Examples
Nostrum.Api.modify_channel(41771983423143933, name: "elixir-nostrum", topic: "nostrum discussion")
{:ok, %Nostrum.Struct.Channel{id: 41771983423143933, name: "elixir-nostrum", topic: "nostrum discussion"}}
Nostrum.Api.modify_channel(41771983423143933)
{:ok, %Nostrum.Struct.Channel{id: 41771983423143933}}