Skip to content

Commit

Permalink
Major - multi-server support
Browse files Browse the repository at this point in the history
Some removed functionalities to be reintroduced later
  • Loading branch information
Omlahid committed Sep 21, 2018
1 parent 1b4bef4 commit ad5218b
Show file tree
Hide file tree
Showing 7 changed files with 260 additions and 193 deletions.
78 changes: 24 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,33 @@

This bot (Omlabot) uses the discord.js library, and is deployed through node.js.

The bot comes with English and French support out-of-the-box. Edit the `auth.json` to change the language.
The bot comes with English and French support out-of-the-box. Admins can call the `!language` function, followed by either English or French, to change their preferred language. The bot runs in English by default.

You can also add different language. Scroll down for more information.
The bot supports being on different servers at the same time, even running on different languages per server.

## Functions

* `!help` for help on the bot's usage.

* `!sprint xx` for a sprint, where `xx` is the number of minutes the sprint should last for.

* `!prompt` to get a writing prompt.

* `!my words` to know how many words you have entered on the NaNoWriMo website.

* `!words xx` to know someone else's wordcount (where xx is their NaNoWriMo username).

* `!wordcount` to know the wordcount to get for that day.

* `!cheer` to cheer someone up with a nice gif.

* Other easter eggs and nice goodies :)

## I-Know-What-I'm-Doing Documentation

For this bot to work, you need to have node.js 6.0.0+ installed. This is to download [discord.js](https://github.com/hydrabolt/discord.js/), which is required to run this bot.

Then, you need to open the auth.json file, and enter the token of the account that will serve as your bot. You then simply need to run `start.bat`.
Then, you need to open the `globalSettings.json` file, and enter the token of the account that will serve as your bot. You then simply need to run `start.bat`.

## I-Have-Never-Done-Anything-Like-This-Before Documentation

Expand All @@ -32,7 +50,7 @@ Then, you need to open the auth.json file, and enter the token of the account th

3. Once the download is completed, download the files from this GitHub project.

4. Open the `auth.json` file. You can simply use notepad for this, or the better version [notepad++](https://notepad-plus-plus.org/download/v7.html).
4. Open the `globalSettings.json` file. You can simply use notepad for this, or the better version [notepad++](https://notepad-plus-plus.org/download/v7.html).

5. Enter the token for your bot. This is a bit tricky, especially since the Discord documentation is not entirely clear, so closely follow these steps.

Expand All @@ -52,59 +70,11 @@ Then, you need to open the auth.json file, and enter the token of the account th

7. Run `start.bat` by double-clicking it. You should see your bot connected to your server.

8. Type `!help` to know more about the current features (or type `!aide` if you changed the language to French).

## Functions

* `!help` for help on the bot's usage.

* `!sprint xx` for a sprint, where `xx` is the number of minutes the sprint should last for.

* `!prompt` to get a writing prompt.

* `!my words` to know how many words you have entered on the NaNoWriMo website.

* `!words xx` to know someone else's wordcount (where xx is their NaNoWriMo username).

* `!wordcount` to know the wordcount to get for that day.

* `!cheer` to cheer someone up with a nice gif.

* Other easter eggs and nice goodies :)
8. Type `!help` to know more about the current features.

## Changing the Bot Language

Omlabot comes with French and English support out-of-the-box. To switch between them, open the `auth.json` file, and enter `english` or `french`, depending on the language you prefer.

To add a new language and use it for your bot:

1. In the `languages` file, duplicate the `english.json` file.

2. Rename the copy of your file to `yournewlanguage.json`. Ensure the name is in lowercase.

For instance, if you wanted to add Polish support, your file should be called `polish.json`.

3. Open your new language file with your favoured editor.

4. Translate the second part of each line. A single message might be separated in two different messages, so keep this in mind when translating.

5. Save the file.

6. In the `languages` > `commands` file, duplicate the `english.json` file.

7. Rename the copy of your file the same name as your previously created file.

8. Open your new language file with your favoured editor.

9. Translate the second part of each line. A single message might be separated in two different messages, so keep this in mind when translating.

10. Save the file.

11. In the `auth.json` file, replace `english` (or whichever language you decided to use previously) to the name of your new language file.

For instance, if you have created a `polish.json` file, you would need to enter `polish`.

12. Save the file.
Admins can change the language of a bot calling the `!language` function in the chat, followed by either `english` or `french`.

## Adding or Removing Prompts

Expand Down
5 changes: 0 additions & 5 deletions auth.json

This file was deleted.

Loading

0 comments on commit ad5218b

Please sign in to comment.