Skip to content

Commit

Permalink
setMyCommands only on non-prod stages
Browse files Browse the repository at this point in the history
  • Loading branch information
daohoangson committed Jul 21, 2024
1 parent c8ef8ab commit f3bfb76
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions packages/telegram/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ import { commands } from "./internal/commands";
export * from "./on_message";

export async function setupTelegram({ webhookUrl }: { webhookUrl: string }) {
await bot.telegram.setMyCommands(
commands.map(({ command, description }) => ({ command, description }))
);
if (Config.STAGE !== "prod") {
await bot.telegram.setMyCommands(
commands.map(({ command, description }) => ({ command, description }))
);
}

return bot.telegram.setWebhook(webhookUrl, {
secret_token: Config.TELEGRAM_WEBHOOK_SECRET_TOKEN,
});
Expand Down
2 changes: 1 addition & 1 deletion stacks/MyStack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export function API({ stack }: StackContext) {
},
});

const scriptVersion = "2024072001";
const scriptVersion = "2024072002";
const scriptHandler =
"packages/functions/src/events/stack-script.createOrUpdate";
new Script(stack, "Script", {
Expand Down

0 comments on commit f3bfb76

Please sign in to comment.