Skip to content

Commit

Permalink
Set Europe/Berlin timezone (#44)
Browse files Browse the repository at this point in the history
The users of the bot are likely in Germany which is in the Europe/Berlin
timezone.

Closes #43
See pull request #44
  • Loading branch information
ikelax authored Jan 7, 2025
1 parent 24f7401 commit b7c3630
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/dev.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { getMensaBot } from "./bot.js";
import process from "node:process";

if (import.meta.main) {
process.env.TZ = "Europe/Berlin";
const bot = getMensaBot(Deno.env.get("TELEGRAM_BOT_DEV_TOKEN"));
bot.start();
}
2 changes: 2 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { webhookCallback } from "grammy";
import { getMensaBot } from "./bot.js";
import process from "node:process";

if (import.meta.main) {
process.env.TZ = "Europe/Berlin";
const bot = getMensaBot(Deno.env.get("TELEGRAM_BOT_PROD_TOKEN"));
const endpoint = "https://mensa-bot.deno.dev/" + bot.token;
await bot.api.setWebhook(endpoint);
Expand Down

0 comments on commit b7c3630

Please sign in to comment.