diff --git a/poe.js b/poe.js index eabbfbca9..3295e12b6 100644 --- a/poe.js +++ b/poe.js @@ -376,7 +376,7 @@ class Client { async purge_conversation(chatbot, count = -1) { logger.info(`Purging messages from ${chatbot}`); - let last_messages = (await this.get_message_history(chatbot, count = 50)).reverse(); + let last_messages = (await this.get_message_history(chatbot, 50)).reverse(); while (last_messages.length) { const message_ids = []; for (const message of last_messages) { @@ -392,7 +392,7 @@ class Client { if (count === 0) { return; } - last_messages = (await this.get_message_history(chatbot, count = 50)).reverse(); + last_messages = (await this.get_message_history(chatbot, 50)).reverse(); } logger.info("No more messages left to delete."); } diff --git a/server.js b/server.js index f2acd79db..40c134089 100644 --- a/server.js +++ b/server.js @@ -1652,7 +1652,7 @@ app.post('/purge_poe', jsonParser, async (request, response) => { try { const client = await getPoeClient(token); - await client.purge_conversation(bot, count) + await client.purge_conversation(bot, count); client.disconnect_ws(); return response.send({"ok" : true});