glitch/types/message
Types
pub type Fragment {
Fragment(
fragment_type: FragmentType,
text: String,
cheermote: Option(Cheermote),
emote: Option(Emote),
mention: Option(Mention),
)
}
Constructors
-
Fragment( fragment_type: FragmentType, text: String, cheermote: Option(Cheermote), emote: Option(Emote), mention: Option(Mention), )
pub type FragmentType {
TextFragment
CheermoteFragment
EmoteFragment
MentionFragment
}
Constructors
-
TextFragment
-
CheermoteFragment
-
EmoteFragment
-
MentionFragment
pub type Mention {
Mention(user_id: String, user_name: String, user_login: String)
}
Constructors
-
Mention(user_id: String, user_name: String, user_login: String)
pub type Message {
Message(text: String, fragments: List(Fragment))
}
Constructors
-
Message(text: String, fragments: List(Fragment))
pub type MessageType {
Text
ChannelPointsHighlighted
ChannelPointsSubOnly
UserIntro
}
Constructors
-
Text
-
ChannelPointsHighlighted
-
ChannelPointsSubOnly
-
UserIntro
pub type Reply {
Reply(
parent_message_id: String,
parent_message_body: String,
parent_user_id: String,
parent_user_name: String,
thread_message_id: String,
thread_user_id: String,
thread_user_name: String,
thread_user_login: String,
)
}
Constructors
-
Reply( parent_message_id: String, parent_message_body: String, parent_user_id: String, parent_user_name: String, thread_message_id: String, thread_user_id: String, thread_user_name: String, thread_user_login: String, )
Functions
pub fn fragment_type_decoder() -> fn(Dynamic) ->
Result(FragmentType, List(DecodeError))
pub fn fragment_type_from_string(
string: String,
) -> Result(FragmentType, Nil)
pub fn fragment_type_to_string(
fragment_type: FragmentType,
) -> String
pub fn mention_decoder() -> fn(Dynamic) ->
Result(Mention, List(DecodeError))
pub fn messsage_type_decoder() -> fn(Dynamic) ->
Result(MessageType, List(DecodeError))
pub fn messsage_type_from_string(
string: String,
) -> Result(MessageType, Nil)
pub fn messsage_type_to_string(
messsage_type: MessageType,
) -> String
pub fn reply_decoder() -> fn(Dynamic) ->
Result(Reply, List(DecodeError))