Skip to content

Commit

Permalink
hotfix: ignore setMyCommands error if failed
Browse files Browse the repository at this point in the history
  • Loading branch information
aldy505 committed Apr 25, 2024
1 parent 4bee588 commit 1127207
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,6 +102,30 @@ 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();

bot.telegram.setMyCommands(commands.slice(0, 100)).then(o => o).catch((error) => Sentry.captureException(error));

bot.catch(async (error, context) => {
try {
Sentry.captureException(error, (scope) => {
Expand Down Expand Up @@ -146,30 +170,6 @@ 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 1127207

Please sign in to comment.