discord_gleam/types/channel

Types

See https://discord.com/developers/docs/resources/channel#channel-object
This is a simplified version of the channel object.

pub type Channel {
  Channel(
    id: snowflake.Snowflake(snowflake.Channel),
    type_: Int,
    position: option.Option(Int),
    guild_id: option.Option(snowflake.Snowflake(snowflake.Guild)),
    parent_id: option.Option(
      snowflake.Snowflake(snowflake.Channel),
    ),
    name: option.Option(String),
    topic: option.Option(String),
    nsfw: option.Option(Bool),
    last_message_id: option.Option(
      snowflake.Snowflake(snowflake.Message),
    ),
  )
}

Constructors

Values

pub fn from_json_string(
  encoded: String,
) -> Result(Channel, @internal DiscordError)

Convert a JSON string to a channel object

pub fn json_decoder() -> decode.Decoder(Channel)
Search Document