repositories
/
cloogle-irc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1547e1c
)
Slight improvement to #6: delay after sending message
author
Camil Staps
<info@camilstaps.nl>
Thu, 13 Jul 2017 08:04:08 +0000
(08:04 +0000)
committer
Camil Staps
<info@camilstaps.nl>
Thu, 13 Jul 2017 08:04:08 +0000
(08:04 +0000)
IRCBot.icl
patch
|
blob
|
history
diff --git
a/IRCBot.icl
b/IRCBot.icl
index
de3c36f
..
0cd1022
100644
(file)
--- a/
IRCBot.icl
+++ b/
IRCBot.icl
@@
-63,12
+63,12
@@
process chan acc state bot w
//Recurse
= process chan acc state bot w
//Recurse
= process chan acc state bot w
-send ::
[String] TCP_DuplexChannel *World -> (MaybeErrorString (), TCP_DuplexChannel,
*World)
+send ::
![String] !TCP_DuplexChannel !*World -> (!MaybeErrorString (), !TCP_DuplexChannel, !
*World)
send [] chan w = (Ok (), chan, w)
send [msg:msgs] {sChannel,rChannel} w
send [] chan w = (Ok (), chan, w)
send [msg:msgs] {sChannel,rChannel} w
-# (_, w) = sleep 500000 w
# (rpt,i,sChannel,w) = send_MT TIMEOUT (toByteSeq msg) sChannel w
| rpt <> TR_Success = (Error "Could not send message", {sChannel=sChannel,rChannel=rChannel}, w)
# (rpt,i,sChannel,w) = send_MT TIMEOUT (toByteSeq msg) sChannel w
| rpt <> TR_Success = (Error "Could not send message", {sChannel=sChannel,rChannel=rChannel}, w)
+# (_, w) = sleep 500000 w
= send msgs {sChannel=sChannel,rChannel=rChannel} w
where
sleep :: !Int !*World -> (!Int, *World)
= send msgs {sChannel=sChannel,rChannel=rChannel} w
where
sleep :: !Int !*World -> (!Int, *World)