# Overview

Friend Time helps your server coordinate times and events by converting times mentioned in chat between time zones!

## [Add to your Discord Server!](https://discord.com/oauth2/authorize?client_id=471091072546766849\&scope=bot%20applications.commands\&permissions=85056)

[Documentation](https://friend-time.arilyn.cc/) | [Support Server](https://discord.gg/c9kQktCbsE) | [Donate with PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_donations\&business=EW389DYYSS4FC)

## Introduction

If you have a discord server with users across multiple countries and time zones then this is the bot for you! With Friend Time you can easily coordinate times between users.

Friend Time will automatically react with a clock emoji (🕰️) to times mentioned in chat:

![Example usage](https://i.imgur.com/pm9nCJG.png)

By also reacting, you will be private messaged with the time converted to your time zone:

![Example time conversion](https://i.imgur.com/wMsXvL3.png)

## Features

* Automatically reacts with a [**clock emoji**](/time-conversions#1-convert-to-your-time-zone) (️️🕰️) to times mentioned in chat.
  * Clicking the clock emoji **converts the time** to your time zone.
  * Sent in a direct message.
* A [**time zone list**](/time-conversions#2-convert-to-list-of-time-zones) where you can set up to 10 time zones to always convert to.
  * Sent in the server channel.
* **Reminders** for users to set their time zones.
  * Servers and users can disable this reminder if desired.
* Set [**time zones for other users**](/commands/user-commands/set#setup-for-another-user) or even [**bots**](/commands/user-commands/set#setup-for-a-bot)!
* A [**private mode**](/settings/user-settings/private-mode) for users who don't want to expose their location.
* Customize the **appearance of times** (12 or 24 hour).
* Support for **multiple languages**.


# Finding Time Zones

How to find time zones.

## Using the Time Zone Map

One way to find time zones is by using the [Time Zone Map](https://zones.arilyn.cc/?utm_source=friend-time\&utm_medium=docs):

![](/files/amVUsZ9G91H2cInnyMac)

{% hint style="info" %}
You can also get to this map by using the [map](/commands/user-commands/map) command in Discord.
{% endhint %}

Once you are on the map page, you will see 3 different time zones listed:

1. **Auto-Detected Time Zone**
   * The time zone that the map has auto-detected from your location.
2. **Selected Time Zone**
   * The time zone that you currently have selected.
   * Click any location on the map to see the time zone name!
3. **Hovered Time Zone**
   * If you are on PC, this will be the name of the time zone you are hovering over with your mouse.

You can click the "**Copy**" button to copy the **selected time zone**, and paste this where Friend Time needs a time zone:

![](/files/jYazvH51DaJWu36tLaNG)

## Time Zone Name Format

Friend Time uses a special format for time zone names (more specifically the [IANA Time Zone Database](https://www.iana.org/time-zones), an international standard for time zones).

Time zone names are in a "Region/City" format, for example:

* America/New\_York
* Europe/London
* Asia/Manila
* Australia/Sydney

{% hint style="warning" %}
Please note that **most cities** are **NOT** part of a time zone name. There are only a small amount of (usually very populated) cities which [IANA](https://www.iana.org/) (an international group) have decided are part of time zone names.
{% endhint %}

{% hint style="danger" %}
Time zone **abbreviations** like "EST" or "GMT" are also **NOT** accepted by Friend Time because they are often ambiguous. For example "CST" could mean "China Standard Time", "Cuba Standard Time", or "Central Standard Time".
{% endhint %}


# Time Conversions

How time conversions work.

There are 2 main ways that Friend Time can convert times that are mentioned in chat.

1. Converting to Your Time Zone
2. Converting to the Server's List of Time Zones

## 1. Convert to Your Time Zone

Friend Time can convert times to your time zone simply by clicking the clock emoji that appears when times are mentioned in chat.

Friend Time automatically reacts with a clock emoji:

![](https://i.imgur.com/pm9nCJG.png)

If you also react with the same emoji, Friend Time will message you with the times converted to your time zone:

![](https://i.imgur.com/wMsXvL3.png)

## 2. Convert to List of Time Zones

Another way that Friend Time can convert times is by using the server's time zone list. This is a list of up to 10 time zones which Friend Time will always convert to and send after a time is mentioned in chat.

![](/files/gEknDA8tzZSCynNuArME)

To use this list, the server must have the [List](/settings/server-settings/list) setting enabled, and also must have at least one time zone in the [server's time zone list](/commands/admin-commands/list).


# FAQ

Frequently asked questions.

## Can Friend Time show times in a 24-hour format?

Yes, see the [User Time Format](/settings/user-settings/time-format) setting or the [Server Time Format](/settings/server-settings/time-format) setting.

## How do I find my time zone?

See the following guide on [finding time zones](/finding-time-zones).

## Friend Time keeps saying "User not found."

If you are trying to set your time zone and keep seeing "User not found.", please see the guide on [setting your time zone](/commands/user-commands/set#setup-for-yourself).

The following is an example of how to set your time zone:

![](/files/UnXA52qQYd44zeb3Re56)

## Why isn't Friend Time messaging me when I react with the clock emoji?

Friend Time requires that you have **Direct Messages enabled** in at least one server that you share with Friend Time. Please check your **Privacy Settings** for the server.

![](/files/GW2nAxiF1mXsgxYcBz5S)

{% hint style="info" %}
If you don't want to enable the setting in your server, consider joining the [Support Server](https://discord.gg/c9kQktCbsE), and enabling direct messages there.
{% endhint %}

## Why isn't the time zone list working?

Please check that the following are true:

* The server's [list setting](/settings/server-settings/list) is enabled.
* There is **at least one** time zone in the [server's time zone list](/commands/admin-commands/list).

## Can I set time zones for other users?

Yes. Please see the [set command](/commands/user-commands/set#setup-for-another-user) for more information.


# User Commands

Commands for all users.


# set

Run the user setup (for yourself, a user, or bot).

## Summary

The `/set` command runs the required user setup. This includes your time zone so that Friend Time is able to convert times to and from your time zone. You can run this setup for yourself, another user, or a bot.

* `/set me` - Run the user setup for yourself.
* `/set user <user/bot>` - Run the user setup for another user or bot.

## Setup for Yourself

**1.** Type `/set me` to start the setup process.

![](/files/aTEuSwpRVjifh4nItWgR)

**2.** Enter [your time zone](/settings/user-settings/time-zone).

![](/files/kPDqzERJgjzWPO7dWrPF)

{% hint style="info" %}
If you are unsure which time zone to use, see the guide on [finding time zones](/finding-time-zones).
{% endhint %}

**3.** Confirm [your time zone](/settings/user-settings/time-zone).

![](/files/Ecq106uJchuTPF4cpfuv)

**4.** The setup should now be complete.

![](/files/TnXM1XI7MHJ7AV2gZ9St)

## Setup for Another User

**1.** Type `/set user <user>` to start the setup process.

![](/files/Bbz8iSntIgwFer5RbHMj)

**2.** Enter the [user's time zone](/settings/user-settings/time-zone).

![](/files/5eEnFHCuYl4j7zWtzwbM)

{% hint style="info" %}
If you are unsure which time zone to use, see the guide on [finding time zones](/finding-time-zones).
{% endhint %}

**3.** Confirm the [user's time zone](/settings/user-settings/time-zone).

![](/files/mglaz2PjThzNc0WFO4hI)

**4.** Have the **other user** confirm [their time zone](/settings/user-settings/time-zone).

![](/files/chZueF1iJDz696gNp11o)

**4.** The setup should now be complete.

![](/files/yDTMNVzThNSpXlEKj4Zm)

## Setup for a Bot

**1.** Type `/set user <bot>` to start the setup process.

![](/files/mSWMzaTdlXI9mVDAuaLR)

**2.** Enter the [bot's time zone](/commands/user-commands/set).

![](/files/IuPpCSr5wjTv55Kqfh0O)

{% hint style="info" %}
If you are unsure which time zone to use, see the guide on [finding time zones](/finding-time-zones).
{% endhint %}

**3.** Confirm the [bot's time zone](/commands/user-commands/set).

![](/files/U7RIHRXaZlfJAKRGpIMu)

**4.** The setup should now be complete.

![](/files/3BSTiWBKfvl9mEzal4FN)

The bot should also appear in the [bot list](/commands/admin-commands/bot) where it's settings can be viewed or changed.

![](/files/jEllIQP1pzBZn53I1A0N)


# me

Manage your user settings.

## Summary

The `/me` command is used to view and change your [user settings](/settings/user-settings). These settings are tied to you, and apply to all servers that you are in.

* `/me view` - View your settings.
* `/me edit <setting>` - Change one of your settings.
* `/me remove` Remove all of your data.

## View Your Settings

Type `/me view` to view your current user settings.

![](/files/P9phB5F3WjWfdVwpqUMu)

{% hint style="info" %}
If a setting is *italicized* it means you are using the default setting value.
{% endhint %}

## Change One of Your Settings

Type `/me edit <setting>` to change one of your settings.

![](/files/w6tHD2Gkh2cTlC8N8SoI)

## Reset a Setting to Default

Type `/me edit <setting> reset:True` to reset a setting to default.

![](/files/cXr4SN32SKfCdon8JzeZ)

## Remove All of Your Data

Type `/me remove` to remove all of your data.

![](/files/3CiGgj57sHtt0trO1UD8)


# time

View the time of the server, user, bot, or zone.

## Summary

The `/time` command is used to check the current time of the server, user, bot, or time zone.

* `/time server` - Check the current time of **the server.**
* `/time user <user/bot>` - Check the current time of **a user** or **bot**..
* `/time zone <zone>` - Check the current time of **a time zone**.

## View the Server's Time

Type `/time server` to see the current time of the server.

![](/files/SbcW9mOXtFIJ4UFqBzpk)

## View a User's Time

Type `/time user <user>` to see the current time for a user.

![](/files/5X7lzNVhfjJxZ2FjcHII)

## View a Bot's Time

Type `/time user <bot>` to see the current time for a bot.

![](/files/VlDxBrQloxnnc3gwsRPP)

## View a Zone's Time

Type `/time zone <zone>` to see the current time in a time zone.

![](/files/1vTOIT9sm91urglF200K)

{% hint style="info" %}
If you are unsure which time zone to use, see the guide on [finding time zones](/finding-time-zones).
{% endhint %}


# map

View the zone map.

## Summary

The `/map` command is used to view the [Time Zone Map](https://zones.arilyn.cc/?utm_source=friend-time\&utm_medium=docs).

## View the Time Zone Map

**1.** Type `/map.`

![](/files/MtN998a8pQZs6efv7SdX)

**2.** Click the [Time Zone Map](https://zones.arilyn.cc/?utm_source=friend-time\&utm_medium=docs) link to open the map.

![](/files/LdhwXatSVnBm5LxWYe9m)

{% hint style="info" %}
For more information, see the guide on [using the time zone map](/finding-time-zones#using-the-time-zone-map).
{% endhint %}


# info

More information about Friend Time.

## Summary

The `/info` command shows more information about Friend Time.

## Show Information about Friend Time

Type `/info` to show information about Friend Time.

![](/files/HqUU7Bbu5K7d3wM3S1XC)


# Admin Commands

Commands for admins.


# setup

Run the server setup.

## Summary

The `/setup` command runs the server setup. This setup is optional, but includes various server settings to customize the functionality of Friend Time for your server.

## Setup Your Server

**1.** Type `/setup` to start the setup process.

![](/files/GibKnSjKfBpAKvIuRehU)

**2.** Enter the [server's time zone](/commands/admin-commands/setup).

![](/files/1QUQOu5Sd31uGQhofPAz)

{% hint style="info" %}
If you are unsure which time zone to use, see the guide on [finding time zones](/finding-time-zones).
{% endhint %}

**3.** Confirm the [server's time zone](/commands/admin-commands/setup).

![](/files/hqJNNnK3ndD4x1MTENXs)

**4.** Enter the [server's time format](/commands/admin-commands/setup).

![](/files/vpkWMigvZyN1xkNvvJnB)

**5.** Enter whether you'd like [auto-detect](/settings/server-settings/auto-detect) enabled or not for the server.

![](/files/FZQpcSXe2oZWWhYWmqiC)

**6.** Enter whether you'd like the [time zone list](/settings/server-settings/list) enabled or not for the server.

![](/files/4p79tGy1iop02IioN3Ra)

**7.** Enter whether you'd like [reminders](/commands/admin-commands/setup) enabled or not for the server.

![](/files/tDuY1SSbfoHo2FnSTJu4)

**8.** Enter the [server's language](/commands/admin-commands/setup).

![](/files/kBXmwjPHvzXkoN5VvG0u)

**9.** The setup should now be complete.

![](/files/xH4fQid9SiT7EfnwLmac)


# server

Manage server settings.

## Summary

The `/server` command is used to view and change your [server settings](/settings/server-settings). These settings apply to just the server you are using Friend Time in.

* `/server view` - View the server's settings.
* `/server edit <setting>` - Change one of the server's settings.
* `/server remove` Remove all of the server's data.

## View the Server's Settings

Type `/server view` to view the server's settings.

![](/files/8gBpsdoY5qEJfN3cIVnw)

{% hint style="info" %}
If a setting is *italicized* it means the server is using the default setting value.
{% endhint %}

## Change One of the Server's Settings

Type `/server edit <setting>` to change one of the server's settings.

![](/files/LVxhiOL3OHyDzxuXiRBO)

## Reset a Setting to Default

Type `/server edit <setting> reset:True` to reset a setting to default.

![](/files/13Dgmq2SIi4GhZGHd01v)

## Remove All of the Server's Data

Type `/server remove` to remove all of the server's data.

![](/files/PjbI4ezw6qdWqGSGZiXh)


# list

Manage the server time zone list.

## Summary

The `/list` command is used to view and change the server's time zone list. These time zones are automatically converted to when a time is mentioned in chat.

* `/list view` - View the server's time zone list.
* `/list toggle <zone>` - Add or remove a time zone.

### View the Server's Time Zone List

Type `/list view` to view the server's time zone list.

![](/files/4gKub0vAUOOhyyymBP5U)

### Add or Remove a Time Zone

Type `/list toggle <zone>` to **add** a time zone to the server's time zone list.

![](/files/K0c4WeaQXcq0IB05suCW)

If the time zone is **already on this list**, then the same command will **remove** it from the list.

![](/files/aopDOlPlJmc0TEk3x3nU)


# bot

Manage bot settings.

## Summary

The `/bot` command is used to view and change [bot settings](/settings/bot-settings). These settings apply to just the server you are using Friend Time in.

* `/bot list` - View all bots with settings in the server.
* `/bot view <bot>` - View a bot's settings.
* `/bot edit <bot> <setting>` - Change one of a bot's settings.
* `/bot remove <bot>` Remove all of a bot's data.

{% hint style="info" %}
To setup a **new bot**, use the [set](/commands/user-commands/set#setup-for-a-bot) command.
{% endhint %}

## View All Bots with Settings in the Server

Type `/bot list` to view all bots with settings in the server.

![](/files/AlaTTJ8z4dcC8xDNFOe1)

## View a Bot's Settings

Type `/bot view <bot>` to view a bot's settings.

![](/files/OxwWjnUffqxAANJBsL8O)

{% hint style="info" %}
If a setting is *italicized* it means the bot is using the default setting value.
{% endhint %}

## Change One of a Bot's Settings

Type `/bot edit <bot> <setting>` to change one of a bot's settings.

![](/files/gVY3bLa8I0h2U5Ka3Vge)

## Reset a Setting to Default

Type `/bot edit <bot> <setting> reset:True` to reset a setting to default.

![](/files/CtggP8ZvQQSBpthbiHIU)

## Remove All of a Bot's Data

Type `/bot remove <bot>` to remove all of a bot's data.

![](/files/O96VQqsD0ez0sjYdLg9e)

{% hint style="info" %}
This will remove the bot from the server's [bot list](#view-all-bots-with-settings-in-the-server).
{% endhint %}


# User Settings

Settings for users.

## *\*\*\*\**


# Time Zone

## Description

The user **Time Zone** setting is used for converting times both to and from your time zone, as well as allowing others to check what time it is for you.

{% hint style="info" %}
See the guide on [finding time zones](/finding-time-zones) for determining which time zone to use.
{% endhint %}

Example converting a time:

![](/files/OE86JNP5v1w1B7F8gZs0)

Example checking the time of a user:

![](/files/Yt4VWtEj7DCC5tENhBS1)

{% hint style="info" %}
To learn how to change settings like this one, see the [me command](/commands/user-commands/me).
{% endhint %}


# Date Format

## Description

The user **Date Format** setting tells Friend Time how you prefer to type dates. This helps Friend Time give the correct time conversion.

![](/files/ZSF3qPvD26IRnThCwgcF)

{% hint style="info" %}
To learn how to change settings like this one, see the [me command](/commands/user-commands/me).
{% endhint %}

## **Options**

1. **Month/Day** (`mm/dd`)
   * Use this option if you prefer to types dates with the **month first**, and **day of the month second**.
   * Ex: You would type **February 3rd 2021** as "**2/3/2021**".
2. **Day/Month** (`dd/mm`)
   * Use this option if you prefer to type dates with the **day of the month first**, and **month second**.
   * Ex: You would type **February 3rd 2021** as "**3/2/2021**".


# Time Format

## Description

The user **Time Format** setting tells Friend Time how you prefer to show times. Friend Time will use your preference when sending you times.

![](/files/zEXdaRvzH8SHox4eLEUk)

{% hint style="info" %}
To learn how to change settings like this one, see the [me command](/commands/user-commands/me).
{% endhint %}

## Options

1. **12-Hour** (`12`)
   * Use this option if you prefer times in a 12-hour format with an "AM" or "PM".
   * Ex: **5:00 PM**
2. **24-Hour** (`24`)
   * Use this option if you prefer times in a 24-hour format.
   * Ex: **17:00**


# Private Mode

## Description

The user **Private Mode** setting tells Friend Time whether or not you prefer to keep your time zone and other information private.

![](/files/1OPuZrrZ6QCV1mNJOyq3)

{% hint style="info" %}
To learn how to change settings like this one, see the [me command](/commands/user-commands/me).
{% endhint %}

## Options

1. **Yes** (`yes`)
   * Friend Time will prevent showing your information to other users.
2. **No** (`no`)
   * Friend Time can show other users your information.


# Reminders

## Description

The user **Reminders** setting tells Friend Time whether you would like to receive reminders to set your time zone if you do not have one set.

![](/files/EOtW1AGgmiaZD2QjPqA9)

{% hint style="info" %}
To learn how to change settings like this one, see the [me command](/commands/user-commands/me).
{% endhint %}

## **Options**

1. **Yes** (`yes`)
   * Friend Time will send you reminders to set your time zone.
2. **No** (`no`)
   * Friend Time will **NOT** send you reminders to set your time zone.


# Language

## Description

The user **Language** setting changes Friend Time's language for the user.

Type `/translate` to see what languages are available.

![](/files/DbUujEoexn7sNOJSRhv5)

{% hint style="info" %}
If you are interested in providing a translation, please contact the staff in our [support server](https://discord.gg/c9kQktCbsE).
{% endhint %}

{% hint style="info" %}
To learn how to change settings like this one, see the [me command](/commands/user-commands/me).
{% endhint %}


# Server Settings

Settings for servers.

## *\*\*\*\**


# Time Zone

## Description

The server **Time Zone** setting allows you to choose a single time zone for the server. This allows members to check the current server time.

{% hint style="info" %}
See the guide on [finding time zones](/finding-time-zones) for determining which time zone to use.
{% endhint %}

Checking the time of the server:

![](/files/SbcW9mOXtFIJ4UFqBzpk)

{% hint style="info" %}
To learn how to change settings like this one, see the [server command](/commands/admin-commands/server).
{% endhint %}


# Time Format

## Description

The server **Time Format** setting tells Friend Time how the server prefers to show times. Friend Time will use this preference when sending times for the server.

![](/files/wi7IbmuiWuwRWIlzi1Ft)

{% hint style="info" %}
To learn how to change settings like this one, see the [server command](/commands/admin-commands/server).
{% endhint %}

## Options

1. **12-Hour** (`12`)
   * Use this option if you prefer times in a 12-hour format with an "AM" or "PM".
   * Ex: **5:00 PM**
2. **24-Hour** (`24`)
   * Use this option if you prefer times in a 24-hour format.
   * Ex: **17:00**


# Auto-Detect

## Description

The server **Auto-Detect** setting determines whether Friend Time should automatically detect times that are mentioned in chat.

{% hint style="info" %}
To learn how to change settings like this one, see the [server command](/commands/admin-commands/server).
{% endhint %}

## **Options**

1. **Yes** (`yes`)
   * Times in chat will be detected automatically.
2. **No** (`no`)
   * Times in chat will **not** be detected automatically. A clock emoji must be present in a message for any times to be recognized and converted.

Example with auto-detect **enabled**:

![](/files/qoz1ZjeeQigbEhpvxKBk)

Example with auto-detect **disabled**:

![](/files/QbEOnJ7CERki9f5etw97)

{% hint style="info" %}
This clock emoji **must** be present in the message for Friend Time to detect the times in the message.
{% endhint %}


# List

## Description

The server **List** setting determines whether Friend Time will send a list of converted times in chat after a time is mentioned.

![](/files/h95cyWVz83k66lRCjamZ)

{% hint style="info" %}
To learn how to change settings like this one, see the [server command](/commands/admin-commands/server).
{% endhint %}

## **Options**

1. **Yes** (`yes`)
   * Friend Time will convert times mentioned in chat to all of the time zones in the server list (`/list view`). This list will be sent in the same channel as the original message.
2. **No** (`no`)
   * No list will be shown.


# Reminders

## Description

The server **Reminders** setting tells Friend Time whether you would like your members to receive reminders to set their time zone if they do not have one set.

![](/files/EOtW1AGgmiaZD2QjPqA9)

{% hint style="info" %}
To learn how to change settings like this one, see the [server command](/commands/admin-commands/server).
{% endhint %}

## **Options**

1. **Yes** (`yes`)
   * Friend Time will send your members reminders to set their time zone.
2. **No** (`no`)
   * Friend Time will **NOT** your members reminders to set their time zone.

{% hint style="warning" %}
This can be overwritten by the user's personal reminders setting.
{% endhint %}


# Language

## Description

The server **Language** setting changes Friend Time's language for user's in your server.

{% hint style="warning" %}
Please note that users can override the server language if they have a language set for themselves.
{% endhint %}

Type `/translate` to see what languages are available.

![](/files/yUwGZmdC7z4BwacABBFz)

{% hint style="info" %}
If you are interested in providing a translation, please contact the staff in our [support server](https://discord.gg/c9kQktCbsE).
{% endhint %}

{% hint style="info" %}
To learn how to change settings like this one, see the [server command](/commands/admin-commands/server).
{% endhint %}


# Bot Settings

Settings for bots.

## ***Coming Soon***


# Time Zone

## Description

The bot **Time Zone** setting is used for converting times from a bot's messages.

{% hint style="info" %}
See the guide on [finding time zones](/finding-time-zones) for determining which time zone to use.
{% endhint %}

Example converting a time:

![](/files/OE86JNP5v1w1B7F8gZs0)

{% hint style="info" %}
To learn how to change settings like this one, see the [bot command](/commands/admin-commands/bot).
{% endhint %}


# Date Format

## Description

The bot **Date Format** setting tells Friend Time how a bot prefers to type dates. This helps Friend Time give the correct time conversion.

![](/files/ZSF3qPvD26IRnThCwgcF)

{% hint style="info" %}
To learn how to change settings like this one, see the [bot command](/commands/admin-commands/bot).
{% endhint %}

## **Options**

1. **Month/Day** (`mm/dd`)
   * Use this option if the bot prefers to types dates with the **month first**, and **day of the month second**.
   * Ex: The bot would type **February 3rd 2021** as "**2/3/2021**".
2. **Day/Month** (`dd/mm`)
   * Use this option if the bot prefers to type dates with the **day of the month first**, and **month second**.
   * Ex: The bot would type **February 3rd 2021** as "**3/2/2021**".


# Permissions

Permissions required to use Friend Time.

## Required Permissions

Friend Time requires the following permissions:

1. **Read Messages**
2. **Send Messages**
3. **Embed Links**
4. **Read Message History**
5. **Add Reactions**

When you invite Friend Time to your server, by default all of these permissions should be given to Friend Time. If you'd like to disable Friend Time for certain channels, feel free to remove these permissions in the channels you'd like to disable.

## Troubleshooting Issues

If you are experiencing issues with Friend Time not responding as expected, try giving Friend Time the **Administrator** permission temporarily. This can help determine if the issue if permission related or not.


# Self-Hosting

How to self-host Friend Time.

## Requirements

1. [Node.js v16.6.0](https://nodejs.org/) or newer.
2. A [MySQL](https://www.mysql.com/) or [MariaDB](https://mariadb.org/) database.

## Setup

1. Copy example config files.
   * Navigate to the `config` folder of this project.
   * Copy all files ending in `.example.json` and remove the `.example` from the copied file names.
     * Ex: `config.example.json` should be copied and renamed as `config.json`.
2. Obtain a bot token.
   * You'll need to create a new bot in your [Discord Developer Portal](https://discord.com/developers/applications/).
     * See [here](https://www.writebots.com/discord-bot-token/) for detailed instructions.
     * At the end you should have a **bot token**.
3. Modify the config file.
   * Open the `config/config.json` file.
   * You'll need to edit the following values:
     * `client.id` - Your discord bot's [user ID](https://techswift.org/2020/04/22/how-to-find-your-user-id-on-discord/).
     * `client.token` - Your discord bot's token.
     * `database.host`- The ip address that your database is running on (or `localhost`)
     * `database.database` - The name of the database to use.
     * `database.username` - The username to use when accessing the database.
     * `database.password` - The password of the user accessing the database.
4. Install packages.
   * Navigate into the downloaded source files and type `npm install`.
5. Register commands.
   * In order to use slash commands, they first [have to be registered](https://discordjs.guide/interactions/registering-slash-commands.html#registering-slash-commands).
   * Type `npm run commands:register` to register the bot's commands.
     * Run this script any time you change a command name, structure, or add/remove commands.
     * This is so Discord knows what your commands look like.
     * It may take up to an hour for command changes to appear.

## Running

You can run the bot in multiple modes:

1. Normal Mode
   * Type `npm start`.
   * Starts a single instance of the bot.
2. Manager Mode
   * Type `npm run start:manager`.
   * Starts a shard manager which will spawn multiple bot shards.
3. PM2 Mode
   * Type `npm run start:pm2`.
   * Similar to Manager Mode but uses [PM2](https://pm2.keymetrics.io/) to manage processes.


# Translation Guide

Guide on how to translate Friend Time.

## **JSON and Text Editors**

Friend Time stores language data in JSON files. [JSON](https://en.wikipedia.org/wiki/JSON) is a format for storing data in an easy to read way. You may be familiar with similar data formats such as [YAML](https://en.wikipedia.org/wiki/YAML) (YML).

**Example JSON File**:

![](/files/mtHQ4LafMcgStQygkXGu)

If you are not familiar with JSON you can still provide a translation, however you must be aware of which parts of JSON are translatable, and which are not. In the above example the parts in **blue** are called "keys", and should be left alone. While the parts in **orange** are called "values", which can be translated.

It is also recommended to have a text editor that supports JSON, so that you can get pretty coloring like the example above, thus making it easier to read.

**Recommended Text Editors with JSON Support**:

* [Notepad++](https://notepad-plus-plus.org/)
* [Sublime Text](https://www.sublimetext.com/)
* [VSCode](https://code.visualstudio.com/)

## **Translation Guidelines**

### Leave As Is

The following should **NOT** be changed:

* **JSON Keys and Structure**
  * See the [above section](#json-and-text-editors) for more information.
* **Variables**
  * Look like this`{{MY_VARIABLE}}`
  * These will end up getting filled in by the bot.
* **References**
  * Look like this `{{REF:my.reference}}`
  * It's important to understand how these work for translations.
  * Anytime you see a REF, it will end up getting filled in with whatever text it points to in the `refs` section of the language file.
  * For example `{{REF:bot.name}}` will get filled in with whatever text is in `refs.bot.name` ("Friend Time").
* **Markdown Formatting**
  * These are special character that provide:
    * bold (\*\*)
    * italic (\*)
    * underline (\_\_)
    * code (\`)
    * link \[This is a link]\(<http://google.com/>)
  * See [here ](https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline-)for more information about markdown.
* **Colors**
  * Look like this: `#0099ff`
* **Emojis**
* **Links**
* **Bot Name**

In addition to the above, the following should be kept **as similar as possible** unless inappropriate for the language:

* **Capitalization**
* **Punctuation**
* **Spacing**
* **Order of Sentences**

### Translate

Translate **regular text**, **commands**, **settings**, etc. Anything that is not part of the above list of items to leave alone.

### Special Cases

There are a few fields which have special cases:

* `ref.meta.language`
  * Should be an ISO 639-1 language code.
  * [See here for a list of possible language codes](https://www.andiamo.co.uk/resources/iso-language-codes/).
* `ref.meta.locale`
  * Should be the same as `ref.meta.language`.
* `ref.meta.translators`
  * Provide your discord tag here and a link to a profile or social media of your choice.
* `regexes.meta.language`
  * Should include:
    * The language code from `ref.meta.language`
    * The language name from `ref.meta.languageDisplay`

### Translating Regexes

You may notice the `regexes` section of the translation file looks a little odd. Each value in the regex section should look something like this:

`/\b(find|f|lookup|search)\b/i`

You can essentially ignore everything except for this part:

`find|f|lookup|search`

Which is just **a list of words** the user can type in place of a certain command, separated by tall lines (|).

When translating the `regexes` section, just focus on translating these words and adding or removing words from the list as you see necessary.


