diff --git a/README.md b/README.md index 74d3434eb..f8aa9b357 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ It allows for high end-user configurability using discord `!commands` or telegra - [Discord](https://discord.gg/AathPCp) - Place for #help and #announcments ### Install -- [Install NodeJS](https://nodejs.org/en/) version 18 +- [Install NodeJS](https://nodejs.org/en/) version 20 - [Create a discord bot and invite it to your server](https://muckelba.github.io/poracleWiki/discordbot.html) ```bash diff --git a/config/default.json b/config/default.json index 243a9dbc0..e4f1fe75f 100644 --- a/config/default.json +++ b/config/default.json @@ -41,7 +41,7 @@ // disabledCommands - array of commands which will be disabled from use "disabledCommands": [], // disableXXX - disables individual hook processing for particular scanner webhook types. disablePokestop disables - // invasion hook processing for RDM systems + // invasion hook processing for RDM/Golbat systems "disablePokemon": false, "disableRaid": false, "disablePokestop": false, @@ -52,6 +52,9 @@ "disableNest": false, "disableGym": false, "disableFortUpdate": false, + // invasion hook processing for Golbat systems + "processConfirmedInvasionLineups": false, + "disableUnconfirmedInvasion": false, // roleCheckMode (case sensitive) // "ignore" - log and don't delete/disable users once required roles/channel membership are removed // "delete" - delete user from database along with trackings once required role is removed @@ -134,7 +137,7 @@ "password": "poraclepassword", "port": 3306 }, - "scannerType": "none", // Scanner type: can be none, rdm or mad + "scannerType": "none", // Scanner type: can be none, golbat, rdm or mad "scanner": { "host": "127.0.0.1", "database": "scannerdb", diff --git a/config/defaults/testdata.json b/config/defaults/testdata.json index c8898c565..6bcbb5948 100644 --- a/config/defaults/testdata.json +++ b/config/defaults/testdata.json @@ -121,9 +121,16 @@ "test": "invasion", "webhook": {"name":"Site Of Doges Chantry","pokestop_id":"e3c2628308cf468fb802ff72b326232c.16","latitude":51.276225,"longitude":1.087866,"updated":1643529456,"last_modified":1643529455,"url":"http://lh3.googleusercontent.com/esDyMLRH7TGp6lgw2VLNk8tBRzx5nJ3_9JRiPgZA1spY_FKMpDI-1lBwfrN4enCy8JF4QTlVRwIlpQMqxIq9Z63n_Q","incident_start":1643529452,"incident_expiration":1643531252,"incident_grunt_type":49} }, + { + "type": "pokestop", + "test": "lineup", + "location": "current", + "webhook": {"character": 32, "confirmed": true, "display_type": 1, "enabled": true, "expiration": 1710849060, "grunt_type": 32, "id": "-322792215110502470", "incident_expire_timestamp": 1710849060, "latitude": 50.963167, "lineup": [{"slot": 1, "pokemon_id": 453, "form": 0}, {"slot": 2, "pokemon_id": 30, "form": 0}, {"slot": 3, "pokemon_id": 591, "form": 0}], "longitude": 6.956639, "pokestop_id": "8578f59f640a4230bfb9541b2e3379ba.16", "pokestop_name": "Wandgem\u00e4lde CGN Rheinufer", "start": 1710847260, "style": 1, "updated": 1710847266, "url": "http://lh3.googleusercontent.com/GEr1DwEG6GP7Ms047EvQGZYr1wN1pMYFRJKgycnVdZokklB_410kiCMdMGoCJQnOvgaDP734SrNvSSwzlnOOVdrfkFwh"} + }, { "type": "pokestop", "test": "giovanni", + "location": "current", "webhook": {"name":"Patisserie Valerie","pokestop_id":"4a5d8d346e584faaa41bc1a8abe8055a.16","latitude":51.279894,"longitude":1.078755,"updated":1643529456,"last_modified":1643508636,"url":"http://lh3.googleusercontent.com/SEhpe0J4i_odlJxtpph2REtdoMTKYxWPhhZryDJdFBCuPUdBY0uw0yeYKK9Obbk79ziVdJkYzBA1hjqbQ7kqeO4W3eFt","incident_start":1643522400,"incident_expiration":1643580000,"incident_grunt_type":44} }, { @@ -151,17 +158,55 @@ }, { "type": "pokestop", - "test": "sparklylure", + "test": "goldlure", "webhook": {"name":"Memorial Sculpture & Verse","pokestop_id":"0d4b26adbf24446ba893f0aa3f8de337.16","latitude":51.284727,"longitude":1.060694,"updated":1643554276,"last_modified":1643553312,"lure_expiration":1643555112,"lure_id":506,"url":"http://lh3.googleusercontent.com/Ce-yPhm1FwGNbFzaM0ToMESZ57EWx1g8dKXXgEE4o-mmdP0XdsHk2nSEXOBk88H5PIXBHud-b7m6PUUJ3N8Pe_XB98NY"} }, + { + "type": "pokestop", + "test": "showcase", + "location": "current", + "webhook": {"pokestop_name": "Playground Buchforst 2.0","grunt_type": 0,"url": "http://lh3.googleusercontent.com/w6gTZvocAujGU1iDccte_76VFYrRVqfhPxJKDB2yDftlc7HOxwYXKxU1_-Y27TKKEGenQjWxduaFHGHOub_KSHEW1fY","start": 1688886000,"longitude": 6.994553,"pokestop_id": "0c1c942502d34767a030c25ecc3a93be.16","expiration": 1689184800,"character": 0,"style": 0,"display_type": 9,"latitude": 50.951794,"updated": 1689008020,"enabled": true,"id": "6287513096386229372","incident_expire_timestamp": 1689184800} + }, { "type": "fort_update", "test": "edit", + "location": "current", "webhook": {"change_type": "edit", "edit_types": ["name", "description"], "new": {"id": "f7430347f5c34facb838be376f16adea.16", "type": "gym", "name": "Journey Through Trees And Time", "description": "A beautiful trip through time, trees, and space", "image_url": "http://lh3.googleusercontent.com/9kWjcud4Eeh4nNC6jv8zBkEr8kuQbW-QY2sKRHQqLrwnxf3drxO5AtR2qsDEjmxz3-h_eTHnQrT3AFl5Xmg2MXVqChh5", "location": {"lat": 51.268716, "lon": 1.013956}}, "old": {"id": "f7430347f5c34facb838be376f16adea.16", "type": "gym", "name": "The old walkway", "description": "An ancient trip through time and space", "image_url": "http://lh3.googleusercontent.com/9kWjcud4Eeh4nNC6jv8zBkEr8kuQbW-QY2sKRHQqLrwnxf3drxO5AtR2qsDEjmxz3-h_eTHnQrT3AFl5Xmg2MXVqChh5", "location": {"lat": 51.268716, "lon": 1.013956}}} }, + { + "type": "fort_update", + "test": "editdesc", + "location": "keep", + "webhook": {"change_type": "edit", "edit_types": ["name", "description"], "new": {"id": "a3118750bc2d3d0690f213ed74ba030f.16", "type": "gym", "name": "Journey Through Trees And Time", "description": "A beautiful trip through time, trees, and space", "image_url": "http://lh3.googleusercontent.com/VSBh5Q5W6z5LHBLDFQqBNtCTBxqe0HAy4H9W_Um2_AVUg8Rh40u1tYteSc2TVLtPAd4v7c83umdTh6RUVNpOkACjt9saHNj6a_2XYRsGYg", "location": {"lat": 50.975396, "lon": 6.943889}}, "old": {"id": "a3118750bc2d3d0690f213ed74ba030f.16", "type": "gym", "name": "The old walkway", "description": "An ancient trip through time and space", "image_url": "http://lh3.googleusercontent.com/VSBh5Q5W6z5LHBLDFQqBNtCTBxqe0HAy4H9W_Um2_AVUg8Rh40u1tYteSc2TVLtPAd4v7c83umdTh6RUVNpOkACjt9saHNj6a_2XYRsGYg", "location": {"lat": 50.975396, "lon": 6.943889}}} + }, + { + "type": "fort_update", + "test": "editloc", + "location": "keep", + "webhook": {"change_type": "edit", "edit_types": ["location"], "new": {"id": "f7430347f5c34facb838be376f16adea.16", "type": "pokestop", "name": "Journey Through Trees And Time", "description": "A beautiful trip through time, trees, and space", "image_url": "http://lh3.googleusercontent.com/VSBh5Q5W6z5LHBLDFQqBNtCTBxqe0HAy4H9W_Um2_AVUg8Rh40u1tYteSc2TVLtPAd4v7c83umdTh6RUVNpOkACjt9saHNj6a_2XYRsGYg", "location": {"lat": 50.975396, "lon": 6.943889}}, "old": {"id": "f7430347f5c34facb838be376f16adea.16", "type": "pokestop", "name": "The old walkway", "description": "An ancient trip through time and space", "image_url": "http://lh3.googleusercontent.com/VSBh5Q5W6z5LHBLDFQqBNtCTBxqe0HAy4H9W_Um2_AVUg8Rh40u1tYteSc2TVLtPAd4v7c83umdTh6RUVNpOkACjt9saHNj6a_2XYRsGYg", "location": {"lat": 50.975598, "lon": 6.942527}}} + }, + { + "type": "fort_update", + "test": "editdescimg", + "location": "current", + "webhook": {"change_type": "edit", "edit_types": ["description", "image_url"], "new": {"id": "f7430347f5c34facb838be376f16adea.16", "type": "pokestop", "name": "Journey Through Trees And Time", "description": "A beautiful trip through time, trees, and space", "image_url": "http://lh3.googleusercontent.com/VSBh5Q5W6z5LHBLDFQqBNtCTBxqe0HAy4H9W_Um2_AVUg8Rh40u1tYteSc2TVLtPAd4v7c83umdTh6RUVNpOkACjt9saHNj6a_2XYRsGYg", "location": {"lat": 50.975396, "lon": 6.943889}}, "old": {"id": "f7430347f5c34facb838be376f16adea.16", "type": "pokestop", "name": "Journey Through Trees And Time", "description": "An ancient trip through time and space", "image_url": "http://lh3.googleusercontent.com/rJyk2-h9rXdl_jLpM48bRQ5UeO0RL7Foa1oP2SjoIMWbKJdC3DQBhsGCRME367qobgc3neXlZhwv5uxeUiwiLuk-KFfC", "location": {"lat": 50.975396, "lon": 6.943889}}} + }, + { + "type": "fort_update", + "test": "editall", + "location": "keep", + "webhook": {"change_type": "edit", "edit_types": ["name", "description", "image_url", "location"], "new": {"id": "f7430347f5c34facb838be376f16adea.16", "type": "gym", "name": "Journey Through Trees And Time", "description": "A beautiful trip through time, trees, and space", "image_url": "http://lh3.googleusercontent.com/VSBh5Q5W6z5LHBLDFQqBNtCTBxqe0HAy4H9W_Um2_AVUg8Rh40u1tYteSc2TVLtPAd4v7c83umdTh6RUVNpOkACjt9saHNj6a_2XYRsGYg", "location": {"lat": 50.975396, "lon": 6.943889}}, "old": {"id": "f7430347f5c34facb838be376f16adea.16", "type": "gym", "name": "The old walkway", "description": "An ancient trip through time and space", "image_url": "http://lh3.googleusercontent.com/rJyk2-h9rXdl_jLpM48bRQ5UeO0RL7Foa1oP2SjoIMWbKJdC3DQBhsGCRME367qobgc3neXlZhwv5uxeUiwiLuk-KFfC", "location": {"lat": 50.975598, "lon": 6.942527}}} + }, { "type": "fort_update", "test": "new", - "webhook": {"change_type": "new", "new": {"id": "0b427e88a3254eeab442d425412e4505.16","type": "pokestop", "name": null, "description": null, "image_url": null, "location": {"lat": -36.842772, "lon": 174.761578 } } } + "location": "current", + "webhook": {"change_type": "new", "new": {"id": "0b427e88a3254eeab442d425412e4505.16","type": "pokestop", "name": null, "description": null, "image_url": null, "location": {"lat": 50.982116, "lon": 6.933164 }}} + }, + { + "type": "fort_update", + "test": "remove", + "location": "current", + "webhook": {"change_type": "removal", "old": {"id": "f7430347f5c34facb838be376f16adea.16", "type": "pokestop", "name": "Journey Through Trees And Time", "description": null, "image_url": "http://lh3.googleusercontent.com/VSBh5Q5W6z5LHBLDFQqBNtCTBxqe0HAy4H9W_Um2_AVUg8Rh40u1tYteSc2TVLtPAd4v7c83umdTh6RUVNpOkACjt9saHNj6a_2XYRsGYg", "location": {"lat": 50.975598, "lon": 6.942527}}} } ] diff --git a/locale/de.json b/locale/de.json index 00499b330..52d62c866 100644 --- a/locale/de.json +++ b/locale/de.json @@ -11,8 +11,9 @@ "add":"hinzufügen", "Added areas:":"Hinzugefügte Gebiete:", "Adventure Hat 2020":"Forscher", + "All alert messages have been stopped, you can resume them with {0}{1}":"Alle Warnmeldungen wurden gestoppt, sie können mit {0}{1} fortgesetzt werden.", "all items":"alle Items", - "All level":"alle Level", + "all level":"alle Level", "all pokemon":"alle Pokemon", "All team's":"alle Teams", "allprofiles":"alle Profile", @@ -23,12 +24,6 @@ "area":"Gebiet", "Area display: {0}":"gewähltes Gebiet: {0}", "areas":"Gebiete", - "AR-Scan 1 pokéstop(s)":"Scanne 1 Pokéstop", - "AR-Scan 2 pokéstop(s)":"Scanne 2 Pokéstops", - "AR-Scan 3 pokéstop(s)":"Scanne 3 Pokéstops", - "AR-Scan 4 pokéstop(s)":"Scanne 4 Pokéstops", - "AR-Scan 5 pokéstop(s)":"Scanne 5 Pokéstops", - "AR-Scan a pokéstop":"Scanne einen Pokéstop", "Aria":"Gesang", "Arlo":"Arlo", "Armored":"Rüstung", @@ -39,137 +34,13 @@ "Available forms": "verfügbare Formen", "Average": "Average", "Black":"Schwarz", - "Battle a Team Leader 2 times":"Kämpfe 2 mal gegen einen Team Rocket Leader", - "Battle Another Trainer 2 times":"Kämpfe 2 mal gegen einen anderen Trainer", - "Battle Another Trainer":"Kämpfe gegen einen anderen Trainer", "battle changes": "wird angegriffen", - "Battle in a gym 2 times":"Kämpfe 2 mal in einer Arena", - "Battle in a gym 3 times":"Kämpfe 3 mal in einer Arena", - "Battle in a gym 4 times":"Kämpfe 4 mal in einer Arena", - "Battle in a gym 5 times":"Kämpfe 5 mal in einer Arena", - "Battle in a gym":"Kämpfe in einer Arena", - "Battle in a raid":"Kämpfe in einer Raid", "Blue Striped":"Blaulinig", "blue":"blau", "Boosted by": "Wetterverstärkung bei", "Bug":"Käfer", "Burn":"Flammenmodul", "Candies":"Bonbons", - "Catch 1 Dark-type Pokémon":"Fange ein Pokémon vom Typ Unlicht", - "Catch 1 Dragon-type Pokémon":"Fange ein Pokémon vom Typ Drache", - "Catch 1 Fairy-type Pokémon":"Fange ein Pokémon vom Typ Fee", - "Catch 1 Fighting-type Pokémon":"Fange ein Pokémon vom Typ Kampf", - "Catch 1 Fire-type Pokémon":"Fange ein Pokémon vom Typ Feuer", - "Catch 1 Ghost-type Pokémon":"Fange ein Pokémon vom Typ Geist", - "Catch 1 Grass-type Pokémon":"Fange ein Pokémon vom Typ Pflanze", - "Catch 1 Ice-type Pokémon":"Fange ein Pokémon vom Typ Eis", - "Catch 1 Normal-type Pokémon":"Fange ein Pokémon vom Typ Normal", - "Catch 1 Pokémon with weather boost":"Fange ein Pokémon mit Wetterverstärkung", - "Catch 1 Pokémon":"Fange ein Pokémon", - "Catch 1 Psychic-type Pokémon":"Fange ein Pokémon vom Typ Psycho", - "Catch 1 Water-type Pokémon":"Fange ein Pokémon vom Typ Wasser", - "Catch 10 Ice-type Pokémon":"Fange 10 Pokémon vom Typ Eis", - "Catch 10 Normal-type Pokémon":"Fange 10 Pokémon vom Typ Normal", - "Catch 10 Pokémon with weather boost":"Fange 10 Pokémon mit Wetterverstärkung", - "Catch 10 Pokémon":"Fange 10 Pokémon", - "Catch 11 Pokémon":"Fange 11 Pokémon", - "Catch 12 Pokémon":"Fange 12 Pokémon", - "Catch 13 Pokémon":"Fange 13 Pokémon", - "Catch 14 Pokémon":"Fange 14 Pokémon", - "Catch 15 Ice-type Pokémon":"Fange 15 Pokémon vom Typ Eis", - "Catch 15 Pokémon":"Fange 15 Pokémon", - "Catch 2 Dark-type Pokémon":"Fange zwei Pokémon vom Typ Unlicht", - "Catch 2 Dragon-type Pokémon":"Fange zwei Pokémon vom Typ Drache", - "Catch 2 Fairy-type Pokémon":"Fange zwei Pokémon vom Typ Fee", - "Catch 2 Fighting-type Pokémon":"Fange zwei Pokémon vom Typ Kampf", - "Catch 2 Ghost-type Pokémon":"Fange zwei Pokémon vom Typ Geist", - "Catch 2 Grass-type Pokémon":"Fange zwei Pokémon vom Typ Pflanze", - "Catch 2 Ice-type Pokémon":"Fange zwei Pokémon vom Typ Eis", - "Catch 2 Normal-type Pokémon":"Fange zwei Pokémon vom Typ Normal", - "Catch 2 Pokémon with weather boost":"Fange zwei Pokémon mit Wetterverstärkung", - "Catch 2 Pokémon":"Fange zwei Pokémon", - "Catch 2 Psychic-type Pokémon":"Fange zwei Pokémon vom Typ Psycho", - "Catch 2 Water-type Pokémon":"Fange zwei Pokémon vom Typ Wasser", - "Catch 20 Pokémon":"Fange 20 Pokémon", - "Catch 3 Dark-type Pokémon":"Fange drei Pokémon vom Typ Unlicht", - "Catch 3 different species of Dark-type Pokémon":"Fange drei unterschiedliche Pokémon vom Typ Unlicht", - "Catch 3 different species of Psychic-type Pokémon":"Fange drei unterschiedliche Pokémon vom Typ Psycho", - "Catch 3 Dragon-type Pokémon":"Fange drei Pokémon vom Typ Drache", - "Catch 3 Electric, Normal or Poison-type Pokémon":"Fange drei Pokémon vom Typ Elektro, Normal oder Gift", - "Catch 3 Electric, Water or Fire-type Pokémon":"Fange drei Pokémon vom Typ Elektro, Wasser oder Fee", - "Catch 3 Fairy-type Pokémon":"Fange drei Pokémon vom Typ Fee", - "Catch 3 Fighting-type Pokémon":"Fange drei Pokémon vom Typ Kampf", - "Catch 3 Fire-type Pokémon":"Fange drei Pokémon vom Typ Feuer", - "Catch 3 Ghost-type Pokémon":"Fange drei Pokémon vom Typ Geist", - "Catch 3 Grass-type Pokémon":"Fange drei Pokémon vom Typ Pflanze", - "Catch 3 Ice-type Pokémon":"Fange drei Pokémon vom Typ Eis", - "Catch 3 Normal-type Pokémon":"Fange drei Pokémon vom Typ Normal", - "Catch 3 Pokémon with weather boost":"Fange drei Pokémon mit Wetterverstärkung", - "Catch 3 Pokémon":"Fange drei Pokémon", - "Catch 3 Psychic-type Pokémon":"Fange drei Pokémon vom Typ Psycho", - "Catch 3 Water-type Pokémon":"Fange drei Pokémon vom Typ Wasser", - "Catch 4 Dark-type Pokémon":"Fange 4 Pokémon vom Typ Unlicht", - "Catch 4 Dragon-type Pokémon":"Fange 4 Pokémon vom Typ Drache", - "Catch 4 Fairy-type Pokémon":"Fange 4 Pokémon vom Typ Fee", - "Catch 4 Fighting-type Pokémon":"Fange 4 Pokémon vom Typ Kampf", - "Catch 4 Fire-type Pokémon":"Fange 4 Pokémon vom Typ Feuer", - "Catch 4 Ghost-type Pokémon":"Fange 4 Pokémon vom Typ Geist", - "Catch 4 Grass-type Pokémon":"Fange 4 Pokémon vom Typ Pflanze", - "Catch 4 Ice or Grass-type Pokémon":"Fange 4 Pokémon vom Typ Eis oder Pflanze", - "Catch 4 Ice-type Pokémon":"Fange 4 Pokémon vom Typ Eis", - "Catch 4 Normal-type Pokémon":"Fange 4 Pokémon vom Typ Normal", - "Catch 4 Pokémon with weather boost":"Fange 4 Pokémon mit Wetterverstärkung", - "Catch 4 Pokémon":"Fange 4 Pokémon", - "Catch 4 Psychic-type Pokémon":"Fange 4 Pokémon vom Typ Psycho", - "Catch 4 Water-type Pokémon":"Fange 4 Pokémon vom Typ Wasser", - "Catch 5 Dark-type Pokémon":"Fange 5 Pokémon vom Typ Unlicht", - "Catch 5 different species of Bug-type Pokémon":"Fange 5 unterschiedliche Pokémon vom Typ Käfer", - "Catch 5 different species of Ice-type Pokémon":"Fange 5 unterschiedliche Pokémon vom Typ Eis", - "Catch 5 Dragon-type Pokémon":"Fange 5 Pokémon vom Typ Drache", - "Catch 5 Fairy-type Pokémon":"Fange 5 Pokémon vom Typ Fee", - "Catch 5 Fighting-type Pokémon":"Fange 5 Pokémon vom Typ Kampf", - "Catch 5 Fire-type Pokémon":"Fange 5 Pokémon vom Typ Feuer", - "Catch 5 Flying, Psychic or Dark-type Pokémon":"Fange 5 Pokémon vom Typ Flug, Psycho oder Unlicht", - "Catch 5 Ghost-type Pokémon":"Fange 5 Pokémon vom Typ Geist", - "Catch 5 Grass-type Pokémon":"Fange 5 Pokémon vom Typ Pflanze", - "Catch 5 Ice-type Pokémon":"Fange 5 Pokémon vom Typ Eis", - "Catch 5 Normal-type Pokémon":"Fange 5 Pokémon vom Typ Normal", - "Catch 5 Pokémon with weather boost":"Fange 5 Pokémon mit Wetterverstärkung", - "Catch 5 Pokémon":"Fange 5 Pokémon", - "Catch 5 Psychic-type Pokémon":"Fange 5 Pokémon vom Typ Psycho", - "Catch 5 Water-type Pokémon":"Fange 5 Pokémon vom Typ Wasser", - "Catch 6 Dark-type Pokémon":"Fange 6 Pokémon vom Typ Unlicht", - "Catch 6 Dragon-type Pokémon":"Fange 6 Pokémon vom Typ Drache", - "Catch 6 Fairy-type Pokémon":"Fange 6 Pokémon vom Typ Fee", - "Catch 6 Fighting-type Pokémon":"Fange 6 Pokémon vom Typ Kampf", - "Catch 6 Fire-type Pokémon":"Fange 6 Pokémon vom Typ Feuer", - "Catch 6 Ghost-type Pokémon":"Fange 6 Pokémon vom Typ Geist", - "Catch 6 Grass-type Pokémon":"Fange 6 Pokémon vom Typ Pflanze", - "Catch 6 Ice-type Pokémon":"Fange 6 Pokémon vom Typ Eis", - "Catch 6 Normal-type Pokémon":"Fange 6 Pokémon vom Typ Normal", - "Catch 6 Pokémon with weather boost":"Fange 6 Pokémon mit Wetterverstärkung", - "Catch 6 Pokémon":"Fange 6 Pokémon", - "Catch 6 Psychic-type Pokémon":"Fange 6 Pokémon vom Typ Psycho", - "Catch 6 Water-type Pokémon":"Fange 6 Pokémon vom Typ Wasser", - "Catch 7 Dark-type Pokémon":"Fange 7 Pokémon vom Typ Unlicht", - "Catch 7 Dragon-type Pokémon":"Fange 7 Pokémon vom Typ Drache", - "Catch 7 Fairy-type Pokémon":"Fange 7 Pokémon vom Typ Fee", - "Catch 7 Fighting-type Pokémon":"Fange 7 Pokémon vom Typ Kampf", - "Catch 7 Fire-type Pokémon":"Fange 7 Pokémon vom Typ Feuer", - "Catch 7 Ghost-type Pokémon":"Fange 7 Pokémon vom Typ Geist", - "Catch 7 Grass, Water or Fire-type Pokémon":"Fange 7 Pokémon vom Typ Pflanze, Wasser oder Feuer", - "Catch 7 Grass-type Pokémon":"Fange 7 Pokémon vom Typ Pflanze", - "Catch 7 Ice-type Pokémon":"Fange 7 Pokémon vom Typ Eis", - "Catch 7 Normal-type Pokémon":"Fange 7 Pokémon vom Typ Normal", - "Catch 7 Pokémon with weather boost":"Fange 7 Pokémon mit Wetterverstärkung", - "Catch 7 Pokémon":"Fange 7 Pokémon", - "Catch 7 Psychic-type Pokémon":"Fange 7 Pokémon vom Typ Psycho", - "Catch 7 Water-type Pokémon":"Fange 7 Pokémon vom Typ Eis", - "Catch 8 Pokémon with weather boost":"Fange 8 Pokémon mit Wetterverstärkung", - "Catch 8 Pokémon":"Fange 8 Pokémon", - "Catch 9 Pokémon with weather boost":"Fange 9 Pokémon mit Wetterverstärkung", - "Catch 9 Pokémon":"Fange 9 Pokémon", - "Catch a Ditto":"Fange ein Ditto", "candy":"Bonbons", "Channel added":"Kanal hinzugefügt", "channel":"Kanal", @@ -192,15 +63,10 @@ "Current language is set to":"Aktuell eingestellte Sprache:", "Current Weather: {0} {1}": "Aktuelles Wetter: {0} {1}", "Currently configured profiles are:":"Folgende Profile sind verfügbar:", - "d":"d", "Dandy":"Kavaliersschnitt", "Dark":"Unlicht", "Debutante":"Fräuleinschnitt", "Decoy":"Täusch", - "def":"def", - "Defeat 2 Team GO Rocket Grunts":"Kämpfe gegen zwei Team GO Rocket Rüpel", - "Defeat 3 Team GO Rocket Grunts":"Kämpfe gegen drei Team GO Rocket Rüpel", - "Defeat a Team GO Rocket Grunt":"Kämpfe gegen einen Team GO Rocket Rüpel", "Defense":"Verteidigung", "Diamond":"Diamantenschnitt", "disabled":"deaktiviert.", @@ -209,22 +75,6 @@ "Douse":"Aquamodul", "Dragon Scale":"Drachenhaut", "Dragon":"Drache", - "Earn 1 Friendship points by Walking with your Buddy":"Verdiene 1 Herz durch spazierengehen mit deinem Kumpel", - "Earn 1 Souvenirs from your Buddy":"Verdiene 1 Geschenk von deinem Kumpel", - "Earn 2 candy walking with your buddy":"Verdiene 2 Bonbons durch spazierengehen mit deinem Kumpel", - "Earn 2 Friendship points by Walking with 2 Buddy":"Verdiene 2 Herz durch spazierengehen mit deinem Kumpel", - "Earn 2 Hearts with your Buddy":"Verdiene 2 Herzen mit deinem Kumpel", - "Earn 2 Souvenirs from your Buddy":"Verdiene 2 Geschenke von deinem Kumpel", - "Earn 3 candy walking with your buddy":"Verdiene 3 Bonbons durch spazierengehen mit deinem Kumpel", - "Earn 3 Friendship points by Walking with your Buddy":"Verdiene 3 Herz durch spazierengehen mit deinem Kumpel", - "Earn 3 Hearts with your Buddy":"Verdiene 3 Herzen mit deinem Kumpel", - "Earn 3 Souvenirs from your Buddy":"Verdiene 3 Geschenke von deinem Kumpel", - "Earn 4 candy walking with your buddy":"Verdiene 4 Bonbons durch spazierengehen mit deinem Kumpel", - "Earn 4 Hearts with your Buddy":"Verdiene 4 Herzen mit deinem Kumpel", - "Earn 5 candy walking with your buddy":"Verdiene 5 Bonbons durch spazierengehen mit deinem Kumpel", - "Earn 5 Hearts with your Buddy":"Verdiene 5 Herzen mit deinem Kumpel", - "Earn a candy walking with your buddy":"Verdiene ein Bonbon durch spazierengehen mit deinem Kumpel", - "Earn a Heart with your Buddy":"Verdiene ein Herz mit deinem Kumpel", "East Sea":"Östliches Meer", "egg":"Ei", "eggs":"Eier", @@ -240,13 +90,11 @@ "Exclamation Point":"Ausrufezeichen", "Extremely resistant to":"extrem resistent gegen", "Evolutions":"Entwicklungen", - "Evolve a Pokémon":"Entwickle ein Pokémon", "Fairy":"Fee", "Fall 2019":"Halloween 2019", "Fan":"Wirbel", "Fast TM":"Sofort-TM", "female":"weiblich", - "Female":"weiblich", "Fighting":"Kampf", "Fire":"Feuer", "Flying":"Flug", @@ -254,7 +102,6 @@ "Forecast":"Vorhersage", "form":"form", "french":"Französisch", - "Frost":"Frost", "Galarian Standard":"Galar-Normalmodus", "Galarian Zen":"Galar-Trance-Modus", "Galarian":"Galar", @@ -263,8 +110,6 @@ "genderless":"geschlechtslos", "german":"Deutsch", "Ghost":"Geist", - "Giovanni":"Giovanni", - "Give your buddy 3 treats":"Gib deinem Kumpel 3 Beeren", "Glacial Lure Module":"Gletscher-Lockmodul", "Glacial Lure":"Gletscher Lockmodul", "glacial":"gletscher", @@ -280,13 +125,7 @@ "gym":"Arena", "gyms":"Arenen", "harmony":"unbesetzt", - "Harmony":"Unbesetzt", "Hastebin seems down":"Hastebin nicht erreichbar", - "Hatch 2 eggs":"Brüte 2 Eier aus", - "Hatch 3 eggs":"Brüte 3 Eier aus", - "Hatch 4 eggs":"Brüte 4 Eier aus", - "Hatch 5 eggs":"Brüte 5 Eier aus", - "Hatch a egg":"Brüte ein Eier aus", "Heart":"Herzenschnitt", "Heat":"Hitze", "help":"hilfe", @@ -310,19 +149,15 @@ "including battle changes":"inklusive Teamänderungen", "including slot changes":"inklusive Platzänderungen", "individually":"individuell", - "instinct":"intuition", - "Instinct":"Intuition", + "instinct":"Intuition", "invasion":"Invasion", "italian":"Italienisch", "items":"Gegenstände", - "iv":"iv", "japanese":"Japanisch", "Kabuki":"Kabuki-Schnitt", "King's Rock":"King-Stein", "korean":"Koreanisch", "La Reine":"Königinnenschnitt", - "Land":"Land", - "Land 3 throws":"Lande 3 Würfe", "language":"Sprache", "Large": "Large", "Legendary":"Legendär", @@ -344,42 +179,7 @@ "Magnetic Lure Module":"Magnet-Lockmodul", "Magnetic Lure":"Magnet Lockmodul", "magnetic":"magnet", - "Make 2 Excellent Throws in a row":"Lande 2 Fabelhafte Würfe hintereinander", - "Make 2 Excellent Throws":"Lande 3 Fabelhafte Würfe", - "Make 2 Great Throws in a row":"Lande 2 Großartige Würfe hintereinander", - "Make 2 Great Throws":"Lande 2 Großartige Würfe", - "Make 2 Nice Curveball Throws in a row":"Lande 2 Gute Curveballwürfe hintereinander", - "Make 2 Nice Throws in a row":"Lande 2 Großartige Würfe hintereinander", - "Make 2 Nice Throws":"Lande 2 Großartige Würfe", - "Make 3 Excellent Throws in a row":"Lande 3 Fabelhafte Würfe hintereinander", - "Make 3 Excellent Throws":"Lande 3 Fabelhafte Würfe", - "Make 3 Great Curveball Throws in a row":"Lande 3 Großartige Curveballwürfe hintereinander", - "Make 3 Great Curveball Throws":"Lande 3 Großartige Curveballwürfe", - "Make 3 Great Throws in a row":"Lande 3 Großartige Würfe hintereinander", - "Make 3 Great Throws":"Lande 3 Großartige Würfe", - "Make 3 Nice Throws in a row":"Lande 3 Gute Würfe hintereinander", - "Make 3 Nice Throws":"Lande 3 Gute Würfe", - "Make 3 undefined Curveball Throws":"Lande 3 Curveballwürfe", - "Make 4 Excellent Throws in a row":"Lande 4 Fabelhafte Würfe hintereinander", - "Make 4 Excellent Throws":"Lande 4 Fabelhafte Würfe", - "Make 4 Great Throws in a row":"Lande 4 Großartige Würfe hintereinander", - "Make 4 Great Throws":"Lande 4 Großartige Würfe", - "Make 4 Nice Throws in a row":"Lande 4 Gute Würfe hintereinander", - "Make 4 Nice Throws":"Lande 4 Gute Würfe", - "Make 5 Curveball Throws in a row":"Lande 5 Großartige Curveballwürfe hintereinander", - "Make 5 Excellent Throws in a row":"Lande 5 Fabelhafte Würfe hintereinander", - "Make 5 Excellent Throws":"Lande 5 Fabelhafte Würfe", - "Make 5 Great Curveball Throws in a row":"Lande 5 Großartige Curveballwürfe hintereinander", - "Make 5 Great Throws in a row":"Lande 5 Großartige Würfe hintereinander", - "Make 5 Great Throws":"Lande 5 Großartige Würfe", - "Make 5 Nice Throws in a row":"Lande 5 Gute Würfe hintereinander", - "Make 5 Nice Throws":"Lande 5 Gute Würfe", - "Make 5 undefined Curveball Throws in a row":"Lande 5 Curveballwürfe hintereinander", - "Make a Excellent Throw":"Lande einen Fabelhafte Wurf", - "Make a Great Throw":"Lande einen Großartigen Wurf", - "Make a Nice Throw":"Lande einen Guten Wurf", "male":"männlich", - "Male":"männlich", "Matron":"Damenschnitt", "Max Potion":"Top-Trank", "Max Revive":"Top-Beleber", @@ -399,7 +199,6 @@ "Mega {0} Y": "Mega-{0} Y", "Mega X":"Mega X", "Mega Y":"Mega Y", - "Mega":"Mega", "membership":"Mitglied", "Metal Coat":"Metallmantel", "minimum time:":"minimale Zeit:", @@ -412,8 +211,7 @@ "Mow":"Schneid", "must be an EX Gym":"muss eine Ex-Raid-Arena sein", "Must Be Buddy":"muss aktueller Kumpel sein", - "mystic":"weisheit", - "Mystic":"Weisheit", + "mystic":"Weisheit", "name":"Name", "nameYourWebhookName":"nameWebhookName", "Natural":"Zottelform", @@ -429,8 +227,6 @@ "No weather information is available for this location":"Keine Wetterinformationen für diesen Standort verfügbar", "Normal Lure Module":"Normal-Lockmodul", "Normal Lure":"Normales Lockmodul", - "Normal":"Normal", - "normal":"normal", "Only Daytime":"nur tagsüber", "Only Nighttime":"nur nachts", "Oops, a distance was set in command but no location is defined for your tracking - check the":"Fehler: Im Befehl wurde eine Distanz angegeben, aber es wurde noch kein Standort festgelegt. Siehe:", @@ -449,18 +245,13 @@ "Pinap Berry":"Sananabeere", "Pirouette":"Tanzform", "Plant Cloak":"Pflanzenumhang", - "Play with your Buddy":"Spiele mit deinem Kumpel", "Please run commands in Direct Messages":"Befehle müssen als Direktnachrichten an den Poracle-Bot gesendet werden!", "Poffin":"Knursp", "Poison":"Gift", "Poké Ball":"Pokéball", "polish":"Polnisch", - "poracle":"poracle", "Possible weather change at":"Möglicher Wetterwechsel um", "Potion":"Trank", - "Power up a Pokémon 3 times":"Power up ein Pokemon 3 mal", - "Power up a Pokémon 5 times":"Power up ein Pokemon 5 mal", - "Power up a Pokémon 9 times":"Power up ein Pokemon 9 mal", "Premium Battle Pass":"Premium Raidpass", "Primal":"Proto", "Primal {0}":"Proto {0}", @@ -506,9 +297,6 @@ "Secondary Type":"Sekundärer Typ", "Seen":"gesehen", "settime":"Zeit", - "Send 10 gifts":"Verschicke 10 Geschenke", - "Send 3 gifts":"Verschicke 3 Geschenke", - "Send 5 gifts":"Verschicke 5 Geschenke", "Shadow":"Crypto", "Shadow Legendary":"Crypto Legendär", "Shiny information not yet calculated - wait a few minutes and try again":"Shinyinfos noch nicht berechnet - warte ein paar Minuten und versuche es erneut", @@ -533,18 +321,12 @@ "Sparkly Lure":"Gold Lockmodul", "Special Requirement":"spezielle Voraussetzungen", "Speed":"Initiative", - "Spin 10 pokéstops":"Drehe 10 Pokéstops", - "Spin 3 pokéstops":"Drehe 3 Pokéstops", "Spring":"Frühling", - "sta":"sta", "Standard":"Normalform", "Star":"Sternchenschnitt", - "stardust":"sternenstaub", - "Stardust":"Sternenstaub", - "start":"start", + "stardust":"Sternenstaub", "Status information not yet warmed up":"Statusinformationen noch nicht verfügbar", "Steel":"Stahl", - "stop":"stop", "Summer":"Sommer", "Sun Stone":"Sonnenstein", "Sunny":"Sonnenform", @@ -552,12 +334,6 @@ "Super": "Super", "Super Effective Against":"sehr effektiv gegen", "Super Potion":"Supertrank", - "Take 3 Snapshots":"Mache 3 Fotos", - "Take 5 Snapshots of Evoli":"Mache 5 Fotos von Evoli", - "Take a Snapshot of Électrik-type Pokémon":"Mache ein Foto von einem Pokémon vom Typ Elektro", - "Take a Snapshot of Fighting-type Pokémon":"Mache ein Foto von einem Pokémon vom Typ Kampf", - "Take a Snapshot of Roche-type Pokémon":"Mache ein Foto von einem Pokémon vom Typ Gestein", - "Take a Snapshot":"Mache ein Foto", "template":"vorlage", "That is not a valid profile name":"Ungültiger Profilname", "That is not a valid profile number":"Ungültige Profilnummer", @@ -575,13 +351,6 @@ "Tracking details for":"Trackingdetails für", "Tracking list is long, but Hastebin is also down. ☹️ \nTracking list made into a file:":"Beobachtungsliste ist zu umfangreich für direkte Ausgabe. Sie wird stattdessen als Datei zur Verfügung gestellt:", "Tracking list is quite long. Have a look at":"Beobachtungsliste ist zu umfangreich für direkte Ausgabe. Siehe stattdessen:", - "Trade a Pokémon":"Tausche ein Pokémon", - "Transfer 10 Pokémon":"Verschicke 10 Pokémons", - "Transfer 2 Pokémon":"Verschicke 2 Pokémons", - "Transfer 3 Pokémon":"Verschicke 3 Pokémons", - "Transfer 4 Pokémon":"Verschicke 4 Pokémons", - "Transfer 5 Pokémon":"Verschicke 5 Pokémons", - "Transfer a Pokémon":"Verschicke ein Pokémon", "Trash Cloak":"Lumpenumhang", "Type":"Typ", "Ultra Ball":"Hyperball", @@ -607,16 +376,6 @@ "Use `{0}{1}` for more help":"Nutze `{0}{1}` für weitere Hilfe", "use `{0}{1}` to see what you are currently tracking": "benutze `{0}{1}` um anzuzeigen, was aktuell beobachtet wird.", "Use `{0}language` to set to one of {1}":"Nutze `{0}sprache` um einer der folgenden zu wählen: {1}", - "Use 10 Nanab to help catch Pokémon":"Benutze 10 Nanabbeeren zum Fangen von Pokémon", - "Use 10 Nanana to help catch Pokémon":"Benutze 10 Nanabbeeren zum Fangen von Pokémon", - "Use 2 berries to help catch Pokémon":"Benutze 2 Beeren zum Fangen von Pokémon", - "Use 5 berries to help catch Pokémon":"Benutze 5 Beeren zum Fangen von Pokémon", - "Use 5 Framby to help catch Pokémon":"Benutze 5 Himmihbeere zum Fangen von Pokémon", - "Use 5 Nanana to help catch Pokémon":"Benutze 5 Nanabbeeren zum Fangen von Pokémon", - "Use 7 berries to help catch Pokémon":"Benutze 7 Beeren zum Fangen von Pokémon", - "Use a item to evolve a Pokémon":"Benutze ein Item um ein Pokémon zu entwickeln", - "Use a super effective charged attack in 7 gym battles":"Benutze 7 supereffektive Ladeattacken im Arenakampf", - "Use a super effective charged attack in a gym battle":"Benutze eine supereffektive Ladeattacke im Arenakampf", "Valid commands are `{0}area list`, `{0}area add `, `{0}area remove `":"Gültige Befehle sind `{0}gebiet auflisten`, `{0}gebiet hinzufügen `, `{0}gebiet entfernen `, `{0}gebiet zeigen `, `{0}gebiet zeigen d500`", "Valid commands are `{0}community add `, `{0}community remove `, `{0}community clear `, `{0}community show `, `{0}community list`":"Gültige Befehle sind `{0}community hinzufügen `, `{0}community entfernen `, `{0}community leeren `, `{0}community anzeigen `, `{0}community auflisten`", "Valid commands are `{0}profile `, `{0}profile list`, `{0}profile add `, `{0}profile remove `, `{0}profile settime `":"Gültige Befehle sind `{0}profil `, `{0}profil auflisten`, `{0}profil hinzufügen `, `{0}profil entfernen `, `{0}profil zeit `", @@ -633,8 +392,7 @@ "Valid commands are e.g. `{0}script everything`, `{0}script pokemon raids eggs quest lures invasion nests gym`, `{0}script everything allprofiles`, `{0}script everything link`":"Gültige Befehle sind z.B. `{0}script alle`, `{0}script pokemon raids quest eier lockmodule invasion nester arena`, `{0}script alle alleprofile`, `{0}script alle link`", "Valid commands are e.g. `{0}track charmander`, `{0}track everything iv100`, `{0}track gible d500`":"Gültige Befehle sind z.B. `{0}beobachte glumanda`, `{0}beobachte alle iv100`, `{0}suivre kaumalat d500`", "Valid commands are e.g. `{0}untrack charmander`, `{0}untrack everything`":"Gültige Befehle sind z.B. `{0}unbeobachte glumanda`, `{0}unbeobachte alle`", - "valor":"wagemut", - "Valor":"Wagemut", + "valor":"Wagemut", "Very resistant to":"sehr resistent gegen", "Very vulnerable to":"sehr empfindlich bei", "Very-Rare":"sehr-rar", @@ -647,24 +405,12 @@ "Weather information is not yet available - wait a few minutes and try again":"Wetterinformationen sind noch nicht verfügbar - warte ein paar Minuten und versuchen es erneut", "Webhook added":"Webhook hinzugefügt", "webhook":"Webhook", + "weekday":"Wochentag", + "weekend":"Wochenende", "weight":"Gewicht", "West Sea":"Westliches Meer", "White":"Weiß", "Will start cleaning up to {0} messages back - do not re-run until finished":"Eine Säuberung mit bis zu {0} Nachrichten wird gestartet - bitte nicht erneut laufen lassen, bis beendet!", - "Win 2 gym battles":"Gewinne 2 Arenakämpfe", - "Win 2 raid battles":"Gewinne 2 Raidkämpfe", - "Win 3 gym battles":"Gewinne 3 Arenakämpfe", - "Win 3 raid battles":"Gewinne 3 Raidkämpfe", - "Win 4 gym battles":"Gewinne 4 Arenakämpfe", - "Win 4 raid battles":"Gewinne 4 Raidkämpfe", - "Win 5 gym battles":"Gewinne 5 Arenakämpfe", - "Win 5 raid battles":"Gewinne 5 Raidkämpfe", - "Win a gym battle":"Gewinne einen Arenakampf", - "Win a level 2 or higher raid":"Gewinne einen Level 2 Raid oder höher", - "Win a level 3 or higher raid":"Gewinne einen Level 3 Raid oder höher", - "Win a level 4 or higher raid":"Gewinne einen Level 4 Raid oder höher", - "Win a level 6 or higher raid":"Gewinne einen Mega-Raid", - "Win a raid battle":"Gewinne ein Raid", "windy":"Windig", "Winter 2020":"Winter 2020", "Winter":"Winter", diff --git a/package.json b/package.json index 8a7fd42fa..42e0cd3da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "poracle", - "version": "4.8.0", + "version": "4.8.2", "description": "Webhook processing and personalised discord|telegram alarms", "keywords": [ "poracle", @@ -32,8 +32,8 @@ "test": "node test/test" }, "dependencies": { - "@budibase/handlebars-helpers": "^0.11.8", - "async-mutex": "^0.4.0", + "@budibase/handlebars-helpers": "^0.13.1", + "async-mutex": "^0.5.0", "axios": "^1.4.0", "chokidar": "^3.5.3", "config": "^3.3.10", @@ -55,7 +55,7 @@ "moment-timezone": "^0.5.43", "mysql2": "^3.3.3", "node-cache": "^5.1.2", - "node-fetch": "^2.6.11", + "node-fetch-native": "^1.2.0", "node-geocoder": "^4.2.0", "node-schedule": "^2.1.0", "nodes2ts": "^3.0.0", @@ -68,7 +68,7 @@ "suncalc": "^1.9.0", "telegraf": "^4.12.0", "winston": "^3.9.0", - "winston-daily-rotate-file": "^4.7.1" + "winston-daily-rotate-file": "^5.0.0" }, "devDependencies": { "ajv": "^8.12.0", @@ -76,10 +76,10 @@ "eslint": "^8.41.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-plugin-import": "^2.27.0", - "husky": "^8.0.3", + "husky": "^9.0.11", "mocha": "^10.2.0" }, "engines": { - "node": ">=18.16.0" + "node": ">=20.9.0" } } diff --git a/src/app.js b/src/app.js index b06df49e8..c33e004f0 100644 --- a/src/app.js +++ b/src/app.js @@ -609,6 +609,8 @@ async function processOne(hook) { fastify.webhooks.info(`pokestop(${hook.type}) ${JSON.stringify(hook.message)}`) const incidentExpiration = hook.message.incident_expiration ?? hook.message.incident_expire_timestamp const lureExpiration = hook.message.lure_expiration + const incidentConfirmed = hook.message.confirmed + const incidentDisplayType = hook.message.display_type if (!lureExpiration && !incidentExpiration) { fastify.controllerLog.debug(`${hook.message.pokestop_id}: Pokestop received but no invasion or lure information, ignoring`) break @@ -629,7 +631,7 @@ async function processOne(hook) { } } - if (incidentExpiration && !config.general.disableInvasion) { + if (incidentExpiration && !config.general.disableInvasion && (!config.general.disableUnconfirmedInvasion || incidentDisplayType > '6')) { const cacheKey = `${hook.message.pokestop_id}I${incidentExpiration}` if (fastify.cache.get(cacheKey) && !hook.message.poracleTest) { @@ -644,6 +646,22 @@ async function processOne(hook) { await processHook(hook) } } + + if (incidentConfirmed && !config.general.disableInvasion && config.general.processConfirmedInvasionLineups) { + const cacheKey = `${hook.message.pokestop_id}I${incidentExpiration}H02` + + if (fastify.cache.get(cacheKey) && !hook.message.poracleTest) { + fastify.controllerLog.debug(`${hook.message.pokestop_id}: Invasion was sent again too soon, ignoring`) + } else { + // Set cache expiry to calculated invasion expiry time + 5 minutes to cope with near misses + const secondsRemaining = Math.max((incidentExpiration * 1000 - Date.now()) / 1000, 0) + 300 + + fastify.cache.set(cacheKey, 'x', secondsRemaining) + + hook.type = 'invasion' + await processHook(hook) + } + } break } case 'fort_update': { diff --git a/src/controllers/pokestop.js b/src/controllers/pokestop.js index 141d93f78..ff5d4cfcd 100644 --- a/src/controllers/pokestop.js +++ b/src/controllers/pokestop.js @@ -319,6 +319,25 @@ class Invasion extends Controller { data.gruntRewardsList = gruntRewardsList } } + // Lineup 100% of encounter + let gruntLineupformNormalised = '' + const gruntLineupList = { confirmed: true, monsters: [] } + if (data.lineup && data.lineup != 'null') { + data.lineup.forEach((lr) => { + const lineup = +lr.pokemon_id + const lineupForm = +lr.form + const lineupMonster = Object.values(this.GameData.monsters).find((mon) => mon.id === lineup && mon.form.id === lineupForm) + gruntLineupformNormalised = lineupMonster.form.name === 'Normal' ? '' : (`${translator.translate(lineupMonster.form.name)} `) + gruntLineupList.monsters.push({ + id: lineup, + formId: lineupForm, + name: translator.translate(lineupMonster.name), + formName: translator.translate(lineupMonster.form.name), + fullName: gruntLineupformNormalised + translator.translate(lineupMonster.name), + }) + }) + data.gruntLineupList = gruntLineupList + } } const view = { diff --git a/src/lib/configFetcher.js b/src/lib/configFetcher.js index cef0f04f1..708a51ec0 100644 --- a/src/lib/configFetcher.js +++ b/src/lib/configFetcher.js @@ -48,7 +48,7 @@ function getKnex(conf) { } function getScannerKnex(conf) { - if (conf.database.scannerType === 'mad' || conf.database.scannerType === 'rdm') { + if (conf.database.scannerType === 'mad' || conf.database.scannerType === 'rdm' || conf.database.scannerType === 'golbat') { return !Array.isArray(conf.database.scanner) ? [Knex({ client: 'mysql2', diff --git a/src/lib/discord/discordWebhookWorker.js b/src/lib/discord/discordWebhookWorker.js index 0862d0159..18c99af46 100644 --- a/src/lib/discord/discordWebhookWorker.js +++ b/src/lib/discord/discordWebhookWorker.js @@ -103,7 +103,7 @@ class DiscordWebhookWorker { delete data.message.embed } try { - const msgDeletionMs = ((data.tth.hours * 3600) + (data.tth.minutes * 60) + data.tth.seconds) * 1000 + const msgDeletionMs = ((data.tth.days * 86400) + (data.tth.hours * 3600) + (data.tth.minutes * 60) + data.tth.seconds) * 1000 const logReference = data.logReference ? data.logReference : 'Unknown' diff --git a/src/lib/poracleMessage/commands/fort.js b/src/lib/poracleMessage/commands/fort.js index 8547f9af0..dd8e79dd0 100644 --- a/src/lib/poracleMessage/commands/fort.js +++ b/src/lib/poracleMessage/commands/fort.js @@ -130,14 +130,14 @@ exports.run = async (client, msg, args, options) => { if ((alreadyPresent.length + updates.length + insert.length) > 50) { message = translator.translateFormat('I have made a lot of changes. See {0}{1} for details', util.prefix, translator.translate('tracked')) } else { - for (const lure of alreadyPresent) { - message = message.concat(translator.translate('Unchanged: '), await trackedCommand.fortUpdateRowText(client.config, translator, client.GameData, lure, client.scannerQuery), '\n') + for (const fort of alreadyPresent) { + message = message.concat(translator.translate('Unchanged: '), await trackedCommand.fortUpdateRowText(client.config, translator, client.GameData, fort, client.scannerQuery), '\n') } - for (const lure of updates) { - message = message.concat(translator.translate('Updated: '), await trackedCommand.fortUpdateRowText(client.config, translator, client.GameData, lure, client.scannerQuery), '\n') + for (const fort of updates) { + message = message.concat(translator.translate('Updated: '), await trackedCommand.fortUpdateRowText(client.config, translator, client.GameData, fort, client.scannerQuery), '\n') } - for (const lure of insert) { - message = message.concat(translator.translate('New: '), await trackedCommand.fortUpdateRowText(client.config, translator, client.GameData, lure, client.scannerQuery), '\n') + for (const fort of insert) { + message = message.concat(translator.translate('New: '), await trackedCommand.fortUpdateRowText(client.config, translator, client.GameData, fort, client.scannerQuery), '\n') } } diff --git a/src/lib/poracleMessage/commands/gym.js b/src/lib/poracleMessage/commands/gym.js index cdc9c82fd..a363f57d2 100644 --- a/src/lib/poracleMessage/commands/gym.js +++ b/src/lib/poracleMessage/commands/gym.js @@ -143,14 +143,14 @@ exports.run = async (client, msg, args, options) => { if ((alreadyPresent.length + updates.length + insert.length) > 50) { message = translator.translateFormat('I have made a lot of changes. See {0}{1} for details', util.prefix, translator.translate('tracked')) } else { - for (const lure of alreadyPresent) { - message = message.concat(translator.translate('Unchanged: '), await trackedCommand.gymRowText(client.config, translator, client.GameData, lure, client.scannerQuery), '\n') + for (const gym of alreadyPresent) { + message = message.concat(translator.translate('Unchanged: '), await trackedCommand.gymRowText(client.config, translator, client.GameData, gym, client.scannerQuery), '\n') } - for (const lure of updates) { - message = message.concat(translator.translate('Updated: '), await trackedCommand.gymRowText(client.config, translator, client.GameData, lure, client.scannerQuery), '\n') + for (const gym of updates) { + message = message.concat(translator.translate('Updated: '), await trackedCommand.gymRowText(client.config, translator, client.GameData, gym, client.scannerQuery), '\n') } - for (const lure of insert) { - message = message.concat(translator.translate('New: '), await trackedCommand.gymRowText(client.config, translator, client.GameData, lure, client.scannerQuery), '\n') + for (const gym of insert) { + message = message.concat(translator.translate('New: '), await trackedCommand.gymRowText(client.config, translator, client.GameData, gym, client.scannerQuery), '\n') } } diff --git a/src/lib/poracleMessage/commands/nest.js b/src/lib/poracleMessage/commands/nest.js index 1b280edd0..b85b44610 100644 --- a/src/lib/poracleMessage/commands/nest.js +++ b/src/lib/poracleMessage/commands/nest.js @@ -152,14 +152,14 @@ exports.run = async (client, msg, args, options) => { if ((alreadyPresent.length + updates.length + insert.length) > 50) { message = translator.translateFormat('I have made a lot of changes. See {0}{1} for details', util.prefix, translator.translate('tracked')) } else { - alreadyPresent.forEach((raid) => { - message = message.concat(translator.translate('Unchanged: '), trackedCommand.nestRowText(client.config, translator, client.GameData, raid), '\n') + alreadyPresent.forEach((nest) => { + message = message.concat(translator.translate('Unchanged: '), trackedCommand.nestRowText(client.config, translator, client.GameData, nest), '\n') }) - updates.forEach((raid) => { - message = message.concat(translator.translate('Updated: '), trackedCommand.nestRowText(client.config, translator, client.GameData, raid), '\n') + updates.forEach((nest) => { + message = message.concat(translator.translate('Updated: '), trackedCommand.nestRowText(client.config, translator, client.GameData, nest), '\n') }) - insert.forEach((raid) => { - message = message.concat(translator.translate('New: '), trackedCommand.nestRowText(client.config, translator, client.GameData, raid), '\n') + insert.forEach((nest) => { + message = message.concat(translator.translate('New: '), trackedCommand.nestRowText(client.config, translator, client.GameData, nest), '\n') }) } @@ -191,7 +191,7 @@ exports.run = async (client, msg, args, options) => { if (commandEverything) { const everythingResult = await client.query.deleteQuery('nests', { id: target.id, profile_no: currentProfileNo }) - client.log.info(`${logReference}: ${target.name} stopped tracking all raids`) + client.log.info(`${logReference}: ${target.name} stopped tracking all nests`) result += everythingResult } msg.reply( diff --git a/src/lib/scanner/golbatScanner.js b/src/lib/scanner/golbatScanner.js new file mode 100644 index 000000000..6f8025bed --- /dev/null +++ b/src/lib/scanner/golbatScanner.js @@ -0,0 +1,83 @@ +class GolbatScanner { + constructor(db) { + this.dbs = db + } + + // eslint-disable-next-line camelcase + async getGymName(gym_id) { + try { + for (const db of this.dbs) { + const row = await db.select('name') + .from('gym') + // eslint-disable-next-line camelcase + .where({ id: gym_id }) + .first() + if (row) return row.name + } + return null + } catch (err) { + throw { source: 'getGymName', error: err } + } + } + + // eslint-disable-next-line camelcase + async getPokestopName(pokestop_id) { + try { + for (const db of this.dbs) { + const row = await db.select('name') + .from('pokestop') + // eslint-disable-next-line camelcase + .where({ id: pokestop_id }) + .first() + if (row) return row.name + } + return null + } catch (err) { + throw { source: 'getPokestopName', error: err } + } + } + + async getStopData(aLat, aLon, bLat, bLon) { + const minLat = Math.min(aLat, bLat) + const minLon = Math.min(aLon, bLon) + const maxLat = Math.max(aLat, bLat) + const maxLon = Math.max(aLon, bLon) + + try { + const stopDetails = [] + for (const db of this.dbs) { + const pokestopRows = await db.select('lat', 'lon') + .from('pokestop') + .whereBetween('lat', [minLat, maxLat]) + .whereBetween('lon', [minLon, maxLon]) + .where({ deleted: 0 }) + .where({ enabled: 1 }) + const gymRows = await db.select('lat', 'lon', 'team_id', 'available_slots') + .from('gym') + .whereBetween('lat', [minLat, maxLat]) + .whereBetween('lon', [minLon, maxLon]) + .where({ deleted: 0 }) + .where({ enabled: 1 }) + + stopDetails.push(...pokestopRows.map((x) => ({ + latitude: x.lat, + longitude: x.lon, + type: 'stop', + }))) + + stopDetails.push(...gymRows.map((x) => ({ + latitude: x.lat, + longitude: x.lon, + type: 'gym', + teamId: x.team_id, + slots: x.available_slots, + }))) + } + return stopDetails + } catch (err) { + throw { source: 'getStopData', error: err } + } + } +} + +module.exports = GolbatScanner diff --git a/src/lib/scanner/scannerFactory.js b/src/lib/scanner/scannerFactory.js index 54a680c5b..2273c6560 100644 --- a/src/lib/scanner/scannerFactory.js +++ b/src/lib/scanner/scannerFactory.js @@ -1,10 +1,13 @@ const RdmScanner = require('./rdmScanner') +const GolbatScanner = require('./golbatScanner') const MadScanner = require('./madScanner') function createScanner(db, scannerType) { switch (scannerType) { case 'rdm': return new RdmScanner(db) + case 'golbat': + return new GolbatScanner(db) case 'mad': return new MadScanner(db) default: @@ -12,4 +15,4 @@ function createScanner(db, scannerType) { } } -module.exports = { createScanner } \ No newline at end of file +module.exports = { createScanner } diff --git a/src/util/generateData.js b/src/util/generateData.js index ba88828a7..d21ad32af 100644 --- a/src/util/generateData.js +++ b/src/util/generateData.js @@ -1,5 +1,5 @@ const fs = require('fs') -const Fetch = require('node-fetch') +const Fetch = require('node-fetch-native') const { log } = require('../lib/logger') diff --git a/src/util/koji.js b/src/util/koji.js index 2d8ddf724..d5a2ac80b 100644 --- a/src/util/koji.js +++ b/src/util/koji.js @@ -1,6 +1,6 @@ const fs = require('fs') const { resolve } = require('path') -const fetch = require('node-fetch') +const fetch = require('node-fetch-native') const config = require('config') const { log } = require('../lib/logger') diff --git a/src/util/util.json b/src/util/util.json index 564e3fbc0..b0ad9292d 100644 --- a/src/util/util.json +++ b/src/util/util.json @@ -547,7 +547,7 @@ "506": { "name": "Sparkly Lure", "emoji": "lure-sparkly", - "color": "FFFF00" + "color": "F9E418" } }, "genders": {