Skip to content

Commit

Permalink
Pokestop Lure Subscriptions (#100)
Browse files Browse the repository at this point in the history
* Add lure subscriptions

* Add missing import

* Fix conflicts

* Update locales

* Fix lure column type in migration 4

* Add lure processing event

* Fix lure embed if invasion is active. Add debug processing times.

* Update docs with lure info
  • Loading branch information
versx committed Dec 15, 2020
1 parent 7150f16 commit 5319b40
Show file tree
Hide file tree
Showing 25 changed files with 806 additions and 200 deletions.
143 changes: 74 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ Works with [RealDeviceMap](https://github.com/123FLO321/RealDeviceMap)


## Description:
Sends Discord notifications based on pre-defined filters for Pokemon, raids, raid eggs, field research quests, Team Rocket invasions, gym team changes, and weather. Also supports Discord user's subscribing to Pokemon, raid, quest, and Team Rocket invasion notifications via DM.
Sends Discord notifications based on pre-defined filters for Pokemon, raids, raid eggs, field research quests, Team Rocket invasions, gym team changes, and weather. Also supports Discord user's subscribing to Pokemon, raid, quest, Team Rocket invasion, and Pokestop lure notifications via DM.


## Features:
- Supports multiple Discord servers.
- Discord channel alarm reports for Pokemon, raids, eggs, quests, lures, invasions, gym team changes, and weather.
- Per user custom Discord notifications for Pokemon, raids, quests, and invasions.
- Per user custom Discord notifications for Pokemon, raids, quests, invasions, and lures.
- User interface to configure Discord notifications with ease (as well as Discord commands). (https://github.com/versx/WhMgr-UI)
- Subscription notifications based on pre-defined distance.
- Customizable alert messages with dynamic text replacement.
Expand Down Expand Up @@ -94,6 +94,11 @@ bitsadmin /transfer dotnet-install-job /download /priority FOREGROUND https://ra
"token": "<DISCORD_BOT_TOKEN>",
// Alarms file path.
"alarms": "alarms.json",
// Geofences related to the Discord guild. **NOT** used for subscriptions.
"geofences": [
"City1.txt",
"City2.json"
],
// Custom user subscriptions
"subscriptions": {
// Enable or disable custom direct message notification subscriptions per user.
Expand All @@ -109,12 +114,13 @@ bitsadmin /transfer dotnet-install-job /download /priority FOREGROUND https://ra
// Maximum amount of Invasion subscriptions a user can set, set as 0 for no limit.
"maxInvasionSubscriptions": 0,
// Maximum amount of Gym subscriptions a user can set, set as 0 for no limit.
"maxGymSubscriptions": 0
"maxGymSubscriptions": 0,
// Maximum amount of Lure subscriptions a user can set, set as 0 for no limit.
"maxLureSubscriptions": 0
},
// Enable city role assignments.
"enableCities": false,
// City/geofence role(s) used to assign city roles (if enabled) as well as depict what
// geofences are related to which Discord guild. **NOT** used for subscriptions.
// Cities used to assign roles (if enabled), **NOT** used or related to geofences or subscriptions.
"cityRoles": [
"City1",
"City2"
Expand Down Expand Up @@ -147,60 +153,55 @@ bitsadmin /transfer dotnet-install-job /download /priority FOREGROUND https://ra
000000000000000000
],
// Custom Discord status per server, leave blank or null to use current version.
"status": ""
"status": "",
"dmAlertsFile": "default.json",
"embedColors": {
"pokemon": {
"iv": [
{ "min": 0, "max": 0, "color": "#ffffff" },
{ "min": 1, "max": 89, "color": "#ffff00" },
{ "min": 90, "max": 99, "color": "#ffa500" },
{ "min": 100, "max": 100, "color": "#00ff00" }
],
"pvp": [
{ "min": 1, "max": 1, "color": "#000080" },
{ "min": 6, "max": 25, "color": "#800080" },
{ "min": 25, "max": 100, "color": "#aa2299" }
]
},
"raids": {
"1": "#ff69b4",
"2": "#ff69b4",
"3": "#ffff00",
"4": "#ffff00",
"5": "#800080",
"6": "#a52a2a",
"ex": "#2c2f33"
},
"pokestops": {
"quests": "#ffa500",
"lures": {
"normal": "#ff69b4",
"glacial": "#6495ed",
"mossy": "#507d2a",
"magnetic": "#808080"
},
"invasions": "#ff0000"
},
"weather": {
"clear": "#ffff00",
"cloudy": "#99aab5",
"fog": "#9a9a9a",
"partlyCloudy": "#808080",
"rain": "#0000ff",
"snow": "#ffffff",
"windy": "#800080"
}
}
},
"000000000000000002": {
"commandPrefix": ".",
"emojiGuildId": 000000000000000001,
"ownerId": 000000000000000000,
"donorRoleIds": [
000000000000000000
],
"moderatorRoleIds": [
000000000000000000
],
"token": "<DISCORD_BOT_TOKEN>",
"alarms": "alarms2.json",
// Custom user subscriptions
"subscriptions": {
// Enable or disable custom direct message notification subscriptions per user.
"enabled": false,
// Maximum amount of Pokemon subscriptions a user can set, set as 0 for no limit.
"maxPokemonSubscriptions": 0,
// Maximum amount of PvP subscriptions a user can set, set as 0 for no limit.
"maxPvPSubscriptions": 0,
// Maximum amount of Raid subscriptions a user can set, set as 0 for no limit.
"maxRaidSubscriptions": 0,
// Maximum amount of Quest subscriptions a user can set, set as 0 for no limit.
"maxQuestSubscriptions": 0,
// Maximum amount of Invasion subscriptions a user can set, set as 0 for no limit.
"maxInvasionSubscriptions": 0,
// Maximum amount of Gym subscriptions a user can set, set as 0 for no limit.
"maxGymSubscriptions": 0
},
"enableCities": false,
"cityRoles": [
"City3",
"City4"
],
"citiesRequireSupporterRole": true,
"pruneQuestChannels": true,
"questChannelIds": [
000000000000000000
],
"nestsChannelId": 000000000000000000,
"nestsMinimumPerHour": 2,
"shinyStats": {
"enabled": true,
"clearMessages": false,
"channelId": 000000000000000000
},
"iconStyle": "Default",
"botChannelIds": [
000000000000000000
],
"status": null
}
// etc ...
}
},
// Database configuration
"database": {
Expand Down Expand Up @@ -250,12 +251,12 @@ bitsadmin /transfer dotnet-install-job /download /priority FOREGROUND https://ra
456,
320
],
// Minimum IV value for an event Pokemon to have to meet in order to post via Discord channel alarm or direct message subscription.
// Minimum IV value for an event Pokemon to have to meet in order to post via Discord channel alarm or direct message subscription.
"eventMinimumIV": "90",
// Image URL config
"urls": {
// Static tile map images template.
"staticMap": "http://tiles.example.com:8080/static/klokantech-basic/{0}/{1}/15/300/175/1/png",
// Static map tileserver endpoint.
"staticMap": "http://tiles.example.com:8080",
// Scanner map DTS option for embeds as `scanmaps_url`
"scannerMap": "http://map.example.com/@/{0}/{1}/15"
},
Expand All @@ -268,21 +269,21 @@ bitsadmin /transfer dotnet-install-job /download /priority FOREGROUND https://ra
// Custom static map template files for each alarm type
"staticMaps": {
// Static map template for Pokemon
"pokemon": "pokemon.example.json",
"pokemon": "pokemon.example",
// Static map template for Raids and Eggs
"raids": "raids.example.json",
"raids": "raids.example",
// Static map template for field research quests
"quests": "quests.example.json",
"quests": "quests.example",
// Static map template for Team Rocket invasions
"invasions": "invasions.example.json",
"invasions": "invasions.example",
// Static map template for Pokestop lures
"lures": "lures.example.json",
"lures": "lures.example",
// Static map template for Gym team control changes
"gyms": "gyms.example.json",
"gyms": "gyms.example",
// Static map template for nest postings
"nests": "nests.example.json",
"nests": "nests.example",
// Static map template for weather changes
"weather": "weather.example.json"
"weather": "weather.example"
},
// Get text message alerts with Twilio.com
"twilio": {
Expand All @@ -305,6 +306,10 @@ bitsadmin /transfer dotnet-install-job /download /priority FOREGROUND https://ra
"gmapsKey": "",
// Minimum despawn time in minutes a Pokemon must have in order to send the alarm (default: 5 minutes)
"despawnTimeMinimumMinutes": 5,
// Reload subscriptions every minute to sync with WhMgr-UI changes
"reloadSubscriptionChangesMinutes": 1,
// Maximum amount of notifications a user can receive per minute before being rate limited
"maxNotificationsPerMinute": 10,
// Log webhook payloads to a file for debugging (do not enable unless you're having issues receiving data
"debug": false,
// Only show logs with higher or equal priority levels (Trace, Debug, Info, Warning, Error, Fatal, None)
Expand Down Expand Up @@ -448,7 +453,7 @@ __GeoJSON Format__
"stroke-opacity": 1.0,
"fill": "#0651FF",
"fill-opacity": 0.5,
"priority": 2,
"priority": 2,
}
}
]
Expand Down
2 changes: 2 additions & 0 deletions config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"maxRaidSubscriptions": 0,
"maxQuestSubscriptions": 0,
"maxInvasionSubscriptions": 0,
"maxLureSubscriptions": 0,
"maxGymSubscriptions": 0
},
"enableCities": false,
Expand Down Expand Up @@ -109,6 +110,7 @@
"maxRaidSubscriptions": 0,
"maxQuestSubscriptions": 0,
"maxInvasionSubscriptions": 0,
"maxLureSubscriptions": 0,
"maxGymSubscriptions": 0
},
"enableCities": false,
Expand Down
34 changes: 33 additions & 1 deletion docs/commands/subscriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Examples:
**invme** - Subscribe to specific Team Rocket invasion notifications.
Usage: `invme <reward_pokemon> [city]`

