handle-channel-message ( json -- )


Vocabulary
discord

Inputs
jsonan object


Outputs
None

Definition


: handle-channel-message ( json -- )
{
[ "guild_id" of "guild_id:" prepend write bl ]
[ "id" of "channel_id:" prepend write bl ]
[
[ "guild_id" of ] [ "id" of ] bi guild-channel-name
write bl
]
[ "name" of "name:`" "`" surround write bl ]
[
"rate_limit_per_user" of
"rate_limit_per_user:%d" sprintf write bl
]
[
"default_auto_archive_duration" of -1 or
"default_auto_archive_duration:%d minutes" sprintf
write bl
]
[ "nsfw" of unparse "nsfw:%s" sprintf write bl ]
[ "position" of unparse "position:%s" sprintf write bl ]
[
"topic" of json-null>f "topic:`" "`" surround print
flush
]
} cleave ;