Skip to content
Merged
Changes from 9 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
eb4fd90
started a migration for messages
May 9, 2018
b331493
removed create-messages
May 10, 2018
44e3d6a
created migration, model, and seeder
May 13, 2018
d5fb223
added localize for language support
May 14, 2018
4d449ea
added localize & language from botUtils
May 14, 2018
1373a00
added localize & language from botUtils
May 14, 2018
d3489f8
added localize & language from botUtils
May 14, 2018
5ebfd6c
added language to botUtils
May 14, 2018
eb5ed66
added localize & language from botUtils
May 14, 2018
e3cf90d
removed changes to file from last commit
May 16, 2018
0d7dbb6
added LANG=en
May 16, 2018
35e411f
changed language() to process.env.LANG
May 16, 2018
d4385a3
fixed errors removed unused code
May 16, 2018
1df3abf
Update README
brennondenny May 17, 2018
e6cc3ba
Fix Table of Contents
brennondenny May 17, 2018
90a560c
Update README
brennondenny May 17, 2018
cad0260
Fix Typo
brennondenny May 17, 2018
224b35b
updated en - EN etc
May 18, 2018
06de242
changed en - EN etc
May 18, 2018
f4f4edf
created & updated files in db folder
May 18, 2018
21a07b6
updated readme sample env to have LANG=en
May 18, 2018
f7403f6
removed localize
May 18, 2018
89ca6f2
removed english, spanish, and alien files
May 18, 2018
1646dca
created messages.json for message language types
May 18, 2018
8bd76f2
removed localize and added messages.json from locale folder
May 18, 2018
41eba5b
Change .ENV Guide to Shell
brennondenny May 18, 2018
cd7a072
changed LANG to LANGUAGE
May 18, 2018
44432ba
updated readme on how to set up LANGUAGE
May 18, 2018
8518812
Updated "Running the Bot" commands
brennondenny May 18, 2018
6f81f4d
added missing messages from other controllers
May 19, 2018
1e9d17f
finished adding messages.json to the rest of the controllers
May 19, 2018
caeb649
fixed message error
May 19, 2018
f2cd159
Merge pull request #155 from reactivepixel/r2-feature-readme
brennondenny May 19, 2018
abb4f8e
Merge branch 'Release2' into multiLang_Hess
brennondenny May 19, 2018
3a8b7b0
Updated json file sort by controllers
May 21, 2018
606351a
updated to work with new json set up
May 21, 2018
bf85de7
updated to work with new json set up
May 21, 2018
16db8ea
updated to work with new json set up
May 21, 2018
e1d23d4
updated to work with new json set up
May 21, 2018
cbecbca
Merge branch 'multiLang_Hess' of
May 21, 2018
8b06d61
Updated readme.md typos
May 21, 2018
71b1f05
Updated to work with new JSON changes
May 21, 2018
04032d7
Updated to work with new JSON changes
May 21, 2018
4360449
Updated to work with new JSON changes
May 21, 2018
2ac1102
Updated to work with new JSON changes
May 21, 2018
174f155
Updated messages.json sorted further then last commit
May 21, 2018
9325e20
Updated fixed error extra comma removed
May 21, 2018
236421f
Updated fixed error extra commas removed
May 21, 2018
ac80e8e
Updated code changed process.env.LANGUAGE to just LANGUAGE
May 21, 2018
bc66163
Updated readme.md removed extra LANGUAGE=en from sample .env
May 21, 2018
1886de9
updated code changed LANGUAGE to lang
May 21, 2018
012095c
updated to work with verifyMsgs.js from locale folder
May 21, 2018
b317ea0
created verifyMsgs.js to use the last verify messages
May 21, 2018
5ec4c12
removed old verify messages from messages.json that are now in verify…
May 21, 2018
977d91d
removed gmail.com from validDomains left there from testing
May 21, 2018
9d93df8
added default LANGUAGE=en if blank
May 22, 2018
9465dea
changes for release 3 merge
May 22, 2018
22ef92b
Merge branch 'Release3' into multiLang_Hess
BHess2653 May 22, 2018
ece71d1
changes for release 3 merge typo fixed
May 22, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 70 additions & 30 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
# Max Bot

## The Official Bot of the Full Sail Armada

Interested in learning how to use Max? See the [Usage documentation here](usage.md).

### Table of Contents

