diff --git a/index.js b/index.js index 9691381c..110f4621 100644 --- a/index.js +++ b/index.js @@ -28,11 +28,13 @@ const oldConsole = {}; oldConsole.log = console.log; console.log = function (arg) { oldConsole.log(arg); - if (!config.devMode && arg) webhookClient.send(arg); + if (!config.devMode && arg) + webhookClient.send(JSON.stringify(arg)); }; oldConsole.error = console.error; console.error = function (arg) { oldConsole.error(arg); - if (!client.devMode && arg) webhookClient.send(arg); + if (!config.devMode && arg) + webhookClient.send(JSON.stringify(arg)); }; \ No newline at end of file diff --git a/src/bot.js b/src/bot.js index 1009becb..61f14a96 100644 --- a/src/bot.js +++ b/src/bot.js @@ -7,11 +7,13 @@ const oldConsole = {}; oldConsole.log = console.log; console.log = function (arg) { oldConsole.log(arg); - if (!client.config.devMode && arg) webhookClient.send(arg); + if (!client.config.devMode && arg) + webhookClient.send(JSON.stringify(arg)); }; oldConsole.error = console.error; console.error = function (arg) { oldConsole.error(arg); - if (!client.config.devMode && arg) webhookClient.send(arg); + if (!client.config.devMode && arg) + webhookClient.send(JSON.stringify(arg)); }; \ No newline at end of file