Skip to content

Commit

Permalink
Merge pull request #17 from CreepPork/develop
Browse files Browse the repository at this point in the history
Several bug fixes and new features
  • Loading branch information
CreepPork authored Oct 2, 2019
2 parents 4bb8044 + b3dad56 commit 7810da7
Show file tree
Hide file tree
Showing 13 changed files with 457 additions and 121 deletions.
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PORT=2302

COLOR_OK=3779158
COLOR_ERROR=14370117
COLOR_MAINTENANCE=2526162

LOCALE=en

Expand All @@ -12,6 +13,14 @@ REFRESH_FORCE_COMMAND=!updateForce
LIMIT_REFRESH_FORCE_TO_MANAGER=true
REPLY_DM_ON_NO_PERMS=false

MAINTENANCE_TOGGLE_COMMAND=!maintenanceMode

REACTION_MESSAGE_ID=
REACTION_ROLE_ID=
REACTION_EMOJI=🚨
MINIMUM_PLAYER_COUNT_FOR_PING=6
TIMEOUT_BETWEEN_PLAYER_PINGS_IN_MINUTES=40

CHANNEL_ID=
SERVER_MANAGER_ROLE_ID=

Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
- Locale support - out of the box support for English and Latvian. Easy setup for a new language.
![Latvian locale](https://i.gyazo.com/f346e70713da313298d2c777ea08fe86.png)

- Maintenance mode is a easy, toggable feature that prevents server down pings from being posted and doesn't poll the server until the mode is toggled again.
![Maintenance mode embed message](https://i.gyazo.com/de8b2c8df19ad04b5ad36dcc399e4aea.png)
![Private message when enabled](https://i.gyazo.com/45da0c4ea051e9f2a87f163df75ac3e9.png)

- A specific role is available to be pinged when a certain threshold of players is reached. This allows Discord users to get a ping when a configurable amount of players are on the server. Apollo also provides a way of adding these roles via a emoji reaction which assigns and removes the given role.
![Pinged role threshold is reached](https://i.gyazo.com/ff04b7e4a32ef280ce6059004223efd2.png)

</details>

## Features
Expand All @@ -44,6 +51,8 @@
- Displays when bot is refreshing info
- Times to refresh before failing and displaying on Discord
- Sentry error managment
- Maintenance mode to stop it polling the server unnecessarily without taking the bot down
- Pings a specific role when a configurable threshold is reached (also provides role assignment via a reaction)

## Requirements
- Node >= 10.15.3
Expand All @@ -65,6 +74,15 @@
- Good to go!


## Adding a new locale
1. `cp src/locales/en.ts src/locales/<language-tag>.ts`
2. Rewrite strings for your locale
3. Configure `LOCALE=<language-tag>` to match your new file
4. `npm run build`
5. Done!


## Available commands
- `!update` to quickly get info about the server status.
- `!updateForce` to create a new message about the server status.
- `!maintenanceMode` to toggle Apollo's maintenance mode feature.
119 changes: 65 additions & 54 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
"license": "MIT",
"devDependencies": {
"@types/dotenv": "^6.1.1",
"@types/node": "^11.13.6",
"tslint": "^5.16.0",
"typescript": "^3.4.4"
"@types/node": "^12.7.9",
"tslint": "^5.20.0",
"typescript": "^3.6.3"
},
"dependencies": {
"@sentry/integrations": "^5.2.0",
"@sentry/integrations": "^5.6.1",
"@sentry/node": "^5.2.0",
"discord.js": "^11.5.0",
"discord.js": "^11.5.1",
"dotenv": "^8.0.0",
"gamedig": "^2.0.14",
"moment": "^2.24.0"
Expand Down
2 changes: 1 addition & 1 deletion src/@types/gamedig/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ declare module 'gamedig' {

export interface QueryResult {
name: string;
map: string;
map?: string;
password: boolean;
maxplayers: number;
players: Player[];
Expand Down
Loading

0 comments on commit 7810da7

Please sign in to comment.