Skip to content

Commit

Permalink
hotfix: reduce registered commands to 100 for setMyCommands
Browse files Browse the repository at this point in the history
  • Loading branch information
aldy505 committed Apr 25, 2024
1 parent d61e6fe commit 4bee588
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 4bee588

Please sign in to comment.