- [Installation](#installation)
- [Running the Bot](#running-the-bot)
- [Style Guide](#style-guide)
- [Debug Tool Documentation](#debug-tool-documentation)
- [Modules & Integrations](#modules--integrations)
- [Container Information](#container-information)
- [Other Information](#other-information)

# Installation

### Prerequisites
* [Git](https://git-scm.com/downloads)
* [Docker (Stable)](https://docs.docker.com/docker-for-mac/install/)
* [Discord Account](https://discordapp.com/register)

### Clone the Codebase.

Expand All @@ -18,9 +30,9 @@ git clone git@github.com:reactivepixel/Max-Bot.git
### ENV Vars


Create an ```.env``` file with the following sensitive information. Replace the "xxx"'s with some unique information for your local Environment.
Create an ```.env``` file in the root directory with the following sensitive information. Replace the "xxx"'s with some unique information for your local Environment.

```
```shell
NODE_ENV=development
DEBUG_MODE=3
LANGUAGE=en
Expand All @@ -33,89 +45,117 @@ MYSQL_HOST=mysql
DB_PORT_HOST=3306
DB_PORT_GUEST=3306

DISCORD_BOT_TOKEN=xxx_bot_token_from_next_step_xxx
DISCORD_BOT_TOKEN=xxx_BOT_TOKEN_xxx

BOT_PORT_HOST=80
BOT_PORT_GUEST=3000

EMAIL_USERNAME=xxx
EMAIL_PASS=xxx
LANGUAGE=en
```

> Update ```DISCORD_BOT_TOKEN``` with the token you receive from the next step.

> Make sure ```LANGUAGE``` is set to ```en``` and is lowercase.

=======
### Setup Discord Server & Bot

1. Go to the Discord Client and create a new Discord Server. Need Help Follow this [Guide](https://support.discordapp.com/hc/en-us/articles/204849977-How-do-I-create-a-server-).
2. Go to the [Discord Developer Page](https://discordapp.com/developers) and create a new App.
3. Go to the App Review Page and Create a Bot User.
4. Update the ```DISCORD_BOT_TOKEN``` in the .env file with the App Bot User Token provided to you.

### Adding the Bot to a Server

### Bot Token

Add a new App and create a Bot User then obtain the [Discord App Bot Token](https://discordapp.com/developers/applications/me) from the created Bot User or contact a Release Manager for Max's Dev Bot token.

As an authorized user of the bot you will need to add it to a server.

1. Go to the [Discord Developer Page](https://discordapp.com/developers).

Update the ```DISCORD_BOT_TOKEN``` in the .env file with the token provided to you.
1. Go to the App Review Page of the App with the Bot you want to add to your channel

Run ``$ gulp pm2`` to create a max.config.js file within your root directory.
1. Copy the Client ID under App Details.

### Adding the Bot to a Server
1. Add your Client ID to the following URL and Acces the page.

As an authorized user of the bot you will need to add it to a server.
https://discordapp.com/oauth2/authorize?client_id=CLIENT_ID_HERE&scope=bot&permissions=0

1. Go to the Discord developer pages (login if you haven't).
1. Go to the application with the bot you want to add to your channel.
1. Copy the Client/Application ID.
1. Go to https://discordapp.com/oauth2/authorize?client_id=```CLIENT_ID_GOES_HERE```&scope=bot&permissions=0
1. Select server and click authorize.
1. Select the Server you would like the Bot to join and Authorize the action.

> [Source](https://stackoverflow.com/questions/37689289/joining-a-server-with-the-discord-python-api)

### Configure Email Functionality
Max uses [Nodemailer](https://nodemailer.com/about/) to send verification emails to users joining the Armada server. to work proper locally please follow these steps to create a new gmail account to locally test with:

1. Create a new gmail.com account
2. Once logged in with this account enable [less secure application access](https://myaccount.google.com/u/1/lesssecureapps?pageId=none&pli=1).
3. fill in the ```EMAIL_USERNAME``` & ```EMAIL_PASS``` values on the ```.env``` file with this new gmail account's info.
1. Create a new [Google Account](https://accounts.google.com)
2. Enable [less secure application access](https://myaccount.google.com/u/1/lesssecureapps?pageId=none&pli=1) on your new Google Account.
3. Fill in the ```EMAIL_USERNAME``` & ```EMAIL_PASS``` values on the ```.env``` file with this new gmail account's info.

### Build

Install all the necessary dev dependencies

```
npm install
```

Ensure that you have followed the installation instructions above and have docker running

```
docker-compose up --build
```


# Running the Bot

## Local

To run the bot locally ensure that you have followed the installation instructions above and have docker running.
When running the bot locally ensure that you have followed the installation instructions above and have docker running.

Use docker-compose to start the container with the bot client.
Use Docker Copose to start and stop the container with the bot client.

```
docker-compose up
docker-compose down && docker-compose up --build
```

> `docker-compose down` stops the container while `docker-compose up` starts the container



If all went well, and your **DEBUG_MODE** is set properly you will see a logged message of ```Bot Online and Ready!:```

Hop onto your discord server and find a room with the bot and run the command ```!help``` to see a display of optional commands.

# Style Guide

The AirBnB javascript style guide has been put in place and will be enforced through active and passive linting.
The [AirBnB JavaScript Style Guide](https://github.com/airbnb/javascript) has been put in place and will be enforced through active and passive linting.

Ensure your local IDE has the ability to add eslint plugins. [Atom](https://atom.io) is recommended.
## IDE Configuration

> [Source](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb#eslint-config-airbnb-1)
#### Visual Studio Code

### Atom Configuration
Install the [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) Package for Visual Studio Code

Install the linter-eslint package for Atom.
#### Atom

Install the [linter-eslint](https://atom.io/packages/linter-eslint) package for Atom.

```
apm install linter-eslint
```

#### Sublime Text

Install the [SublimeLinter](https://packagecontrol.io/packages/SublimeLinter) Package for Sublime Text with [Package Control](https://packagecontrol.io/installation)

## Confirm Linting Works

### Confirm Linting Works

Removing a semi-colon from any line of Javascript will trigger the linter to automatically flag the edited line.

> [Source](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb#eslint-config-airbnb-1)

# Debug Tool Documentation

## Example of Usage
Expand Down Expand Up @@ -151,7 +191,7 @@ of this particular output should be. Reference the **Debug Level Chart**
4. Highly Fine Grained Detailed and in-depth Output.


# Modules & integrations
# Modules & Integrations

## Database
### How to connect using Sequel Pro
Expand All @@ -165,7 +205,7 @@ You can find more information about the config file `db/config/config.json`

## Node Container

[Official Node](https://hub.docker.com/_/node/) Container used.
[Officical Node](https://hub.docker.com/_/node/) Container used.

# Other Information

Expand Down