A bot to help convert between timezones in a telegram chat using natural language. Inspired by the Elsewhen app.
Cooked up in a day to solve a problem :)
- Add @elsewhenbot to your chat
- Use
/add@elsewhenbot <timezone identifier>to add timezones to the output- Find a list of timezone ids on wikipedia here
- Use
/remove@elsewhenbot <timezone identifier>to remove them - Use
/me@elsewhenbot <timezone identifier>to tell the bot your timezone - Use
/default@elsewhenbot <timezone identifier>to set the default for your chat - Message the bot
@elsewhenbot Next Tuesday at 2pmand get the right times output
Deploy to Fly.io with scale-to-zero (uses webhook mode):
# Create app and volume
fly apps create elsewhenbot
fly volumes create data --region lhr --size 1
# Set secrets
fly secrets set BOT_TOKEN=<your-bot-token>
fly secrets set WEBHOOK_URL=https://elsewhenbot.fly.dev/
fly secrets set WEBHOOK_SECRET=$(openssl rand -hex 32)
# Deploy
fly deployIf you have existing data to import:
# First deploy to create the machine
fly deploy
# Copy your data file to the volume
fly sftp shell
> put /path/to/local/data.edn /data/data.edn
# Or use ssh
fly ssh console
cat > /data/data.edn << 'EOF'
<paste your data here>
EOFA docker container is provided at ghcr.io/akeboshiwind/elsewhenbot:latest.
| Name | Description | Default Value |
|---|---|---|
BOT_TOKEN* |
The bot token. If you don't have one, go see the botfather. | N/A |
DATA_PATH |
The path that config is stored at. | /data/data.edn |
WEBHOOK_URL |
If set, runs in webhook mode at this URL. | N/A (polling mode) |
WEBHOOK_SECRET |
Secret token for webhook verification. | N/A |
PORT |
Port for webhook server. | 8080 |
* Required
Use the following to start a repl
clj -M:dev