* `<grunt_type>` - Reward Pokemon i.e. `Dratini`, `147`
* `<reward_pokemon>` - Reward Pokemon i.e. `Dratini`, `147`
* `[city]` - (Optional) City name to get the notifications for or leave blank for all available cities.

Examples:
Expand All @@ -180,6 +180,38 @@ Examples:
* `.invmenot all`
<br>

### Pokestop Lures

**lureme** - Subscribe to specific Pokestop lure type notifications.
Usage: `lureme <lure_type> [city]`

* `<lure_type>` - Pokestop lure type i.e. `All`, `Normal`, `Glacial`, `Mossy`, `Magnetic`, `501`, `504`
* `[city]` - (Optional) City name to get the notifications for or leave blank for all available cities.

Examples:

* `.lureme`
* `.lureme all all`
* `.lureme all city1`
* `.lureme norm city1`
* `.lureme glacial,501,moss city1,city2`
<br>

**luremenot** - Unsubscribe from specific Pokestop lure type notifications.
Usage: `luremenot <lure_type> [city]`

* `<lure_type>` - Pokestop lure type i.e. `Normal`, `Glacial`, `Mossy`, `Magnetic`, `501`, `504`
* `[city]` - (Optional) City name to get the notifications for or leave blank for all available cities.

Examples:

* `.luremenot`
* `.luremenot all all`
* `.luremenot all city1`
* `.luremenot norm city1`
* `.luremenot glacial,501,moss city1,city2`
<br>

### Management

**import** - Import saved subscriptions file.
Expand Down
Loading

0 comments on commit 5319b40

Please sign in to comment.