Skip to content

Repository files navigation

relatime banner

relatime

Converts relative time in chat to Discord timestamps based on the user's timezone.

Invite the bot on Discord

Features

  • Converts relative time expressions (e.g., "in 5 minutes", "tomorrow at 3 pm")
  • Converts absolute time expressions (e.g., "9pm", "tomorrow at 3 pm")
  • Supports English only
  • Supports per-user timezones

Usage

Commands

  • /config - Changes configuration options
    • /config timezone - Sets your timezone
    • /config relative - Enables replying with timestamps when a relative time (e.g. "in 2 hours") is mentioned.
    • /config absolute - Enables replying with timestamps when an absolute time (e.g. "9pm", "Monday at 5pm") is mentioned.
  • /last - Parses relative and absolute times in the last message sent to the channel
  • /parse - Parses a given text for relative and absolute times
    • option: print - If enabled, the bot will output the parsed message instead of replying only to the user who ran the command.

Running the bot

You can run the bot as a Docker container. Data is stored in the /app/data directory.

docker pull ghcr.io/ChlodAlejandro/relatime:latest
docker run -d --name relatime \
    --mount "type=bind,src=./data,dst=/app/data" \
    -e RT_DISCORD_CLIENT_ID=your_id_here \
    -e RT_DISCORD_TOKEN=your_token_here \
    --restart unless-stopped \
    ghcr.io/ChlodAlejandro/relatime:latest

You can also clone the repository and run it with ts-node.

git clone https://github.com/chlodalejandro/relatime.git
cd relatime
npm install
npm run start

Hooks

If you want to add in custom functionality to the bot without modifying the core code, you can add hooks to the hooks/ directory. See the hooks/README.md for more information.

License

Apache License 2.0. See LICENSE for more information.

Copyright 2025 Chlod Alejandro

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

Converts relative time in chat to Discord timestamps based on the user's timezone.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages