Handbook
Glossary
discord-reconnect ( -- )
Vocabulary
discord
Inputs
None
Outputs
None
Definition
USING:
accessors
concurrency.mailboxes
http
http.client
http.websockets
io
kernel
namespaces
threads
;
IN:
discord
:
discord-reconnect
( -- )
"reconnect"
g.
discord-bot-gateway
<get-request>
add-discord-auth-header
[
drop
]
do-http-request
dup
response?
[
throw
]
[
[
in>>
stream>>
]
[
out>>
stream>>
]
bi
\
discord-bot-config
get
<discord-bot>
[
discord-bot-config
get
discord-bot<<
]
keep
dup
[
\
discord-bot
[
discord-bot
get
[
in>>
]
[
out>>
]
bi
[
[
handle-discord-websocket
discord-bot-config
get
discord-bot>>
stop?>>
not
]
read-websocket-loop
]
with-streams
]
with-variable
discord-bot-config
get
mailbox>>
"disconnected"
swap
mailbox-put
]
curry
"Discord Bot"
spawn
>>bot-thread
discord-bot-config
get
discord-bot<<
]
if
;