Scores command formatting fix
authorCameron Ball <cameron@moodle.com>
Tue, 7 May 2019 05:33:00 +0000 (13:33 +0800)
committerCameron Ball <cameron@moodle.com>
Tue, 7 May 2019 06:13:51 +0000 (14:13 +0800)
src/gnb.php

index fea966b..4b6f238 100644 (file)
@@ -78,9 +78,14 @@ getTelegram()->addCommand(
                 return;
             }
 
-            $this->replyWithMessage(
+            $numE = count($pranks);
+            $pranks[$numE- 1] .= "\n——————————————";
+            $chatid = getTelegram()->getWebhookUpdates()->get('message')->get('chat')->get('id');
+            getTelegram()->sendMessage(
                 [
-                    'text' => "High scores for $arguments ...\n\n" . unlines($pranks)
+                    'chat_id' => $chatid,
+                    'parse_mode' => 'Markdown',
+                    'text' => "High scores for $arguments ...\n\n```" . unlines($pranks) . "```"
                 ]
             );
         }