Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DISCORD_BOT_TOKEN="123"
OWNER_DISCORD_ID="123"
THE100_API_TOKEN="123"
THE100_API_BASE_URL="https://pwn-staging.herokuapp.com/api/v2/"
25 changes: 10 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,18 @@ For minor fixes and improvements, feel free to create a new branch, then submit

- For initial setup and testing, you'll first want to create a test account on our staging site: https://pwn-staging.herokuapp.com
- Clone this repo.
- Create a file called `.env` at the root of the application and add the following:

```
DISCORD_BOT_TOKEN="123"
OWNER_DISCORD_ID="123"
THE100_API_TOKEN="123"
THE100_API_BASE_URL="https://pwn-staging.herokuapp.com/api/v2/"
```

- Copy the .env.sample to .env
- Replace "123" with your private tokens. (Warning: both Discord and The100.io tokens are the equivalent of your account password - do not share or post publicly!)
- DISCORD_BOT_TOKEN is provided by Discord: go to Applications > Bot > "Click to Reveal Token"
- OWNER_DISCORD_ID is your Discord user id. You can find this by right clicking your username and select "Copy ID"
- THE100_API_TOKEN can be generated from your edit profile page. For testing, you can create an account on our staging server at https://pwn-staging.herokuapp.com and generate it there.
- THE100_API_BASE_URL is the API url. For testing, point it to our staging server. The full base url is `"https://pwn-staging.herokuapp.com/api/v2/"`. If you later point it to The100.io, make sure you also generate a new API token from your real account on The100.io.
- DISCORD_BOT_TOKEN is provided by Discord: go to Applications > Bot > "Click to Reveal Token"
- OWNER_DISCORD_ID is your Discord user id. You can find this by right clicking your username and select "Copy ID"
- THE100_API_TOKEN can be generated from your edit profile page. For testing, you can create an account on our staging server at https://pwn-staging.herokuapp.com and generate it there.
- THE100_API_BASE_URL is the API url. For testing, point it to our staging server. The full base url is `"https://pwn-staging.herokuapp.com/api/v2/"`. If you later point it to The100.io, make sure you also generate a new API token from your real account on The100.io.
- Run `npm init`, Make sure you change the github url if you are going to push to Github
- Run `npm install`
- Run `npm rebuild`
- On our staging site, create a new group: http://pwn-staging.herokuapp.com/groups/new
- Go to the edit group page, and click the link to add the discord bot to your server. Make sure to add both the bot and the webhook when it asks you.
- Start your bot server locally by typing `npm start` in your terminal.
- Go to the edit group page, and click the link for **Add Custom Discord Bot**. Make sure to add both the bot and the webhook when it asks you.
- Run `npm start` to start your bot server locally.
- You should now be able to type "!the100status" in your discord server and the bot should reply.
- You should also be able to create a new game by typing for example "!create raid tomorrow at 9pm" and then view your upcoming games by typing "!games"

Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { CommandoClient } = require("discord.js-commando");
const path = require("path");
require('dotenv').config();

const client = new CommandoClient({
commandPrefix: "!",
Expand Down
Loading