discord_gleam/ws/packets/message
Types
pub type MessagePacket {
MessagePacket(t: String, s: Int, op: Int, d: MessagePacketData)
}
Constructors
-
MessagePacket(t: String, s: Int, op: Int, d: MessagePacketData)
Represents a message packet data structure, also used on message update
pub type MessagePacketData {
MessagePacketData(
content: String,
id: String,
guild_id: option.Option(String),
channel_id: String,
author: user.User,
)
}
Constructors
-
MessagePacketData( content: String, id: String, guild_id: option.Option(String), channel_id: String, author: user.User, )
Values
pub fn string_to_data(
encoded: String,
) -> Result(MessagePacket, json.DecodeError)