Handbook
Glossary
reply-command ( json -- ? )
Vocabulary
discord
Inputs
json
an
object
Outputs
?
an
object
Definition
USING:
accessors
assocs
combinators
continuations
io.streams.string
kernel
prettyprint
prettyprint.sections
sequences
splitting
unicode
vocabs
words
;
IN:
discord
:
reply-command
( json -- ? )
"content"
of
[
blank?
]
trim
" "
split1
[
[
blank?
]
trim
]
bi@
swap
{
{
"help"
[
":"
split1
swap
lookup-word
dup
[
[
~quotation~
with-string-writer
]
[
2drop
f
]
recover
]
when
"vocab:word not found (maybe it's not loaded)"
or
reply-message
t
]
}
{
"effects"
[
all-words
swap
[
[
name>>
]
]
dip
[
=
]
curry
compose
filter
[
[
vocabulary-name
]
[
name>>
":"
glue
]
[
props>>
"declared-effect"
of
unparse
" "
glue
]
tri
]
map
[
"no words found"
reply-message
f
]
[
"\n"
join
reply-message
t
]
if-empty
]
}
[
2drop
f
]
}
case
;