Nostrum.Api.create_guild_channel

You're seeing just the function create_guild_channel, go back to Nostrum.Api module for more information.
Link to this function

create_guild_channel(guild_id, options)

View Source

Specs

create_guild_channel(Nostrum.Struct.Guild.id(), options()) ::
  error() | {:ok, Nostrum.Struct.Channel.guild_channel()}

Creates a channel for a guild.

This endpoint requires the MANAGE_CHANNELS permission. It fires a Nostrum.Consumer.channel_create/0 event.

If successful, returns {:ok, channel}. Otherwise, returns a Nostrum.Api.error/0.

Options

  • :name (string) - channel name (2-100 characters)
  • :type (integer) - the type of channel (See Nostrum.Struct.Channel)
  • :topic (string) - channel topic (0-1024 characters)
  • :bitrate (integer) - the bitrate (in bits) of the voice channel (voice only)
  • :user_limit (integer) - the user limit of the voice channel (voice only)
  • :permission_overwrites (list of Nostrum.Struct.Overwrite.t/0 or equivalent map) - the channel's permission overwrites
  • :parent_id (Nostrum.Struct.Channel.id/0) - id of the parent category for a channel
  • :nsfw (boolean) - if the channel is nsfw

:name is always required.

Examples

Nostrum.Api.create_guild_channel(81384788765712384, name: "elixir-nostrum", topic: "craig's domain")
{:ok, %Nostrum.Struct.Channel{guild_id: 81384788765712384}}