]> gitweb.factorcode.org Git - factor.git/commitdiff
discord: handle errors in bot, e.g. message too large from `help discord:dispatch...
authorDoug Coleman <doug.coleman@gmail.com>
Sat, 15 Apr 2023 20:51:39 +0000 (15:51 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Sat, 15 Apr 2023 20:52:09 +0000 (15:52 -0500)
max size is 4k so split up messages or truncate

extra/discord/discord.factor

index a2bbda2bfdfa2db80a25f132f6e295c4289a81f1..ee8e927d8e9be32fa7a8f32db1210c381bde3e4c 100644 (file)
@@ -475,4 +475,5 @@ GENERIC: discord-help-bot ( json opcode -- )
 M: object discord-help-bot 2drop ;
 
 M: MESSAGE_CREATE discord-help-bot drop
-    { [ reply-command ] [ reply-echo ] } 1|| drop ;
+    '[ _ { [ reply-command ] [ reply-echo ] } 1|| drop ]
+    [ g... gflush ] recover ;