From 4bee588c8392d598b6d88fec597dba62eb9290d4 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Thu, 25 Apr 2024 08:37:26 +0700 Subject: [PATCH] hotfix: reduce registered commands to 100 for setMyCommands --- src/app.js | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/app.js b/src/app.js index 72b2399..577afc3 100644 --- a/src/app.js +++ b/src/app.js @@ -102,30 +102,6 @@ async function main() { next(); }); - const commands = [ - meme.register(bot, cache), - help.register(bot), - quote.register(bot), - covid.register(bot, cache), - poll.register(bot, mongo, cache), - snap.register(bot), - blidingej.register(bot), - evalBot.register(bot), - blog.register(bot, cache), - quiz.register(bot, mongo, cache), - search.register(bot, mongo), - dukun.register(bot, mongo, cache), - laodeai.register(bot), - analytics.register(bot, mongo), - news.register(bot), - qr.register(bot), - pesto.register(bot) - ] - .filter((v) => Array.isArray(v)) - .flat(); - - await bot.telegram.setMyCommands(commands); - bot.catch(async (error, context) => { try { Sentry.captureException(error, (scope) => { @@ -170,6 +146,30 @@ async function main() { } }); + const commands = [ + meme.register(bot, cache), + help.register(bot), + quote.register(bot), + covid.register(bot, cache), + poll.register(bot, mongo, cache), + snap.register(bot), + blidingej.register(bot), + evalBot.register(bot), + blog.register(bot, cache), + quiz.register(bot, mongo, cache), + search.register(bot, mongo), + dukun.register(bot, mongo, cache), + laodeai.register(bot), + analytics.register(bot, mongo), + news.register(bot), + qr.register(bot), + pesto.register(bot) + ] + .filter((v) => Array.isArray(v)) + .flat(); + + await bot.telegram.setMyCommands(commands.slice(0, 100)); + // For more information about what this is, please refer to: // https://nodejs.org/api/process.html#process_process_memoryusage terminal.log(