A Discord bot that converts time across different timezones for server members based on their assigned timezone roles.
- Convert user-specified times across multiple timezones
- Display localized times for all server members with timezone roles
- Support for both 12-hour and 24-hour time formats
- Visual indicators (emoji) for day/night/sleep based on local time
- Node.js 16.9.0 or higher
- Discord Bot Token
- Server with appropriate permissions
-
Clone the repository
-
Install dependencies:
npm install -
Create a
.envfile in the root directory with:DISCORD_BOT_TOKEN=your_bot_token CLIENT_ID=your_client_id GUILD_ID=your_guild_id
- Register commands with Discord:
npm run deploy-commands - Start the bot:
npm run start
Create timezone roles on your Discord server with the following naming format:
TZ:EST,TZ:PST, etc. (see the complete list in thefriend-time.jsfile)
Assign these roles to users based on their timezone.
Use the /friend-time slash command with an optional time parameter:
/friend-time- Shows current time for all users/friend-time time:3PM- Shows 3PM converted to everyone's timezone/friend-time time:14:30- Shows 14:30 (24-hour format) for everyone
The bot supports various timezones across North America, Europe, Asia, Australia/New Zealand, Africa, and South America. Each timezone is mapped to a specific IANA timezone identifier.
npm run deploy-commands- Deploys slash commands to your servernode delete-commands.js- Removes all commands from your server
MIT License