From 5064ab88eb9a2ec18fb90bb5cbc667f6ae9e9503 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Fri, 1 Dec 2017 16:15:07 +0200 Subject: [PATCH] Fix and improve api command output --- src/commands.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/commands.js b/src/commands.js index 8b4e3222..ca9ee4bf 100644 --- a/src/commands.js +++ b/src/commands.js @@ -293,7 +293,11 @@ commands.api = async (sender, args, reply, app) => { try { reply(`Calling ${apiMethod} with the following arguments:\n${JSON.stringify(apiArgs, "", " ")}`) const response = await sender.telegramPuppet.client(apiMethod, apiArgs) - reply(`API call successful. Response:\n${JSON.stringify(response, "", " ")}`) + reply(`API call successful. Response: + +

+  ${JSON.stringify(response, "", "  ")}
+
`, { allowHTML: true }) } catch (err) { reply(`API call errored. Response:\n${JSON.stringify(err, "", " ")}`) }