From ca1787c58eba74f4bd50edfbe1fba070b04177ae Mon Sep 17 00:00:00 2001 From: Florian Becker Date: Sat, 14 Sep 2019 12:32:58 +0200 Subject: [PATCH] Merge pull request #30 from Chefkeks/new-questbot --- .gitignore | 2 +- .htaccess | 11 + README.md | 499 +++- VERSION | 1 + access/.gitignore | 4 + commands/addstop.php | 152 + commands/crypto.php | 72 + commands/delete.php | 7 +- commands/deletestop.php | 42 + commands/dex.php | 25 + commands/event.php | 33 + commands/help.php | 76 +- commands/list.php | 8 +- commands/mods.php | 39 - commands/new.php | 5 +- commands/pokestop.php | 42 + commands/rocket.php | 48 + commands/rocketdelete.php | 67 + commands/rocketlist.php | 67 + commands/stopaddress.php | 94 + commands/stopgps.php | 101 + commands/stopname.php | 94 + commands/willow.php | 83 +- config.php.example | 54 - config/.gitignore | 6 + config/config.json.example | 45 + config/telegram.json.example | 5 + constants.php | 72 - core | 2 +- custom/.gitignore | 4 + index.php | 196 +- lang/help.json | 244 ++ lang/language.json | 1374 ++++++--- lang/pokemon_de.json | 804 ------ lang/pokemon_en.json | 804 ------ lang/pokemon_fr.json | 804 ------ lang/pokemon_ru.json | 804 ------ lang/quest-language.json | 332 --- lang/quest_action.json | 278 ++ lang/quest_event.json | 20 + lang/quest_type.json | 86 + lang/reward_type.json | 116 + logic.php | 4450 +++++++++++++++++++---------- mods/crypto.php | 66 + mods/exit.php | 10 +- mods/geo.php | 64 + mods/importal.php | 108 + mods/invasion_create.php | 98 + mods/invasion_delete.php | 74 + mods/invasion_edit.php | 51 + mods/invasion_geo.php | 80 + mods/invasion_save.php | 83 + mods/invasion_share.php | 57 + mods/mods.php | 54 - mods/mods_add.php | 40 - mods/mods_delete.php | 42 - mods/mods_list.php | 35 - mods/quest_create.php | 15 +- mods/quest_delete.php | 13 +- mods/quest_edit.php | 18 +- mods/quest_edit_qty_reward.php | 35 +- mods/quest_edit_reward.php | 33 +- mods/quest_edit_type.php | 70 +- mods/quest_geo.php | 21 +- mods/quest_save.php | 19 +- mods/quest_save_share.php | 17 +- mods/quest_share.php | 16 +- mods/stop_delete.php | 76 + mods/stop_details.php | 50 + mods/willow.php | 67 + mods/willow_encounter_add.php | 255 ++ mods/willow_encounter_delete.php | 99 + mods/willow_quest_add.php | 427 +++ mods/willow_quest_delete.php | 108 + mods/willow_quicklist_add.php | 136 + mods/willow_quicklist_delete.php | 102 + mods/willow_reward_add.php | 105 + mods/willow_reward_delete.php | 105 + mods/willow_start.php | 68 + sql/pokemon-quest-bot.sql | 17 +- sql/quests-rewards-encounters.sql | 287 +- webhook.html | 1 + 82 files changed, 8786 insertions(+), 6308 deletions(-) create mode 100644 .htaccess create mode 100644 VERSION create mode 100644 access/.gitignore create mode 100644 commands/addstop.php create mode 100644 commands/crypto.php mode change 100755 => 100644 commands/delete.php create mode 100644 commands/deletestop.php create mode 100644 commands/dex.php create mode 100644 commands/event.php mode change 100755 => 100644 commands/list.php delete mode 100644 commands/mods.php mode change 100755 => 100644 commands/new.php create mode 100644 commands/pokestop.php create mode 100644 commands/rocket.php create mode 100644 commands/rocketdelete.php create mode 100644 commands/rocketlist.php create mode 100644 commands/stopaddress.php create mode 100644 commands/stopgps.php create mode 100644 commands/stopname.php mode change 100755 => 100644 commands/willow.php delete mode 100755 config.php.example create mode 100644 config/.gitignore create mode 100644 config/config.json.example create mode 100644 config/telegram.json.example delete mode 100755 constants.php create mode 100644 custom/.gitignore mode change 100755 => 100644 index.php create mode 100644 lang/help.json delete mode 100644 lang/pokemon_de.json delete mode 100644 lang/pokemon_en.json delete mode 100644 lang/pokemon_fr.json delete mode 100644 lang/pokemon_ru.json delete mode 100644 lang/quest-language.json create mode 100644 lang/quest_action.json create mode 100644 lang/quest_event.json create mode 100644 lang/quest_type.json create mode 100644 lang/reward_type.json mode change 100755 => 100644 logic.php create mode 100644 mods/crypto.php create mode 100644 mods/geo.php create mode 100644 mods/importal.php create mode 100644 mods/invasion_create.php create mode 100644 mods/invasion_delete.php create mode 100644 mods/invasion_edit.php create mode 100644 mods/invasion_geo.php create mode 100644 mods/invasion_save.php create mode 100644 mods/invasion_share.php delete mode 100644 mods/mods.php delete mode 100644 mods/mods_add.php delete mode 100644 mods/mods_delete.php delete mode 100644 mods/mods_list.php mode change 100755 => 100644 mods/quest_share.php create mode 100644 mods/stop_delete.php create mode 100644 mods/stop_details.php create mode 100644 mods/willow.php create mode 100644 mods/willow_encounter_add.php create mode 100644 mods/willow_encounter_delete.php create mode 100644 mods/willow_quest_add.php create mode 100644 mods/willow_quest_delete.php create mode 100644 mods/willow_quicklist_add.php create mode 100644 mods/willow_quicklist_delete.php create mode 100644 mods/willow_reward_add.php create mode 100644 mods/willow_reward_delete.php create mode 100644 mods/willow_start.php create mode 120000 webhook.html diff --git a/.gitignore b/.gitignore index 094695b..89173b8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ /.idea -config.php +/lang/event.json diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..9db9cb9 --- /dev/null +++ b/.htaccess @@ -0,0 +1,11 @@ +# Block access to all dot files +RedirectMatch 404 /\..*$ + +# Block access to .git files and folders +RedirectMatch 404 /\.git + +# Block access to .json and .sql files +RedirectMatch 404 /*\.(json|sql)$ + +# Block access to specifc folders +RedirectMatch 404 /(access|config|custom|ddos|lang|sql|screens)/ diff --git a/README.md b/README.md index 8877ef0..a1dd256 100644 --- a/README.md +++ b/README.md @@ -26,12 +26,36 @@ The following apache packages need to be installed: - PHP_curl (ubuntu: php-curl) ## Git clone + +#### Core module inside bot folder + For git 2.13 and above: + `git clone --recurse-submodules https://github.com/florianbecker/PokemonQuestBot.git` If you're running an older version of git use the deprecated recursive command: + `git clone --recursive https://github.com/florianbecker/PokemonQuestBot.git` +#### Core module outside bot folder + +If you like to keep the core repo outside the bot folder so multiple bots can access the core (e.g. via the [PokemonBotBridge](https://github.com/florianbecker/PokemonBotBridge.git "PokemonBotBridge")) you can do the following: + +Clone the bot repo to e.g. `var/www/html`: + +`git clone https://github.com/florianbecker/PokemonQuestBot.git` + +Clone the core repo to e.g. `var/www/html`: + +`git clone https://github.com/florianbecker/php.core.telegram.git` + +Change to the bot folder and create a symlink to make core accessible for the bot: +``` +cd /var/www/html/PokemonQuestBot +rm -rf core/ +ln -sf /var/www/html/php.core.telegram core +``` + ## Bot token Start chat with https://t.me/BotFather and create bot token. @@ -55,29 +79,38 @@ Command quests, rewards and encounters: `mysql -u USERNAME -p DATABASENAME < que ## Config -Copy config.php.example to config.php and edit (values explained further). +Inside the config folder, copy the example config.json.example to your own config.json and edit the values (explained further). + +Don't forget to change the file permissions of your config file to 0600 (e.g. `chmod 0600 config.json`) afterwards. + +Some values are missing as the bot has default values. If you like to change those, you need to add and define them in your config.json file, e.g. `"DDOS_MAXIMUM":"10"`. -Enter the details for the database connection to the config.php file. +## Database connection + +Enter the details for the database connection to the config.json file via `DB_HOST`, `DB_NAME`, `DB_USER` and `DB_PASSWORD`. ## General config and log files Set `DEBUG` to true, to enable the debug logfile. -Set `CONFIG_LOGFILE` to the location of the logfile, e.g. /var/log/tg-bots/dev-quest-bot.log. Make sure to create the log dir, e.g. /var/log/tg-bots/ and set it writeable by webserver. +Set `DEBUG_LOGFILE` to the location of the logfile, e.g. /var/log/tg-bots/dev-raid-bot.log. Make sure to create the log dir, e.g. /var/log/tg-bots/ and set it writeable by webserver. -Set `CONFIG_HASH` to the hashed value of your bot token (preferably lowercase) using a hash generator, e.g. https://www.miniwebtool.com/sha512-hash-generator/ +Set `APIKEY_HASH` to the hashed value of your bot token (preferably lowercase) using a hash generator, e.g. https://www.miniwebtool.com/sha512-hash-generator/ -Set `DDOS_MAXIMUM` to the amount of callback queries each user is allowed to do each minute. If the amount is reached, e.g. 10, any further callback query is rejected by the DDOS check. +Set `DDOS_MAXIMUM` to the amount of callback queries each user is allowed to do each minute. If the amount is reached any further callback query is rejected by the DDOS check. Default value: 10. -Set `BRIDGE_MODE` to true when you're using the PokemonBotBridge. If you're not using the PokemonBotBridge keep the default false. PokemonBotBridge: https://github.com/florianbecker/PokemonBotBridge +Set `BRIDGE_MODE` to true when you're using the PokemonBotBridge. If you're not using the PokemonBotBridge the default value of false is used. PokemonBotBridge: https://github.com/florianbecker/PokemonBotBridge ## Proxy -Set `CURL_USEPROXY` to `true` in case you are running the bot behind a proxy server. +Set `CURL_USEPROXY` with a value of `true` in case you are running the bot behind a proxy server. -Set `CURL_PROXYSERVER` to the proxy server address and port. +Set `CURL_PROXYSERVER` to the proxy server address and port, for example: -Authentication against the proxy server by username and password is currently not supported! +``` +"CURL_USEPROXY":"false", +"CURL_PROXYSERVER":"http://your.proxyserver.com:8080", +``` ## Webhooks @@ -91,24 +124,24 @@ You can set several languages for the bot. Available languages are (A-Z): - FR (French) - NL (Dutch) -Set `LANGUAGE` for the prefered language the bot will answer users when they chat with them. Leave blank that the bot will answer in the users language. If the users language is not supported, e.g. ZH-CN (Chinese), the bot will always use EN (English) as fallback language. +Set `LANGUAGE_PRIVATE` for the prefered language the bot will answer users when they chat with them. Leave blank that the bot will answer in the users language. If the users language is not supported, e.g. ZH-CN (Chinese), the bot will always use EN (English) as fallback language. -Set `QUEST_LANGUAGE` to the prefered language for quests. +Set `LANGUAGE_PUBLIC` to the prefered language for shared quests. Default value: EN -So if you want to have the bot communication based on the users Telegram language, e.g. Dutch, and show the quest message in German for example: +So if you want to have the bot communication based on the users Telegram language, e.g. Russian, and show the shared quests in German for example: -`define('LANGUAGE', '');` -`define('QUEST_LANGUAGE', 'DE');` +``` +"LANGUAGE_PRIVATE":"", +"LANGUAGE_PUBLIC":"DE", +``` ## Timezone and Google maps API Set `TIMEZONE` to the timezone you wish to use for the bot. Predefined value from the example config is "Europe/Berlin". -Optionally you can you use Google maps API to lookup addresses of gyms based on latitude and longitude - -Therefore get a Google maps API key and set it as `GOOGLE_API_KEY` in your config. +Optionally you can you use Google maps API to lookup addresses of gyms based on latitude and longitude. Therefore get a Google maps API key. -To get a new API key, navigate to https://console.developers.google.com/apis/credentials and create a new API project, e.g. PokemonQuestBot +To get a new API key, navigate to https://console.developers.google.com/apis/credentials and create a new API project, e.g. PokemonQuestBot Once the project is created select "API key" from the "Create credentials" dropdown menu - a new API key is created. @@ -124,37 +157,8 @@ https://console.developers.google.com/apis/library/geocoding-backend.googleapis. Finally check the dashboard again and make sure Google Maps Geocoding API and Google Maps Time Zone API are listed as enabled services. -## Quest sharing - -You can share quests with any chat in Telegram via a share button. - -Sharing quests can be restricted, so only moderators or users or both can be allowed to share a quest. - -Therefore it is possible, via a comma-separated list, to specify the chats the quests can be shared with. - -For the ID of a chat either forward a message from the chat to a bot like @RawDataBot or search the web for another method ;) - -A few examples: - -#### Restrict sharing for moderators and users to chats -100111222333 and -100444555666 - -`define('SHARE_MODERATORS', false);` - -`define('SHARE_USERS', false);` - -`define('SHARE_CHATS', '-100111222333,-100444555666');` +Set `MAPS_LOOKUP` to true and put the API key in `MAPS_API_KEY` in your config. -#### Allow moderators to share with any chat, restrict sharing for users to chat -100111222333 - -`define('SHARE_MODERATORS', true);` - -`define('SHARE_USERS', false);` - -`define('SHARE_CHATS', '-100111222333');` - -To allow quick(er) sharing of quests with a pokemon encounter as reward, the option `SHARE_QUICK` can be used. The quests are saved and shared in one step instead two separate steps: - -`define('SHARE_QUICK', '-100111222333');` ## Quest creation @@ -168,7 +172,7 @@ Set `QUEST_STOPS_RADIUS` to the amount in meters the bot will search for pokesto Set `QUEST_HIDE_REWARDS` to true to hide specific reward types, e.g. berries or revives. Specify the reward types you want to hide in `QUEST_HIDDEN_REWARDS` separated by comma. -Example to hide pokeballs, berries, potions and revives: `define('QUEST_HIDDEN_REWARDS', '2,7,10,12');` +Example to hide pokeballs, berries, potions and revives: `"QUEST_HIDDEN_REWARDS":"2,7,10,12"` Every ID/number for all the available reward types: @@ -194,6 +198,61 @@ Every ID/number for all the available reward types: | 18 | Metal Coat | | 19 | Up-Grade | + +## Quest sharing + +You can share quests with any chat in Telegram via a share button. + +Sharing quests can be restricted, so only specific chats/users can be allowed to share a quest - take a look at the permission system! + +With a predefined list you can specify the chats which should appear as buttons for sharing quests. + +For the ID of a chat either forward a message from the chat to a bot like @RawDataBot, @getidsbot or search the web for another method ;) + +Example: + +#### Predefine sharing to the chats -100111222333 and -100444555666 + +`"SHARE_CHATS":"-100111222333,-100444555666"` + + +## Invasion creation + +There are several options to customize the creation of Team Rocket invasions: + +Set `INVASION_VIA_LOCATION` to true to allow invasion creation from a location shared with the bot. + +Set `INVASION_LOCATION` to true to send back the location as message in addition to the invasion. + +Set `INVASION_STOPS_RADIUS` to the amount in meters the bot will search for pokestops around the location shared with the bot. + +Set `INVASION_DURATION_SHORT` to the amount of time in minutes how long at least the invasion is probably at the pokestop. + +Set `INVASION_DURATION_LONG` to the amount of time in minutes how long idially the invasion is probably at the pokestop. + +Set `INVASION_DURATION_EVENT` to the amount of time in minutes how long invasions will be at pokestops during an event. This will give the users the options to choose between the event invasion time and the shortest possible invasion time in 5 minute steps. + +## Invasion sharing + +You can share invasions with any chat in Telegram via a share button. + +Sharing invasions can be restricted, so only specific chats/users can be allowed to share an invasion - take a look at the permission system! + +With a predefined list you can specify the chats which should appear as buttons for sharing invasions. + +For the ID of a chat either forward a message from the chat to a bot like @RawDataBot, @getidsbot or search the web for another method ;) + +Example: + +#### Predefine sharing to the chats -100111222333 and -100444555666 + +`"SHARE_INVASIONS":"-100111222333,-100444555666"` + + +## Portal Import + +Set `PORTAL_IMPORT` to `true` to enable the possibility to import portals from Telegram Ingress Bots. + ## Cleanup The bot features an automatic cleanup of telegram messages as well as cleanup of the database (quests tables). @@ -206,86 +265,202 @@ Activate the cleanup of telegram messages and/or the database for quests by sett The cleanup process will automatically detect old quests which are not from the present day. -Finally set up a cronjob to trigger the cleanup. You can also trigger telegram / database cleanup per cronjob: For no cleanup use 0, for cleanup use 1 and to use your config file use 2 or leave "telegram" and "database" out of the request data array. Please make sure to always specify the cleanup type which needs to be `quest`. +Finally set up a cronjob to trigger the cleanup. You can also trigger telegram / database cleanup per cronjob: For no cleanup use 0, for cleanup use 1 and to use your config file use 2 or leave "telegram" and "database" out of the request data array. A few examples for quests - make sure to replace the URL with yours: -#### Cronjob using cleanup values from config.php for quests: Just the secret without telegram/database OR telegram = 2 and database = 2 +#### Cronjob using cleanup values from config.json for quests: Just the secret without telegram/database OR telegram = 2 and database = 2 -`curl -k -d '{"cleanup":{"type":"quest","secret":"your-cleanup-secret/passphrase"}}' https://localhost/index.php?apikey=111111111:AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPP123` +`curl -k -d '{"cleanup":{"secret":"your-cleanup-secret/passphrase"}}' https://localhost/index.php?apikey=111111111:AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPP123` OR -`curl -k -d '{"cleanup":{"type":"quest","secret":"your-cleanup-secret/passphrase","telegram":"2","database":"2"}}' https://localhost/index.php?apikey=111111111:AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPP123` +`curl -k -d '{"cleanup":{"secret":"your-cleanup-secret/passphrase","telegram":"2","database":"2"}}' https://localhost/index.php?apikey=111111111:AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPP123` #### Cronjob to clean up telegram quest messages only: telegram = 1 and database = 0 -`curl -k -d '{"cleanup":{"type":"quest","secret":"your-cleanup-secret/passphrase","telegram":"1","database":"0"}}' https://localhost/index.php?apikey=111111111:AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPP123` +`curl -k -d '{"cleanup":{"secret":"your-cleanup-secret/passphrase","telegram":"1","database":"0"}}' https://localhost/index.php?apikey=111111111:AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPP123` #### Cronjob to clean up database and telegram quest messages: telegram = 1 and database = 1 -`curl -k -d '{"cleanup":{"type":"quest","secret":"your-cleanup-secret/passphrase","telegram":"1","database":"1"}}' https://localhost/index.php?apikey=111111111:AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPP123` +`curl -k -d '{"cleanup":{"secret":"your-cleanup-secret/passphrase","telegram":"1","database":"1"}}' https://localhost/index.php?apikey=111111111:AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPP123` # Access permissions ## Public access -When no telegram id, group, supergroup or channel is specified in `BOT_ADMINS` and/or `BOT_ACCESS`, the bot will allow everyone to use it (public access). +When no telegram id, group, supergroup or channel is specified in `BOT_ADMINS` the bot will allow everyone to use it (public access). + +Example for public access: `"BOT_ADMINS":""` + +## Access and permissions + +The `MAINTAINER_ID` is not able to access the bot nor has any permissions as that id is only contacted in case of errors and issues with the bot configuration. -Example for public access: `define('BOT_ACCESS', '');` +The `BOT_ADMINS` have all permissions and can use any feature of the bot. -## Restricted access +Telegram Users have no access to bot functions (unless you configured it). -With BOT_ADMINS and BOT_ACCESS being used to restrict access, there are several access roles / types. When you do not configure BOT_ACCESS, everyone will have access to your bot (public access). +In order to allow telegram chats to access the bot and use commands/features, you need to create an access file. -Set `BOT_ADMINS` and `BOT_ACCESS` to id (-100123456789) of one or multiple by comma separated individual telegram chat names/ids, groups, supergroups or channels. +It does not matter if a chat is a user, group, supergroup or channel - any kind of chat is supported as every chat has a chat id! -Please note, when you're setting groups, supergroups or channels only administrators (not members!) from these chats will gain access to the bot! So make sure this requirement is fulfilled or add their individual telegram usernames/ids instead. +Those access files need to be placed under the subdirectory 'access' and follow a special name scheme. -Example for restricted access: -`define('BOT_ADMINS', '111222333,111555999');` +| Chat type | User role | Name of the access file | Example | +|-------------------------------|----------------|-----------------------------------|---------------------------| +| User | - | `accessCHAT_ID` | `access111555999` | +| | | | | +| Group, Supergroup, Channel | Any role | `accessCHAT_ID` | `access-100224466889` | +| | Creator | `creatorCHAT_ID` | `creator-100224466889` | +| | Admin | `adminsCHAT_ID` | `admins-100224466889` | +| | Member | `membersCHAT_ID` | `members-100224466889` | +| | Restricted | `restrictedCHAT_ID` | `restricted-100224466889` | +| | Kicked | `kickedCHAT_ID` | `kicked-100224466889` | -`define('BOT_ACCESS', '111222333,-100224466889,-100112233445,111555999');` +As you can see in the table, you can define different permissions for the creator, the admins and the members of a group, supergroup and channel. -To allow members from groups, supergroups or channels: +You can also create just one access file, so any user has the same permission regardless of their role in the chat. But this is not recommended (see important note below!). -Set `BOT_ALLOW_MEMBERS` to true, so members of a Telegram chat in addition to the administrators are considered during the access check and allowed to use the bot if they are a member of the respective chat. +**Important: Any role means any role - so in addition to roles 'creator', 'administrator' or 'member' this will also grant 'restricted' and 'kicked' users to access the bot with the defined permissions! -Set `BOT_ALLOW_MEMBERS_CHAT` to the chats you wish to allow member access for. +To exclude 'restricted' and 'kicked' users when using an access file for any role (e.g. `access-100224466889`) you can add the permissions `ignore-restricted` and `ignore-kicked` to the access file! -Example to allow members of chat groups -100112233445 and -100224466889: -`define('BOT_ALLOW_MEMBERS', true);` +User with the role 'left' are automatically receiving an 'Access denied' from the bot as they willingly have choosen to leave the chat through which they got access to the bot!** -`define('BOT_ALLOW_MEMBERS_CHATS', '-100112233445, -100224466889');` +Every access file allows the access for a particular chat and must include the permissons which should be granted to that chat. +To differ between all those access file you can add any kind of comment to the filename of the access file itself. Just make sure to not use a number (0-9) right after the chat id! -## Access overview +Consider you have 4 channels. One for each district of your town: east, west, south and north. So you could name the access file for example like this: -With your `MAINTAINER_ID` and as a member of `BOT_ADMINS` you have the permissions to do anything. **For performance improvements, it's recommended to add the MAINTAINER and all members of BOT_ADMINS as moderator via /mods command!** +``` +access-100333444555 South-Channel +access-100444555666+NorthernChannel +admins-100222333444_West-District +creator-100111222333-Channel-East-District +creator-100444555666+NorthernChannel +members-100111222333-Channel-East-District +members-100222333444_West-District +``` -As a member of `BOT_ACCESS` you can create and share quests. `BOT_ACCESS` members who are moderators too, can delete their own quests and also quests from other users. Note that members of `BOT_ACCESS` are not allowed to see the available quests in DB by ID, only the `MAINTAINER_ID` and the `BOT_ADMINS` have the right to do so. +## Permissions overview -Telegram Users can only see on shared quests, but have no access to other bot functions (unless you configured it for public access). +The following table shows the permissions you need to write into an access file (last column) to grant permissions to chats. +In an access file it is **One permission per line** - so not separated by space, comma or any other char! -| Access: | | | MAINTAINER_ID | BOT_ADMINS | BOT_ACCESS | BOT_ACCESS | Telegram | -|-----------|------------|----------------------------------|---------------|------------|------------|------------|----------| -| Database: | | | | | Moderator | User | User | -| | **Area** | **Action and /command** | | | | | | -| | | | | | | | | -| | Moderators | List `/mods` | Yes | Yes | | | | -| | | Add `/mods` | Yes | Yes | | | | -| | | Delete `/mods` | Yes | Yes | | | | -| | | | | | | | | -| | Quests | Create `/start` or `/new` | Yes | Yes | Yes | Yes | | -| | | List `/list` | Yes | Yes | Yes | Yes | | -| | | Delete ALL quests `/delete` | Yes | Yes | | | | -| | | Delete OWN quests `/delete` | Yes | Yes | Yes | Yes | | -| | | Quests in DB by ID `/willow` | Yes | Yes | | | | -| | | | | | | | | -| | Help | Show `/help` | Yes | Yes | Yes | Yes | | +A few examples for access files can be found below the permission overview table. +| Access | **Action and /command** | Permission inside access file | +|------------|--------------------------------------------------------------------|--------------------------------------------| +| Bot | Access the bot itself | `access-bot` | +| | Deny access to restricted group/supergroup/channel members | `ignore-restricted` | +| | Deny access to kicked group/supergroup/channel members | `ignore-kicked` | +| | | | +| Quest | Create quests `/start`, `/new` | `create` | +| | List all quests `/list` | `list` | +| | Delete OWN quests `/delete` | `delete-own` | +| | Delete ALL quests `/delete` | `delete-all` | +| | | | +| Invasion | Create invasions `/rocket` | `invasion-create` | +| | List all invasions `/rocketlist` | `invasion-list` | +| | Delete OWN invasions `/rocketdelete` | `invasion-delete-own` | +| | Delete ALL invasions `/rocketdelete` | `invasion-delete-all` | +| | Add comments to invasions `/crypto` | `invasion-create` | +| | | | +| Sharing | Share OWN created quests to predefined chats 'SHARE_CHATS' | `share-own` | +| | Share ALL created quests to predefined chats 'SHARE_CHATS' | `share-all` | +| | Share OWN created quests to any chat | `share-own` and `share-any-chat` | +| | Share ALL created quests to any chat | `share-all` and `share-any-chat` | +| | Share OWN created invasions to predefined chats 'SHARE_INVASIONS' | `invasion-share-own` | +| | Share ALL created invasions to predefined chats 'SHARE_INVASIONS' | `invasion-share-all` | +| | Share OWN created invasions to any chat | `invasion-share-own` and `share-any-chat` | +| | Share ALL created invasions to any chat | `invasion-share-all` and `share-any-chat` | +| | | | +| Pokestop | Get pokestop details `/pokestop` | `pokestop-details` | +| | Edit pokestop name `/stopname` | `pokestop-name` | +| | Edit pokestop address `/stopaddress` | `pokestop-address` | +| | Edit pokestop gps coordinates `/stopgps` | `pokestop-gps` | +| | Add pokestop `/addstop` | `pokestop-add` | +| | Delete pokestop `/deletestop` | `pokestop-delete` | +| | | | +| Portal | Import portals via inline search from other bots | `portal-import` | +| | | | +| Event | Set current quest event name `/event` | `event` | +| | | | +| Dex | Get pokemon id by pokemon name `/dex` | `dex` | +| | | | +| Willow | Manage quests, rewards, encounters and quicklist `/willow` | `willow` | +| | | | +| Help | Show help `/help` | `help` | + + +#### Example: Allow the user 111555999 to create quests and share them to the predefined chat list + +Access file: `access\access111555999` + +Content of the access file, so the actual permissions: +``` +access-bot +create +share-own +``` + +#### Example: Allow the creator and the admins of the channel -100224466889 to create quests as well as sharing quests created by their own or others to the predefined chat list or any other chat + +Access file for the creator: `access\creator-100224466889` + +Access file for the admins: `access\admins-100224466889` + +Important: The minus `-` in front of the actual chat id must be part of the name as it's part of the chat id! + +Content of the access files, so the actual permissions: +``` +access-bot +create +share-all +share-own +share-any-chat +``` + +# Customization + +The bot allows you to customize things and therefore has a folder 'custom' for your customizations. + +## Custom icons + +In case you do not like some of the predefined icons and might like to change them to other/own icons: +- Create a file named `constants.php` in the custom folder +- Lookup the icon definitions you'd like to change in either the core or bot constants.php (`core/bot/constants.php` and `constants.php`) +- Define your own icons in your custom constants.php +- For example to change the yellow exclamation mark icon to a red exclamation mark put the following in your `custom/constants.php`: + +` sql/quests-rewards-encounters.sql` +Export command: `mysqldump -u USERNAME -p --skip-extended-insert --skip-comments DATABASENAME quick_questlist questlist encounterlist rewardlist > sql/quests-rewards-encounters.sql` diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..3716cb7 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.9.256.3 diff --git a/access/.gitignore b/access/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/access/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/commands/addstop.php b/commands/addstop.php new file mode 100644 index 0000000..c7393a9 --- /dev/null +++ b/commands/addstop.php @@ -0,0 +1,152 @@ +fetch_row(); + + // Pokestop already in database or new + if (empty($row['0'])) { + // insert stop in table. + debug_log('Pokestop not found in database pokestop list! Inserting pokestop "' . $stop_name . '" now.'); + $query = ' + INSERT INTO pokestops (pokestop_name, lat, lon, address) + VALUES (:stop_name, :lat, :lon, :address) + '; + $msg = getTranslation('pokestop_added'); + } else { + // Get stop by temporary name. + $stop = get_pokestop_by_telegram_id($stop_name); + + // If stop is already in the database, make sure no quest is shared before continuing! + if($stop) { + debug_log('Pokestop found in the database! Checking for shared quest now!'); + $stop_id = $stop['id']; + + // Check for duplicate quest + $duplicate_id = 0; + $duplicate_id = quest_duplication_check($stop_id); + + // Continue with stop creation + if($duplicate_id > 0) { + debug_log('Quest is shared for that stop!'); + debug_log('Tell user to update the stop name and exit!'); + + // Show message that a quest is shared for that pokestop. + $quest_id = $duplicate_id; + $quest = get_quest($quest_id); + + // Build message. + $msg = EMOJI_WARN . SP . getTranslation('quest_already_exists') . SP . EMOJI_WARN . CR . get_formatted_quest($quest); + + // Tell user to update the stop name first to create another pokestop + $msg .= getTranslation('pokestopname_then_location'); + $keys = []; + + // Send message. + send_message($update['message']['chat']['id'], $msg, $keys, ['reply_markup' => ['selective' => true, 'one_time_keyboard' => true]]); + + exit(); + } else { + debug_log('No shared quest found! Continuing now ...'); + } + } else { + // Set stop_id to 0 + $stop_id = 0; + debug_log('No pokestop found in the database! Continuing now ...'); + } + + // Update pokestops table to reflect pokestop changes. + debug_log('Pokestop found in database pokestops list! Updating pokestop "' . $stop_name . '" now.'); + $query = ' + UPDATE pokestops + SET lat = :lat, + lon = :lon, + address = :address + WHERE pokestop_name = :stop_name + '; + $msg = getTranslation('pokestop_updated'); + } + + $statement = $dbh->prepare($query); + $statement->bindValue(':stop_name', $stop_name, PDO::PARAM_STR); + $statement->bindValue(':lat', $lat, PDO::PARAM_STR); + $statement->bindValue(':lon', $lon, PDO::PARAM_STR); + $statement->bindValue(':address', $address, PDO::PARAM_STR); + $statement->execute(); + + // Get last insert id. + if (empty($row['0'])) { + $stop_id = $dbh->lastInsertId(); + } + + // Stop details. + if($stop_id > 0) { + $stop = get_pokestop($stop_id); + $msg .= CR . CR . get_pokestop_details($stop); + } +} catch (PDOException $exception) { + + error_log($exception->getMessage()); + $dbh = null; + exit(); +} + +// Set keys. +$keys = []; + +// Send the message. +send_message($update['message']['chat']['id'], $msg, $keys, ['disable_web_page_preview' => 'true']); + +?> diff --git a/commands/crypto.php b/commands/crypto.php new file mode 100644 index 0000000..6d7ec3c --- /dev/null +++ b/commands/crypto.php @@ -0,0 +1,72 @@ + UTC_TIMESTAMP() + ORDER BY invasions.id + " + ); + +// Init empty keys array. +$keys = array(); + +// Add key for quest +while ($invasions = $rs->fetch_assoc()) { + // Pokestop name. + $text = empty($invasions['pokestop_name']) ? getTranslation('unnamed_pokestop') : $invasions['pokestop_name']; + + // Add buttons to delete invasions. + $keys[] = array( + 'text' => $text, + 'callback_data' => $invasions['id'] . ':crypto:' . $comment + ); + +} + +// Keys array received? +if ($keys) { + // Set message. + $msg = '' . getTranslation('add_this_info_to_invasion') . ''; + $msg .= CR . CR . getTranslation('info') . ': ' . '' . $comment . ''; + + // Add abort navigation key. + $keys = inline_key_array($keys, 2); + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; +} else { + // Set message. + $msg = '' . getTranslation('no_invasions_currently') . ''; + + // Set empty keys. + $keys = []; +} + +// Send message. +send_message($update['message']['chat']['id'], $msg, $keys, ['reply_markup' => ['selective' => true, 'one_time_keyboard' => true]]); + +exit(); diff --git a/commands/delete.php b/commands/delete.php old mode 100755 new mode 100644 index ab6dbd1..6e763cd --- a/commands/delete.php +++ b/commands/delete.php @@ -7,13 +7,13 @@ //debug_log($data); // Check access. -bot_access_check($update, BOT_ACCESS); +bot_access_check($update, 'access-bot'); // Get all quests of the day from database. $rs = my_query( " SELECT quests.*, - questlist.quest_type, questlist.quest_quantity, questlist.quest_action, + questlist.quest_event, questlist.quest_type, questlist.quest_quantity, questlist.quest_action, questlist.quest_pokedex_ids, questlist.quest_poketypes, rewardlist.reward_type, rewardlist.reward_quantity, pokestops.pokestop_name, pokestops.lat, pokestops.lon, pokestops.address FROM quests @@ -23,7 +23,8 @@ ON quests.quest_id = questlist.id LEFT JOIN rewardlist ON quests.reward_id = rewardlist.id - WHERE quest_date = CURDATE() + WHERE quest_date > UTC_DATE() + AND quest_date < UTC_DATE() + INTERVAL 1 DAY ORDER BY quests.id " ); diff --git a/commands/deletestop.php b/commands/deletestop.php new file mode 100644 index 0000000..0c6378a --- /dev/null +++ b/commands/deletestop.php @@ -0,0 +1,42 @@ +' . getTranslation('select_pokestop_to_delete') . ''; + + // Add abort navigation key. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; +} else { + // Set message. + $msg = '' . getTranslation('pokestops_not_found') . ''; + + // Set empty keys. + $keys = []; +} + +// Send message. +send_message($update['message']['chat']['id'], $msg, $keys, ['reply_markup' => ['selective' => true, 'one_time_keyboard' => true]]); + +exit(); diff --git a/commands/dex.php b/commands/dex.php new file mode 100644 index 0000000..bfc1db5 --- /dev/null +++ b/commands/dex.php @@ -0,0 +1,25 @@ +' . getTranslation('pokemon') . ':' . CR; +$msg .= get_dex_entry($pokemon); + +// Send message. +send_message($update['message']['chat']['id'], $msg, $keys, ['reply_markup' => ['selective' => true, 'one_time_keyboard' => true]]); + +exit(); diff --git a/commands/event.php b/commands/event.php new file mode 100644 index 0000000..9182e1a --- /dev/null +++ b/commands/event.php @@ -0,0 +1,33 @@ +' . $input . '' . CR; + debug_log('Current event:' . $input); + +// Tell user how to set config and what is allowed to be set by config. +} else { + $msg = '' . getTranslation('event_name_missing') . ''; + debug_log('Unsupported request for submitting an event!'); +} + +// Send message. +sendMessage($update['message']['chat']['id'], $msg); + +?> diff --git a/commands/help.php b/commands/help.php index bd55b65..d19c9c1 100644 --- a/commands/help.php +++ b/commands/help.php @@ -1,15 +1,67 @@ EN Guide on how to create a raid poll raid bot -1) make sure the raid hasn\'t been posted yet in the chat -2) check how much time is left for the raid -3) open new PM with @RaidPokemonBot -4) send your location to the bot (make sure you send the location of where the gym is located) -5) choose the type of raid boss and the time left -6) to ensure an easier way to locate the gym in game/chat, it\'s recommended to use the bot function /gym (name of the gym and/or description of it) -7) press share and choose yourRaid channel -8) wait until the option with the boss name appears and select it -'; -$msg = 'This is a private bot.'; // temp +// Display help for each permission +if($access && (is_file(ROOT_PATH . '/access/' . $access) || $access == 'BOT_ADMINS')) { + // Get permissions from file. + if($access == 'BOT_ADMINS') { + $permissions = array(); + $permissions[] = 'access-bot'; + $permissions[] = 'create'; + $permissions[] = 'list'; + $permissions[] = 'delete-all'; + $permissions[] = 'invasion-create'; + $permissions[] = 'invasion-list'; + $permissions[] = 'invasion-delete-all'; + $permissions[] = 'pokestop-details'; + $permissions[] = 'pokestop-name'; + $permissions[] = 'pokestop-address'; + $permissions[] = 'pokestop-gps'; + $permissions[] = 'pokestop-add'; + $permissions[] = 'pokestop-delete'; + $permissions[] = 'portal-import'; + $permissions[] = 'event'; + $permissions[] = 'dex'; + $permissions[] = 'willow'; + $permissions[] = 'config-get'; + $permissions[] = 'config-set'; + $permissions[] = 'help'; + } else { + // Get permissions from file. + $permissions = file(ROOT_PATH . '/access/' . $access, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + } + + // Write to log. + debug_log($permissions,'ACCESS: '); + + // Show help header. + debug_log('Showing help to user now'); + $msg = '' . getTranslation('personal_help') . '' . CR . CR; + + // Quest and invasion via location? + if(QUEST_VIA_LOCATION == true && INVASION_VIA_LOCATION == true) { + $msg .= EMOJI_CLIPPY . SP . getTranslation('help_create_via_location') . CR . CR; + // Quest via location? + } else if(QUEST_VIA_LOCATION == true) { + $msg .= EMOJI_CLIPPY . SP . getTranslation('help_quest_via_location') . CR . CR; + // Invasion via location? + } else if(INVASION_VIA_LOCATION == true) { + $msg .= EMOJI_CLIPPY . SP . getTranslation('help_invasion_via_location') . CR . CR; + } + + // Show help. + foreach($permissions as $id => $p) { + if($p == 'access-bot' || strpos($p, 'share-') === 0 || strpos($p, 'invasion-share-') === 0 || strpos($p, 'ignore-') === 0) continue; + $msg .= getTranslation('help_' . $p) . CR . CR; + } +// No help for the user. +} else { + $msg = getTranslation('bot_access_denied'); +} + +// Send message. sendMessage($update['message']['from']['id'], $msg); + +?> + diff --git a/commands/list.php b/commands/list.php old mode 100755 new mode 100644 index 8cd4624..58b839d --- a/commands/list.php +++ b/commands/list.php @@ -6,11 +6,14 @@ //debug_log($update); //debug_log($data); +// Check access. +bot_access_check($update, 'list'); + // Get all quests of the day from database. $rs = my_query( " SELECT quests.*, - questlist.quest_type, questlist.quest_quantity, questlist.quest_action, + questlist.quest_event, questlist.quest_type, questlist.quest_quantity, questlist.quest_action, questlist.quest_pokedex_ids, questlist.quest_poketypes, rewardlist.reward_type, rewardlist.reward_quantity, pokestops.pokestop_name, pokestops.lat, pokestops.lon, pokestops.address FROM quests @@ -20,7 +23,8 @@ ON quests.quest_id = questlist.id LEFT JOIN rewardlist ON quests.reward_id = rewardlist.id - WHERE quest_date = CURDATE() + WHERE quest_date > UTC_DATE() + AND quest_date < UTC_DATE() + INTERVAL 1 DAY ORDER BY quests.id " ); diff --git a/commands/mods.php b/commands/mods.php deleted file mode 100644 index accdc96..0000000 --- a/commands/mods.php +++ /dev/null @@ -1,39 +0,0 @@ - getTranslation('list'), - 'callback_data' => '0:mods:list' - ], - [ - 'text' => getTranslation('add'), - 'callback_data' => '0:mods:add' - ], - [ - 'text' => getTranslation('delete'), - 'callback_data' => '0:mods:delete' - ] - ] -]; - -// Set message. -$msg = '' . getTranslation('mods_list_add_delete') . ':'; - -// Send message. -send_message($update['message']['chat']['id'], $msg, $keys, ['reply_markup' => ['selective' => true, 'one_time_keyboard' => true]]); - -exit; diff --git a/commands/new.php b/commands/new.php old mode 100755 new mode 100644 index 6a80d02..0a83887 --- a/commands/new.php +++ b/commands/new.php @@ -6,6 +6,9 @@ //debug_log($update); //debug_log($data); +// Check access. +bot_access_check($update, 'create'); + // Get pokestops by name. // Trim away everything before the first space $searchterm = $update['message']['text']; @@ -19,7 +22,7 @@ // Set message. $msg = '' . getTranslation('quest_by_pokestop') . ''; - // Add back navigation key. + // Add abort navigation key. $nav_keys = []; $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); diff --git a/commands/pokestop.php b/commands/pokestop.php new file mode 100644 index 0000000..5c58a51 --- /dev/null +++ b/commands/pokestop.php @@ -0,0 +1,42 @@ +' . getTranslation('select_pokestop_for_details') . ''; + + // Add abort navigation key. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; +} else { + // Set message. + $msg = '' . getTranslation('pokestops_not_found') . ''; + + // Set empty keys. + $keys = []; +} + +// Send message. +send_message($update['message']['chat']['id'], $msg, $keys, ['reply_markup' => ['selective' => true, 'one_time_keyboard' => true]]); + +exit(); diff --git a/commands/rocket.php b/commands/rocket.php new file mode 100644 index 0000000..bbe52f2 --- /dev/null +++ b/commands/rocket.php @@ -0,0 +1,48 @@ +' . getTranslation('invasion_by_pokestop') . ''; + + // Add abort navigation key. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; +} else if ($keys == false) { + // Set message. + $msg = '' . getTranslation('pokestops_not_found') . '' . CR . CR . getTranslation('pokestops_not_found_command_text') . SP . getTranslation('pokestops_not_found_command_example'); + + // Set empty keys. + $keys = []; +} else { + // Set message. + $msg = '' . getTranslation('pokestops_not_found') . ''; + + // Set empty keys. + $keys = []; +} + +// Send message. +send_message($update['message']['chat']['id'], $msg, $keys, ['reply_markup' => ['selective' => true, 'one_time_keyboard' => true]]); + +exit(); diff --git a/commands/rocketdelete.php b/commands/rocketdelete.php new file mode 100644 index 0000000..1e832e8 --- /dev/null +++ b/commands/rocketdelete.php @@ -0,0 +1,67 @@ + UTC_TIMESTAMP() + ORDER BY invasions.id + " + ); + +// Init empty keys array. +$keys = array(); + +// Add key for quest +while ($invasions = $rs->fetch_assoc()) { + // Pokestop name. + $pokestop_name = (!empty($invasions['pokestop_name']) ? ($invasions['pokestop_name']) : (getTranslation('unnamed_pokestop'))); + + // Add buttons to delete quests. + $keys[] = array( + 'text' => $pokestop_name, + 'callback_data' => $invasions['id'] . ':invasion_delete:0' + ); + +} + +if(!$keys) { + // Set the message. + $msg = '' . getTranslation('no_invasions_currently') . '' . CR; + + // Set empty keys. + $keys = []; +} else { + // Add header. + $msg = '' . getTranslation('invasions_currently') . '' . CR; + $msg .= get_current_formatted_invasions(); + + // Set keys. + $keys = inline_key_array($keys, 2); + + // Add Done key. + $keys[] = [ + [ + 'text' => getTranslation('done'), + 'callback_data' => '0:exit:1' + ] + ]; +} + +// Send the message. +send_message($update['message']['chat']['id'], $msg, $keys, ['disable_web_page_preview' => 'true']); + +exit(); diff --git a/commands/rocketlist.php b/commands/rocketlist.php new file mode 100644 index 0000000..5618c9f --- /dev/null +++ b/commands/rocketlist.php @@ -0,0 +1,67 @@ + UTC_TIMESTAMP() + ORDER BY invasions.id + " + ); + +// Init empty keys array. +$keys = array(); + +// Add key for invasion +while ($invasions = $rs->fetch_assoc()) { + // Pokestop name. + $text = empty($invasions['pokestop_name']) ? getTranslation('unnamed_pokestop') : $invasions['pokestop_name']; + + // Add buttons to delete invasions. + $keys[] = array( + 'text' => $text, + 'callback_data' => $invasions['id'] . ':invasion_edit:0' + ); + +} + +if(!$keys) { + // Set the message. + $msg = '' . getTranslation('no_invasions_currently') . '' . CR; + + // Set empty keys. + $keys = []; +} else { + // Add header. + $msg = '' . getTranslation('invasions_currently') . '' . CR; + $msg .= get_current_formatted_invasions(); + + // Set keys. + $keys = inline_key_array($keys, 2); + + // Add Done key. + $keys[] = [ + [ + 'text' => getTranslation('done'), + 'callback_data' => '0:exit:1' + ] + ]; +} + +// Send the message. +send_message($update['message']['chat']['id'], $msg, $keys, ['disable_web_page_preview' => 'true']); + +exit(); diff --git a/commands/stopaddress.php b/commands/stopaddress.php new file mode 100644 index 0000000..936e492 --- /dev/null +++ b/commands/stopaddress.php @@ -0,0 +1,94 @@ +' . getTranslation('pokestop_id_address_missing') . ''; + $msg .= CR . CR . getTranslation('pokestop_address_instructions'); + $msg .= CR . getTranslation('pokestop_address_example'); + $msg .= CR . CR . getTranslation('pokestop_address_reset'); + $msg .= CR . getTranslation('pokestop_address_reset_example'); + $msg .= CR . CR . getTranslation('pokestop_get_id_details'); + + // Set keys. + $keys = []; +} else { + // Set keys. + $keys = []; + + // Get pokestop id. + $split_id_info = explode(',', $id_info,2); + $id = $split_id_info[0]; + $info = $split_id_info[1]; + $info = trim($info); + + // Make sure we have a valid pokestop id. + $pokestop = false; + if(is_numeric($id)) { + $pokestop = get_pokestop($id); + } + + // Update pokestop info. + if($pokestop && !empty($info) && strtolower($info) == 'reset') { + debug_log('Deleting address for pokestop with ID: ' . $id); + my_query( + " + UPDATE pokestops + SET address = NULL + WHERE id = {$id} + " + ); + + // Set message. + $msg = get_pokestop_details($pokestop); + $msg .= CR . '' . getTranslation('pokestop_address_deleted') . ''; + } else if($pokestop && !empty($info)) { + debug_log('Adding address for pokestop with ID: ' . $id); + debug_log('Pokestop address: ' . $info); + my_query( + " + UPDATE pokestops + SET address = '{$db->real_escape_string($info)}' + WHERE id = {$id} + " + ); + + // Set message. + $msg = get_pokestop_details($pokestop); + $msg .= EMOJI_NEW . SP . $info; + $msg .= CR . CR . '' . getTranslation('pokestop_address_added') . ''; + } else if($pokestop && empty($info)) { + debug_log('Missing pokestop address!'); + // Set message. + $msg .= CR . '' . getTranslation('pokestop_id_address_missing') . ''; + $msg .= CR . CR . getTranslation('pokestop_address_instructions'); + $msg .= CR . getTranslation('pokestop_address_example'); + $msg .= CR . CR . getTranslation('pokestop_address_reset'); + $msg .= CR . getTranslation('pokestop_address_reset_example'); + $msg .= CR . CR . getTranslation('pokestop_get_id_details'); + } else { + // Set message. + $msg .= getTranslation('invalid_input'); + } +} + +// Send message. +send_message($update['message']['chat']['id'], $msg, $keys, ['reply_markup' => ['selective' => true, 'one_time_keyboard' => true], 'disable_web_page_preview' => 'true']); + +?> diff --git a/commands/stopgps.php b/commands/stopgps.php new file mode 100644 index 0000000..f3c0750 --- /dev/null +++ b/commands/stopgps.php @@ -0,0 +1,101 @@ +' . getTranslation('pokestop_id_gps_missing') . ''; + $msg .= CR . CR . getTranslation('pokestop_gps_instructions'); + $msg .= CR . getTranslation('pokestop_gps_example'); + + // Set keys. + $keys = []; +} else { + // Set keys. + $keys = []; + + // Get pokestop id. + $split_id_info = explode(',', $id_info,2); + $id = $split_id_info[0]; + $info = $split_id_info[1]; + $info = trim($info); + + // Count commas given in info. + $count = substr_count($info, ","); + + // 1 comma as it should be? + // E.g. 52.5145434,13.3501189 + if($count == 1) { + $lat_lon = explode(',', $info); + $lat = $lat_lon[0]; + $lon = $lat_lon[1]; + + // Lat and lon with comma instead of dot? + // E.g. 52,5145434,13,3501189 + } else if($count == 3) { + $lat_lon = explode(',', $info); + $lat = $lat_lon[0] . '.' . $lat_lon[1]; + $lon = $lat_lon[2] . '.' . $lat_lon[3]; + } else { + // Invalid input - send the message and exit. + $msg = '' . getTranslation('invalid_input') . '' . CR . CR; + $msg .= getTranslation('pokestop_gps_coordinates_format_error') . CR; + $msg .= getTranslation('pokestop_gps_example'); + sendMessage($update['message']['chat']['id'], $msg); + exit(); + } + + // Make sure we have a valid pokestop id. + $pokestop = false; + if(is_numeric($id)) { + $pokestop = get_pokestop($id); + } + + if($pokestop && !empty($info)) { + debug_log('Updating gps coordinates for pokestop with ID: ' . $id); + debug_log('Pokestop latitude: ' . $lat); + debug_log('Pokestop longitude: ' . $lon); + my_query( + " + UPDATE pokestops + SET lat = {$lat}, + lon = {$lon} + WHERE id = {$id} + " + ); + + // Set message. + $msg = get_pokestop_details($pokestop); + $msg .= EMOJI_NEW . SP . $info; + $msg .= CR . CR . '' . getTranslation('pokestop_gps_added') . ''; + } else if($pokestop && empty($info)) { + debug_log('Missing pokestop coordinates!'); + // Set message. + $msg .= CR . '' . getTranslation('pokestop_id_gps_missing') . ''; + $msg .= CR . CR . getTranslation('pokestop_gps_instructions'); + $msg .= CR . getTranslation('pokestop_gps_example'); + } else { + // Set message. + $msg .= getTranslation('invalid_input'); + } +} + +// Send message. +send_message($update['message']['chat']['id'], $msg, $keys, ['reply_markup' => ['selective' => true, 'one_time_keyboard' => true], 'disable_web_page_preview' => 'true']); + +?> diff --git a/commands/stopname.php b/commands/stopname.php new file mode 100644 index 0000000..c8ac125 --- /dev/null +++ b/commands/stopname.php @@ -0,0 +1,94 @@ +' . getTranslation('pokestop_id_name_missing') . ''; + $msg .= CR . CR . getTranslation('pokestop_name_instructions'); + $msg .= CR . getTranslation('pokestop_name_example'); + $msg .= CR . CR . getTranslation('pokestop_get_id_details'); + + // Set keys. + $keys = []; +} else { + // Set keys. + $keys = []; + + // Init vars. + $pokestop = false; + $info = ''; + $id = 0; + $tg_id = '#' . $update['message']['from']['id']; + + // Get pokestop id. + if(substr_count($id_info, ',') >= 1) { + $split_id_info = explode(',', $id_info,2); + $id = $split_id_info[0]; + $info = $split_id_info[1]; + $info = trim($info); + + // Make sure we have a valid pokestop id. + if(is_numeric($id)) { + $pokestop = get_pokestop($id); + } + } + + // Maybe get pokestop by telegram id? + if(!$pokestop) { + $pokestop = get_pokestop_by_telegram_id($tg_id); + // Get new id. + if($pokestop) { + $id = $pokestop['id']; + $info = $id_info; + } + } + + // Update pokestop info. + if($pokestop && !empty($info) && $id > 0) { + debug_log('Changing name for pokestop with ID: ' . $id); + debug_log('Pokestop name: ' . $info); + my_query( + " + UPDATE pokestops + SET pokestop_name = '{$db->real_escape_string($info)}' + WHERE id = {$id} + " + ); + + // Set message. + $pokestop = get_pokestop($id); + $msg = get_pokestop_details($pokestop); + $msg .= CR . '' . getTranslation('pokestop_name_updated') . ''; + } else if($pokestop && empty($info)) { + debug_log('Missing pokestop name!'); + // Set message. + $msg = CR . '' . getTranslation('pokestop_id_name_missing') . ''; + $msg .= CR . CR . getTranslation('pokestop_name_instructions'); + $msg .= CR . getTranslation('pokestop_name_example'); + $msg .= CR . CR . getTranslation('pokestop_get_id_details'); + } else { + // Set message. + $msg = getTranslation('invalid_input'); + } +} + +// Send message. +send_message($update['message']['chat']['id'], $msg, $keys, ['reply_markup' => ['selective' => true, 'one_time_keyboard' => true], 'disable_web_page_preview' => 'true']); + +?> diff --git a/commands/willow.php b/commands/willow.php old mode 100755 new mode 100644 index f8f294f..5aba459 --- a/commands/willow.php +++ b/commands/willow.php @@ -6,46 +6,51 @@ //debug_log($update); //debug_log($data); -// Check access - user must be admin! -bot_access_check($update, BOT_ADMINS); - -// Get all available quests from database. -$rs = my_query( - " - SELECT * - FROM questlist - " - ); - -// Init empty questlist message. -$msg_questlist = ''; - -// Add key for quest -while ($questlist = $rs->fetch_assoc()) { - // Quest action: Singular or plural? - $quest_action = explode(":", getTranslation('quest_action_' . $questlist['quest_action'])); - $quest_action_singular = $quest_action[0]; - $quest_action_plural = $quest_action[1]; - $qty_action = $questlist['quest_quantity'] . SP . (($questlist['quest_quantity'] > 1) ? ($quest_action_plural) : ($quest_action_singular)); - - // Build questlist message. - $msg_questlist .= 'ID: ' . $questlist['id'] . ' — '; - $msg_questlist .= getTranslation('quest_type_'. $questlist['quest_type']) . SP . $qty_action . CR . CR; -} - -// Set keys. +// Check access. +bot_access_check($update, 'willow'); + +// Init empty keys array. $keys = []; -if(empty($msg_questlist)) { - // Set the message. - $msg = '' . getTranslation('no_quests_today') . '' . CR; -} else { - // Add header. - $msg = '' . getTranslation('quests_today') . '' . CR; - $msg .= $msg_questlist; -} - -// Send the message. -send_message($update['message']['chat']['id'], $msg, $keys, ['disable_web_page_preview' => 'true']); +// Create keys array. +$keys = [ + [ + [ + 'text' => getTranslation('quest'), + 'callback_data' => '0:willow:quest' + ] + ], + [ + [ + 'text' => getTranslation('reward'), + 'callback_data' => '0:willow:reward' + ] + ], + [ + [ + 'text' => getTranslation('encounter'), + 'callback_data' => '0:willow:encounter' + ] + ], + [ + [ + 'text' => getTranslation('quicklist'), + 'callback_data' => '0:willow:quicklist' + ] + ] +]; + +// Add abort navigation key. +$nav_keys = []; +$nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + +// Get the inline key array. +$keys[] = $nav_keys; + +// Set message. +$msg = '' . getTranslation('edit_quests_encounters_rewards_quicklist') . ''; + +// Send message. +send_message($update['message']['chat']['id'], $msg, $keys, ['reply_markup' => ['selective' => true, 'one_time_keyboard' => true]]); exit(); diff --git a/config.php.example b/config.php.example deleted file mode 100755 index b7ce6f1..0000000 --- a/config.php.example +++ /dev/null @@ -1,54 +0,0 @@ - 'NL', - 'de' => 'DE', - 'en-US' => 'EN', - 'pt' => 'PT-BR' -); - -// Icons. -define('TEAM_B', iconv('UCS-4LE', 'UTF-8', pack('V', 0x1F499))); -define('TEAM_R', iconv('UCS-4LE', 'UTF-8', pack('V', 0x2764))); -define('TEAM_Y', iconv('UCS-4LE', 'UTF-8', pack('V', 0x1F49B))); -define('TEAM_CANCEL', iconv('UCS-4LE', 'UTF-8', pack('V', 0x1F494))); -define('TEAM_DONE', iconv('UCS-4LE', 'UTF-8', pack('V', 0x1F4AA))); -define('TEAM_UNKNOWN', iconv('UCS-4LE', 'UTF-8', pack('V', 0x1F680))); -define('EMOJI_REFRESH', iconv('UCS-4LE', 'UTF-8', pack('V', 0x1F504))); -define('EMOJI_HERE', iconv('UCS-4LE', 'UTF-8', pack('V', 0x1F4CD))); -define('EMOJI_LATE', iconv('UCS-4LE', 'UTF-8', pack('V', 0x1F40C))); -define('EMOJI_GROUP', iconv('UCS-4LE', 'UTF-8', pack('V', 0x1F465))); -define('EMOJI_WARN', iconv('UCS-4LE', 'UTF-8', pack('V', 0x26A0))); -define('EMOJI_DISK', iconv('UCS-4LE', 'UTF-8', pack('V', 0x1F4BE))); - -// Weather Icons. -define('EMOJI_W_SUNNY', iconv('UCS-4LE', 'UTF-8', pack('V', 0x2600))); -define('EMOJI_W_CLEAR', iconv('UCS-4LE', 'UTF-8', pack('V', 0x2728))); -define('EMOJI_W_RAIN', iconv('UCS-4LE', 'UTF-8', pack('V', 0x2614))); -define('EMOJI_W_PARTLY_CLOUDY', iconv('UCS-4LE', 'UTF-8', pack('V', 0x26C5))); -define('EMOJI_W_CLOUDY', iconv('UCS-4LE', 'UTF-8', pack('V', 0x2601))); -define('EMOJI_W_WINDY', iconv('UCS-4LE', 'UTF-8', pack('V', 0x1F32A))); -define('EMOJI_W_SNOW', iconv('UCS-4LE', 'UTF-8', pack('V', 0x26C4))); -define('EMOJI_W_FOG', iconv('UCS-4LE', 'UTF-8', pack('V', 0x1F32B))); - -// Weather. -$weather = array( - '1' => EMOJI_W_SUNNY, - '2' => EMOJI_W_CLEAR, - '3' => EMOJI_W_RAIN, - '4' => EMOJI_W_PARTLY_CLOUDY, - '5' => EMOJI_W_CLOUDY, - '6' => EMOJI_W_WINDY, - '7' => EMOJI_W_SNOW, - '8' => EMOJI_W_FOG -); - -// Teams. -$teams = array( - 'mystic' => TEAM_B, - 'valor' => TEAM_R, - 'instinct' => TEAM_Y, - 'unknown' => TEAM_UNKNOWN, - 'cancel' => TEAM_CANCEL -); - -// Raid eggs. -$eggs = array( - '9995', // Level 5 - '9994', // Level 4 - '9993', // Level 3 - '9992', // Level 2 - '9991' // Level 1 -); diff --git a/core b/core index f4e7bb5..ff75ac9 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit f4e7bb5dfcb09f38d143054934f044f6414e04b4 +Subproject commit ff75ac9fae5ee34149efb4f72aeae2e9ebdcffa8 diff --git a/custom/.gitignore b/custom/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/custom/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/index.php b/index.php old mode 100755 new mode 100644 index 3bed15e..a7f4bc9 --- a/index.php +++ b/index.php @@ -1,197 +1,69 @@ set_charset('utf8mb4'); - -// Error connecting to db. -if ($db->connect_errno) { - // Write connection error to log. - debug_log("Failed to connect to Database!" . $db->connect_error(), '!'); - // Echo data. - sendMessage($update['message']['chat']['id'], "Failed to connect to Database!\nPlease contact " . MAINTAINER . " and forward this message...\n"); -} +// Database connection +include_once(CORE_BOT_PATH . '/db.php'); // Run cleanup if requested -include_once(CORECLASS_PATH . '/cleanup_run.php'); +include_once(CORE_BOT_PATH . '/cleanup_run.php'); // Update the user -if ($ddos_count == 0 || $ddos_count > 2) { - // Update the user. - $userUpdate = update_user($update); - - // Write to log. - debug_log('Update user: ' . $userUpdate); -} +update_user($update); // Callback query received. if (isset($update['callback_query'])) { - // Init empty data array. - $data = []; - - // Callback data found. - if ($update['callback_query']['data']) { - // Bridge mode? - if(defined('BRIDGE_MODE') && BRIDGE_MODE == true) { - // Split bot folder name away from actual data. - $botnameData = explode(':', $update['callback_query']['data'], 2); - $botname = $botnameData[0]; - $thedata = $botnameData[1]; - // Write to log - debug_log('Bot Name: ' . $botname); - debug_log('The Data: ' . $thedata); - } else { - // Data is just the data. - $thedata = $update['callback_query']['data']; - } - // Split callback data and assign to data array. - $splitData = explode(':', $thedata); - $data['id'] = $splitData[0]; - $data['action'] = $splitData[1]; - $data['arg'] = $splitData[2]; - } - - // Write data to log. - debug_log($data, '* DATA= '); - - // Set module path by sent action name. - $module = ROOT_PATH . '/mods/' . basename($data['action']) . '.php'; - - // Write module to log. - debug_log($module); - - // Check if the module file exists. - if (file_exists($module)) { - // Dynamically include module file and exit. - include_once($module); - exit(); - - // Module file is missing. - } else { - // Write to log. - debug_log('No action'); - } + // Logic to get the module + include_once(CORE_BOT_PATH . '/modules.php'); // Inline query received. } else if (isset($update['inline_query'])) { - // Check access to the bot - bot_access_check($update); - // List quests and exit. - quest_list($update); + // List inline search results and exit. + inline_list($update); exit(); // Location received. -} else if (isset($update['message']['location'])) { - // Check access to the bot - bot_access_check($update); - - // Create raid and exit. - if(QUEST_VIA_LOCATION == true) { +} else if (isset($update['message']['location']) && $update['message']['chat']['type'] == 'private') { + // Ask for quest or invasion and exit. + if(QUEST_VIA_LOCATION == true && INVASION_VIA_LOCATION == true) { + include_once(ROOT_PATH . '/mods/geo.php'); + // Create quest and exit. + } else if(QUEST_VIA_LOCATION == true) { include_once(ROOT_PATH . '/mods/quest_geo.php'); + // Create invasion and exit. + } else if(INVASION_VIA_LOCATION == true) { + include_once(ROOT_PATH . '/mods/invasion_geo.php'); } exit(); // Cleanup collection from channel/supergroup messages. } else if ((isset($update['channel_post']) && $update['channel_post']['chat']['type'] == "channel") || (isset($update['message']) && $update['message']['chat']['type'] == "supergroup")) { - // Write to log. - debug_log('Collecting cleanup preparation information...'); - - // Init ID. - $id = 0; - - // Channel - if(isset($update['channel_post'])) { - // Get chat_id and message_id - $chat_id = $update['channel_post']['chat']['id']; - $message_id = $update['channel_post']['message_id']; - - // Get id from text. - $id = substr(strrchr($update['channel_post']['text'], substr(strtoupper(BOT_ID), 0, 1) . '-ID = '), 7); - - // Supergroup - } else if ($update['message']['chat']['type'] == "supergroup") { - // Get chat_id and message_id - $chat_id = $update['message']['chat']['id']; - $message_id = $update['message']['message_id']; - - // Get id from text. - $id = substr(strrchr($update['message']['text'], substr(strtoupper(BOT_ID), 0, 1) . '-ID = '), 7); - } - - // Write cleanup info to database. - debug_log('Calling cleanup preparation now!'); - debug_log('Cleanup_ID: ' . $id); - if($id != 0) { - insert_cleanup($chat_id, $message_id, $id); - } + // Collect cleanup information + include_once(CORE_BOT_PATH . '/cleanup_collect.php'); // Message is required to check for commands. } else if (isset($update['message']) && $update['message']['chat']['type'] == 'private') { - // Check access to the bot - bot_access_check($update); - - // Init command. - $command = NULL; - - // Check message text for a leading slash. - if (substr($update['message']['text'], 0, 1) == '/') { - // Get command name. - $com = strtolower(str_replace('/', '', str_replace(BOT_NAME, '', explode(' ', $update['message']['text'])[0]))); - $altcom = strtolower(str_replace('/' . basename(ROOT_PATH), '', str_replace(BOT_NAME, '', explode(' ', $update['message']['text'])[0]))); - - // Set command paths. - $command = ROOT_PATH . '/commands/' . basename($com) . '.php'; - $altcommand = ROOT_PATH . '/commands/' . basename($altcom) . '.php'; - $startcommand = ROOT_PATH . '/commands/start.php'; - - // Write to log. - debug_log('Command-File: ' . $command); - debug_log('Alternative Command-File: ' . $altcommand); - debug_log('Start Command-File: ' . $startcommand); - - // Check if command file exits. - if (is_file($command)) { - // Dynamically include command file and exit. - include_once($command); - exit(); - } else if (is_file($altcommand)) { - // Dynamically include command file and exit. - include_once($altcommand); - exit(); - } else if ($com == basename(ROOT_PATH)) { - // Include start file and exit. - include_once($startcommand); - exit(); - } else { - sendMessage($update['message']['chat']['id'], '' . getTranslation('not_supported') . ''); - } + // Portal message? + if(isset($update['message']['entities']['1']['type']) && $update['message']['entities']['1']['type'] == 'text_link' && strpos($update['message']['entities']['1']['url'], 'https://intel.ingress.com/intel?ll=') === 0) { + // Import portal. + include_once(ROOT_PATH . '/mods/importal.php'); + } else { + // Logic to get the command + include_once(CORE_BOT_PATH . '/commands.php'); } } diff --git a/lang/help.json b/lang/help.json new file mode 100644 index 0000000..9795959 --- /dev/null +++ b/lang/help.json @@ -0,0 +1,244 @@ +{ + "help_create_via_location":{ + "NL":"Locatie delen - Maak een quest of Team R invasie", + "DE":"Standort teilen - Forschung oder Invasion anlegen", + "EN":"Share location - Create quest or invasion", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_quest_via_location":{ + "NL":"Locatie delen - Maak een quest", + "DE":"Standort teilen - Forschung anlegen", + "EN":"Share location - Create quest", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_invasion_via_location":{ + "NL":"Deel locatie - Maak een Team R invasie", + "DE":"Standort teilen - Invasion anlegen", + "EN":"Share location - Create invasion", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_create":{ + "NL":"/start - Maak een quest", + "DE":"/start - Forschung anlegen", + "EN":"/start - Create quest", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_list":{ + "NL":"/list - Questen van vandaag", + "DE":"/list - Alle heutigen Forschungen", + "EN":"/list - Todays quests", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_delete-own":{ + "NL":"/delete - Verwijderen eigen questen", + "DE":"/delete - Eigene Forschungen löschen", + "EN":"/delete - Delete own quests", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_delete-all":{ + "NL":"/delete - Verwijder alle questen", + "DE":"/delete - Alle Forschungen löschen", + "EN":"/delete - Delete all quests", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_invasion-create":{ + "NL":"/rocket - Maak een Team R invasie aan", + "DE":"/rocket - Invasion anlegen", + "EN":"/rocket - Create invasion", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_invasion-list":{ + "NL":"/rocketlist - Huidige Team R invasies", + "DE":"/rocketlist - Aktuelle Invasionen", + "EN":"/rocketlist - Current invasions", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_invasion-delete-own":{ + "NL":"/rocketdelete - Verwijder eigen Team R invasie", + "DE":"/rocketdelete - Eigene Invasionen löschen", + "EN":"/rocketdelete - Delete own invasions", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_invasion-delete-all":{ + "NL":"/rocketdelete - Verwijder alle Team R invasies", + "DE":"/rocketdelete - Alle Invasionen löschen", + "EN":"/rocketdelete - Delete all invasions", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_pokestop-details":{ + "NL":"/pokestop - Laat pokestop informatie zien", + "DE":"/pokestop - Pokestop-Details anzeigen", + "EN":"/pokestop - Show pokestop details", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_pokestop-name":{ + "NL":"/stopname - Verander de pokestop naam", + "DE":"/stopname - Pokestop-Namen bearbeiten", + "EN":"/stopname - Edit pokestop name", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_pokestop-address":{ + "NL":"/stopaddress - verander pokestop adres", + "DE":"/stopaddress - Pokestop-Adresse bearbeiten", + "EN":"/stopaddress - Edit pokestop address", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_pokestop-gps":{ + "NL":"/stopgps - verander pokestop coordinaten", + "DE":"/stopgps - Pokestop-Koordinaten bearbeiten", + "EN":"/stopgps - Edit pokestop coordinates", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_pokestop-add":{ + "NL":"/addstop - Pokestop toevoegen", + "DE":"/addstop - Pokestop hinzufügen", + "EN":"/addstop - Add a pokestop", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_pokestop-delete":{ + "NL":"/deletestop - Verwijder een pokestop", + "DE":"/deletestop - Pokestop löschen", + "EN":"/deletestop - Delete a pokestop", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_portal-import":{ + "NL":"@PortalMapBot of @Ingressportalbot - Importeer pokestop", + "DE":"@PortalMapBot oder @Ingressportalbot - Pokestop importieren", + "EN":"@PortalMapBot or @Ingressportalbot - Import pokestop", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_event":{ + "NL":"/event - Stel de huidige event naam in", + "DE":"/event - Name für aktuelles Quest-Event festlegen", + "EN":"/event - Set current quest event name", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_dex":{ + "NL":"/dex - Vraag pokedex nummer aan de hand van de naam", + "DE":"/dex - ID für Pokemon-Name herausfinden", + "EN":"/dex - Get ID from pokemon name", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_willow":{ + "NL":"/willow - Quest, reward en pokemon encouter manager", + "DE":"/willow - Forschungen, Belohnungen und Pokemon-Begegnungen verwalten", + "EN":"/willow - Manage quests, rewards and pokemon encounters", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "help_help":{ + "NL":"/help - laat help zien", + "DE":"/help - Hilfe anzeigen", + "EN":"/help - Show help", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + } +} diff --git a/lang/language.json b/lang/language.json index 47523f7..f42a549 100644 --- a/lang/language.json +++ b/lang/language.json @@ -1,393 +1,987 @@ { - "weekday_1":{ - "NL":"Maandag", - "DE":"Montag", - "EN":"Monday", - "IT":"Lunedì", - "PT-BR":"Segunda-feira", - "RU":"Понедельник", - "NO":"Mandag", - "FR":"Lundi" - }, - "weekday_2":{ - "NL":"Dinsdag", - "DE":"Dienstag", - "EN":"Tuesday", - "IT":"Martedì", - "PT-BR":"Terça-feira", - "RU":"Вторник", - "NO":"Tirsdag", - "FR":"Mardi" - }, - "weekday_3":{ - "NL":"Woensdag", - "DE":"Mittwoch", - "EN":"Wednesday", - "IT":"Mercoledì", - "PT-BR":"Quarta-feira", - "RU":"Среда", - "NO":"Onsdag", - "FR":"Mercredi" - }, - "weekday_4":{ - "NL":"Donderdag", - "DE":"Donnerstag", - "EN":"Thursday", - "IT":"Giovedì", - "PT-BR":"Quinta-feira", - "RU":"Четверг", - "NO":"Torsdag", - "FR":"Jeudi" - }, - "weekday_5":{ - "NL":"Vrijdag", - "DE":"Freitag", - "EN":"Friday", - "IT":"Venerdì", - "PT-BR":"Sexta-feira", - "RU":"Пятница", - "NO":"Fredag", - "FR":"Vendredi" - }, - "weekday_6":{ - "NL":"Zaterdag", - "DE":"Samstag", - "EN":"Saturday", - "IT":"Sabato", - "PT-BR":"Sábado", - "RU":"Суббота", - "NO":"Lørdag", - "FR":"Samedi" - }, - "weekday_7":{ - "NL":"Zondag", - "DE":"Sonntag", - "EN":"Sunday", - "IT":"Domenica", - "PT-BR":"Domingo", - "RU":"Воскресение", - "NO":"Søndag", - "FR":"Dimanche" - }, - "month_01":{ - "NL":"Januari", - "DE":"Januar", - "EN":"January", - "IT":"Gennaio", - "PT-BR":"Janeiro", - "RU":"Январь", - "NO":"Januar", - "FR":"Janvier" - }, - "month_02":{ - "NL":"Februari", - "DE":"Februar", - "EN":"February", - "IT":"Febbraio", - "PT-BR":"Fevereiro", - "RU":"Февраль", - "NO":"Februar", - "FR":"Février" - }, - "month_03":{ - "NL":"Maart", - "DE":"März", - "EN":"March", - "IT":"Marzo", - "PT-BR":"Março", - "RU":"Март", - "NO":"Mars", - "FR":"Mars" - }, - "month_04":{ - "NL":"April", - "DE":"April", - "EN":"April", - "IT":"Aprile", - "PT-BR":"Abril", - "RU":"Апрель", - "NO":"April", - "FR":"Avril" - }, - "month_05":{ - "NL":"Mei", - "DE":"Mai", - "EN":"May", - "IT":"Maggio", - "PT-BR":"Mais", - "RU":"Май", - "NO":"Mai", - "FR":"Mai" - }, - "month_06":{ - "NL":"Juni", - "DE":"Juni", - "EN":"June", - "IT":"Giugno", - "PT-BR":"Junho", - "RU":"Июнь", - "NO":"Juni", - "FR":"Juin" - }, - "month_07":{ - "NL":"Juli", - "DE":"Juli", - "EN":"July", - "IT":"Luglio", - "PT-BR":"Julho", - "RU":"Июль", - "NO":"Juli", - "FR":"Juillet" - }, - "month_08":{ - "NL":"Augustus", - "DE":"August", - "EN":"August", - "IT":"Agosto", - "PT-BR":"Agosto", - "RU":"Август", - "NO":"August", - "FR":"Août" - }, - "month_09":{ - "NL":"September", - "DE":"September", - "EN":"September", - "IT":"Settembre", - "PT-BR":"Setembro", - "RU":"Сентябрь", - "NO":"September", - "FR":"Septembre" - }, - "month_10":{ - "NL":"Oktober", - "DE":"Oktober", - "EN":"October", - "IT":"Ottobre", - "PT-BR":"Outubro", - "RU":"Октябрь", - "NO":"Oktober", - "FR":"Octobre" - }, - "month_11":{ - "NL":"November", - "DE":"November", - "EN":"November", - "IT":"Novembre", - "PT-BR":"Novembro", - "RU":"Ноябрь", - "NO":"November", - "FR":"Novembre" - }, - "month_12":{ - "NL":"December", - "DE":"Dezember", - "EN":"December", - "IT":"Dicembre", - "PT-BR":"Dezembro", - "RU":"Декабрь", - "NO":"Desember", - "FR":"Décembre" - }, - "bot_access_denied":{ - "NL":"Je hebt geen toegang tot deze functie of bot!", - "DE":"Sie haben keine Berechtigung diesen Befehl oder Bot zu nutzen!", - "EN":"You are not allowed to use this command or bot!", - "IT":"Non hai i permessi necessari per usare questo comando o bot!", - "PT-BR":"Você não tem permissão para utilizar esse comando ou bot!", - "RU":"Вы не можете использовать эту команду или бота!", - "NO":"Du har ikke tillatelse til å bruke denne kommandoen eller boten!", - "FR":"Tu n'es pas autorisé à utiliser cette commande !" - }, - "forest":{ - "NL":"Ergens in het bos", - "DE":"Irgendwo im Wald", - "EN":"Somewhere in the forest", - "IT":"Da qualche parte nella foresta", - "PT-BR":"Em algum lugar na floresta", - "RU":"Где-то в лесу", - "NO":"Ett sted i skogen", - "FR":"Quelque part dans la forêt" - }, - "yes":{ - "NL":"Ja", - "DE":"Ja", - "EN":"Yes", - "IT":"Sì", - "PT-BR":"Sim", - "RU":"Да", - "NO":"Ja", - "FR":"Oui" - }, - "no":{ - "NL":"Nee", - "DE":"Nein", - "EN":"No", - "IT":"No", - "PT-BR":"Não", - "RU":"Нет", - "NO":"Nei", - "FR":"Non" - }, - "not_supported":{ - "NL":"Niet ondersteund", - "DE":"Nicht unterstützt", - "EN":"Not supported", - "IT":"Non compatibile", - "PT-BR":"Não compatível", - "RU":"Не поддерживается", - "NO":"Ikke støttet", - "FR":"Non compatible" - }, - "abort":{ - "NL":"Afbreken", - "DE":"Abbrechen", - "EN":"Abort", - "IT":"Cancella", - "PT-BR":"Abortar", - "RU":"Прервать", - "NO":"Avbryt", - "FR":"Abandonner" - }, - "action_aborted":{ - "NL":"Het proces is afgebroken!", - "DE":"Der Vorgang wurde abgebrochen!", - "EN":"The process was aborted!", - "IT":"Il processo è stato cancellato!", - "PT-BR":"O processo foi abortado!", - "RU":"Процесс был прерван!", - "NO":"Handlingen ble avbrutt!", - "FR":"Le processus à échoué !" - }, - "back":{ - "NL":"Terug", - "DE":"Zurück", - "EN":"Back", - "IT":"Precedente", - "PT-BR":"Voltar", - "RU":"Назад", - "NO":"Tilbake", - "FR":"Retour" - }, - "next":{ - "NL":"Volgende", - "DE":"Weiter", - "EN":"Next", - "IT":"Successivo", - "PT-BR":"Próximo", - "RU":"Вперед", - "NO":"Neste", - "FR":"Suivant" - }, - "done":{ - "NL":"Klaar", - "DE":"Fertig", - "EN":"Done", - "IT":"Completato", - "PT-BR":"Feito", - "RU":"Готово", - "NO":"Ferdig", - "FR":"Terminé" - }, - "add":{ - "NL":"Toevoegen", - "DE":"Hinzufügen", - "EN":"Add", - "IT":"Aggiungi", - "PT-BR":"Adicionar", - "RU":"Добавить", - "NO":"Legg til", - "FR":"Ajouter" - }, - "delete":{ - "NL":"Verwijder", - "DE":"Löschen", - "EN":"Delete", - "IT":"Elimina", - "PT-BR":"Deletar", - "RU":"Удалить", - "NO":"Slett", - "FR":"Supprimer" - }, - "list":{ - "NL":"Lijst", - "DE":"Anzeigen", - "EN":"List", - "IT":"Lista", - "PT-BR":"Lista", - "RU":"Список", - "NO":"List", - "FR":"Liste" - }, - "reset":{ - "NL":"Reset", - "DE":"Reset", - "EN":"Reset", - "IT":"Reset", - "PT-BR":"TRANSLATE", - "RU":"Сброс", - "NO":"Reset", - "FR":"Remise à zéro" - }, - "created_by":{ - "NL":"Aangemaakt door", - "DE":"Erstellt von", - "EN":"Created by", - "IT":"Creato da", - "PT-BR":"Criada por", - "RU":"Создано", - "NO":"Postet av", - "FR":"Créé par" - }, - "updated":{ - "NL":"Bijgewerkt", - "DE":"Aktualisiert", - "EN":"Updated", - "IT":"Aggiornato", - "PT-BR":"Atualizada", - "RU":"Обновлено", - "NO":"Oppdatert", - "FR":"Mis à jour" - }, - "share":{ - "NL":"Delen", - "DE":"Teilen", - "EN":"Share", - "IT":"Condividi", - "PT-BR":"Compartilhar", - "RU":"Поделиться", - "NO":"Del", - "FR":"Partager" - }, - "share_with":{ - "NL":"Delen met", - "DE":"Teilen mit", - "EN":"Share with", - "IT":"Condividi con", - "PT-BR":"Compartilhar com", - "RU":"Поделиться с", - "NO":"Del med", - "FR":"Partager avec" - }, - "successfully_shared":{ - "NL":"Succesvol gedeeld!", - "DE":"Erfolgreich geteilt!", - "EN":"Successfully shared!", - "IT":"Condiviso con successo!", - "PT-BR":"Compartilhado com sucesso!", - "RU":"Успешно отправлено!", - "NO":"Deling velykket!", - "FR":"Partagé avec succès !" - }, - "expand":{ - "NL":"Uitklappen", - "DE":"Ausklappen", - "EN":"Expand", - "IT":"Espandi", - "PT-BR":"Expandir", - "RU":"Развернуть", - "NO":"Flere valg", - "FR":"Agrandir" + "quest":{ + "NL":"Quest", + "DE":"Forschung", + "EN":"Quest", + "IT":"Spedizione", + "PT-BR":"TRANSLATE", + "RU":"Квест", + "NO":"Oppdrag", + "FR":"Quête" + }, + "invasion":{ + "NL":"Team R invasie", + "DE":"Team Rocket Invasion", + "EN":"Team Rocket Invasion", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "info":{ + "NL":"Info", + "DE":"Info", + "EN":"Info", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "event":{ + "NL":"Event", + "DE":"Event", + "EN":"Event", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "no_event":{ + "NL":"Geen event", + "DE":"Kein Event", + "EN":"No event", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "select_event":{ + "NL":"Selecteer event:", + "DE":"Event auswählen:", + "EN":"Select event:", + "IT":"TRANSLATE.", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "event_saved":{ + "NL":"Event opgeslagen!", + "DE":"Event gespeichert!", + "EN":"Event saved!", + "IT":"TRANSLATE.", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "event_name_missing":{ + "NL":"Error! Event naam mist!", + "DE":"Fehler! Event-Name fehlt!", + "EN":"Error! Event name is missing!", + "IT":"TRANSLATE.", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "pokestop":{ + "NL":"Pokestop", + "DE":"Pokestop", + "EN":"Pokestop", + "IT":"Pokéstop", + "PT-BR":"TRANSLATE", + "RU":"Покестоп", + "NO":"Pokestop", + "FR":"Pokéstop" + }, + "pokestops_not_found":{ + "NL":"Error! Geen Pokestops gevonden!", + "DE":"Fehler! Keine Pokestops gefunden!", + "EN":"Error! No pokestops found!", + "IT":"Errore! Nessun Pokéstop trovato!", + "PT-BR":"Erro! Nenhum pokestops encontrado!", + "RU":"Ошибка! Покестоп не найден!", + "NO":"Feil! Ingen pokestop funnet!", + "FR":"Erreur ! Aucun Pokéstop trouvé !" + }, + "pokestops_not_found_command_text":{ + "NL":"Stuur /quest met een deel of een volledige pokestop naam.", + "DE":"Bitte /quest mit einem Teil oder dem vollständigen Namen des Pokestops aufrufen:", + "EN":"Please call /quest with a part or the complete name of the pokestop:", + "IT":"Prego usare /quest con una il nome completo di un Pokéstop o una sua parte:", + "PT-BR":"TRANSLATE", + "RU":"Введите /quest с частью или полным названием покестопа:", + "NO":"Vennligst bruk /quest med en del av navnet på pokestoppet:", + "FR":"Tape /quest avec une partie ou le nom complet d'un Pokéstop" + }, + "pokestops_not_found_command_example":{ + "NL":"/quest PokeCity Stop", + "DE":"/quest PokeStadt Stop", + "EN":"/quest PokeCity Stop", + "IT":"/quest PokéCity Stop", + "PT-BR":"/quest PokeCity Stop", + "RU":"/quest PokeCity Stop", + "NO":"/quest PokeCity Stop", + "FR":"/quest PokeCity Stop" + }, + "pokestop_added":{ + "NL":"Pokestop succesvol toegevoegd!", + "DE":"Pokestop erfolgreich hinzugefügt!", + "EN":"Successfully updated the pokestop!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "pokestop_updated":{ + "NL":"Pokestop succesvol ge-update!", + "DE":"Pokestop erfolgreich aktualisiert!", + "EN":"Successfully updated the pokestop!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "pokestop_deleted":{ + "NL":"Pokestop succesvol verwijderd!", + "DE":"Pokestop erfolgreich gelöscht!", + "EN":"Successfully deleted the pokestop!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "select_pokestop_to_delete":{ + "NL":"Selecteer een pokestop om te verwijderen:", + "DE":"Zum Löschen Pokestop auswählen:", + "EN":"Select pokestop to delete:", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "delete_this_pokestop":{ + "NL":"Wilt u echt deze pokestop verwijderen?", + "DE":"Diesen Pokestop wirklich löschen?", + "EN":"Really delete this pokestop?", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "pokestop_details":{ + "NL":"Pokestop informatie", + "DE":"Pokestop-Details", + "EN":"Pokestop details", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "select_pokestop_for_details":{ + "NL":"Selecteer een pokestop voor de informatie:", + "DE":"Pokestop auswählen, um Details anzuzeigen:", + "EN":"Select pokestop to show details:", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "pokestop_get_id_details":{ + "NL":"Om de ID en extra informatie te krijgen stuur /pokestop.", + "DE":"Die ID eines Pokestops und weitere Details sind unter /pokestop verfügbar.", + "EN":"To get the id and further pokestop details use the /pokestop command.", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "pokestop_address_instructions":{ + "NL":"Om het adres aan te passen stuur /stopaddress pokestop id, het nieuwe pokestop adres!", + "DE":"Zum Ändern einer Pokestop-Adresse bitte /stopaddress Pokestop-ID, neue Pokestop-Adresse eingeben!", + "EN":"To change the address of a pokestop please enter /stopaddress pokestop id, new pokestop address!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "pokestop_address_example":{ + "NL":"Als voorbeeld /stopaddress 34, Markt 61, 3131 CR Vlaardingen !", + "DE":"Zum Beispiel: /stopaddress 34, Großer Stern, 10557 Berlin", + "EN":"For example: /stopaddress 34, Großer Stern, 10557 Berlin!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "pokestop_address_reset":{ + "NL":"Om het pokestop adres te verwijderen stuur /stopaddress pokestop id, reset.", + "DE":"Zum Löschen einer Pokestop-Adresse /stopaddress Pokestop-ID, reset eingeben.", + "EN":"To delete a pokestop address enter /stopaddress pokestop id, reset.", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "pokestop_address_reset_example":{ + "NL":"Als voorbeeld /stopaddress 34, reset", + "DE":"Zum Beispiel: /stopaddress 34, reset", + "EN":"For example: /stopaddress 34, reset", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "pokestop_address_added":{ + "NL":"Pokestop adres succesvol toegevoegd!", + "DE":"Pokestop-Adresse erfolgreich hinzugefügt!", + "EN":"Pokestop address successfully added!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "pokestop_id_address_missing":{ + "NL":"Error! pokestop id of adres mist!", + "DE":"Fehler! Pokestop-ID oder Adresse fehlt!", + "EN":"Error! Pokestop id or address is missing!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "pokestop_address_deleted":{ + "NL":"Pokestop adres succesvol verwijderd!", + "DE":"Pokestop-Adresse erfolgreich gelöscht!", + "EN":"Pokestop address successfully deleted!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "pokestop_gps_coordinates_format_error":{ + "NL":"Error! Stuur de coordinaten in het volgende formaat: Latitude,Longitude", + "DE":"Fehler! Bitte übermittle die Koordinaten im folgenden Format: Breitengrad,Längengrad", + "EN":"Error! Please submit the coordinates in the following format: Latitude,Longitude", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "pokestop_gps_instructions":{ + "NL":"Om de pokestop coordinaten te veranderen stuur /stopgps pokestop id, nieuwe pokestop coordinaten!", + "DE":"Zum Ändern der Pokestop-Koordinaten bitte /stopgps Pokestop-ID, neue Pokestop-Koordinaten eingeben!", + "EN":"To change the coordinates of a pokestop please enter /stopgps pokestop id, new pokestop coordinates!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "pokestop_gps_example":{ + "NL":"Als voorbeeld: /stopgps 34, 51.516263,4.377755", + "DE":"Zum Beispiel: /stopgps 34, 52.516263,13.377755", + "EN":"For example: /stopgps 34, 52.516263,13.377755", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "pokestop_gps_added":{ + "NL":"Pokestop coordinaten succesvol toegevoegd!", + "DE":"Pokestop-Koordinaten erfolgreich hinzugefügt!", + "EN":"Pokestop coordinates successfully added!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "pokestop_id_gps_missing":{ + "NL":"Error! Pokestop id of coordinaten mist!", + "DE":"Fehler! Pokestop-ID oder Koordinaten fehlen!", + "EN":"Error! Pokestop id or coordinates are missing!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE", + "PL":"TRANSLATE" + }, + "pokestop_id_name_missing":{ + "NL":"Error! Pokestop id of naam mist!", + "DE":"Fehler! Pokestop-ID oder Name fehlt!", + "EN":"Error! Pokestop id or name is missing!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "pokestop_name_instructions":{ + "NL":"Om de pokestop naam aan te passen stuur /stopname pokestop id, nieuwe pokestop naam!", + "DE":"Zum Ändern eines Pokestop-Names bitte /stopname Pokestop-ID, neuer Pokestop-Name eingeben!", + "EN":"To change the name of a pokestop please enter /stopname pokestop id, new pokestop name!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "pokestop_name_example":{ + "NL":"Als voorbeeld /stopname 34, Markt 61, 3131 CR Vlaardingen !", + "DE":"Zum Beispiel: /stopname 34, Wasserfall im Park", + "EN":"For example: /stopname 34, Waterfall in the park!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "pokestop_name_updated":{ + "NL":"Pokestop naam aangepast.", + "DE":"Der Pokestop-Name wurde aktualisiert.", + "EN":"Pokestop name updated.", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "unnamed_pokestop":{ + "NL":"Onbekende pokestop", + "DE":"Unbekannter Pokestop", + "EN":"Unknown Pokestop", + "IT":"Pokéstop sconosciuto", + "PT-BR":"TRANSLATE", + "RU":"Неизвестный покестоп", + "NO":"Ukjent Pokestop", + "FR":"Pokéstop inconnu" + }, + "invasion_by_pokestop":{ + "NL":"Deel een Team R invasie via de volgende pokestop:", + "DE":"Teile eine Team Rocket Invasion mittels Pokestop-Auswahl:", + "EN":"Share a Team Rocket invasion via pokestop selection:", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "add_this_invasion":{ + "NL":"Deze informatie toevoegen?", + "DE":"Diese Invasion hinzufügen?", + "EN":"Add this invasion?", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "Rm":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "add_this_info_to_invasion":{ + "NL":"Team R invasie toevoegen?", + "DE":"Diese Information zur Team Rocket Invasion hinzufügen?", + "EN":"Add this info to the Team Rocket invasion?", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "Rm":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "invasion_select_time":{ + "NL":"Hoe lang zit de Team R invasie er nog? Selecteer een kleiner getal als je het niet zeker weet!", + "DE":"Wie viele Minuten wird die Team Rocket Invasion da sein? Wähle die kleinere Zahl, wenn du dir unsicher bist!", + "EN":"How many minutes will the Team Rocket invasion be there? Select the smaller number if you're unsure!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "invasion_expected_time":{ + "NL":"Verwachte Team R invasie tijd:", + "DE":"Erwartete Team Rocket Invasionszeit:", + "EN":"Expected Team Rocket invasion time:", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "invasion_saved":{ + "NL":"Team R invasie opgeslagen:", + "DE":"Team Rocket Invasion gespeichert:", + "EN":"Team Rocket Invasion saved:", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "invasion_crypto_instructions":{ + "NL":"Optional - Extra informatie toevoegen aan de Team R invasie pokemon:\n/crypto Snorlax", + "DE":"Optional - Info wie das Crypto-Pokemon hinzufügen:\n/crypto Relaxo", + "EN":"Optional - Add an info like the crypto pokemon:\n/crypto Snorlax", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "Rm":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "invasion_already_submitted":{ + "NL":"Team R invasie voor deze pokestop is al toegevoegd!", + "DE":"Team Rocket Invasion für diesen Pokestop ist bereits vorhanden!", + "EN":"Team Rocket Invasion for this pokestop was already submitted!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "delete_this_invasion":{ + "NL":"Verwijder deze Team R invasie?", + "DE":"Diese Team Rocket Invasion wirklich löschen?", + "EN":"Really delete this Team Rocket invasion?", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "invasion_successfully_deleted":{ + "NL":"Team R invasie succesvol verwijderd!", + "DE":"Team Rocket Invasion wurde erfolgreich gelöscht!", + "EN":"Team Rocket Invasion was successfully deleted!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "invasions_currently":{ + "NL":"Huidige Team R invasies:", + "DE":"Aktuelle Team Rocket Invasionen:", + "EN":"Current Team Rocket invasions:", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "no_invasions_currently":{ + "NL":"Er zijn geen huidige Team R invasies!", + "DE":"Aktuell gibt es keine Team Rocket Invasionen!", + "EN":"Currently there are no Team Rocket invasions!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "until_approx":{ + "NL":"Tot ongeveer", + "DE":"bis ca.", + "EN":"until approx.", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "quest_by_pokestop":{ + "NL":"Maak een quest, selecteer een pokestop:", + "DE":"Lege eine Forschung per Pokestop-Auswahl an:", + "EN":"Make a quest per pokestop selection:", + "IT":"Crea una spedizione per il Pokéstop selezionato:", + "PT-BR":"TRANSLATE", + "RU":"Создать квест для выбранного покестопа:", + "NO":"Lag en quest per pokestop valg", + "FR":"Sélectionner une quête pour un Pokéstop" + }, + "quest_select_type":{ + "NL":"Selecteer een quest type:", + "DE":"Art der Forschung auswählen:", + "EN":"Select the quest type:", + "IT":"Seleziona il tipo di spedizione:", + "PT-BR":"TRANSLATE", + "RU":"Выберите тип квеста:", + "NO":"Velg quest type", + "FR":"Sélectionne le type de quête" + }, + "quest_select_qty_action":{ + "NL":"Selecteer de taak van de quest:", + "DE":"Aufgabe der Forschung auswählen:", + "EN":"Select the task of the quest:", + "IT":"Seleziona l'obiettivo della spedizione:", + "PT-BR":"TRANSLATE", + "RU":"Выберите задание квеста:", + "NO":"Velg hvilket oppdrag som er her:", + "FR":"Sélectionne la tâche de la quête" + }, + "quest_select_qty":{ + "NL":"Selecteer de hoeveelheid van de quest:", + "DE":"Anzahl der Forschung auswählen:", + "EN":"Select the quantity of the quest:", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "quest_saved":{ + "NL":"Quest opgeslagen:", + "DE":"Forschung gespeichert:", + "EN":"Quest saved:", + "IT":"Spedizione salvata:", + "PT-BR":"TRANSLATE", + "RU":"Сохраненный квест:", + "NO":"Oppdrag lagret:", + "FR":"Quête sauvegardée" + }, + "quests_today":{ + "NL":"De quests van vandaag:", + "DE":"Heutige Forschungen:", + "EN":"Today's quests:", + "IT":"Spedizioni di oggi:", + "PT-BR":"TRANSLATE", + "RU":"Сегодняшние квесты:", + "NO":"Dagens oppdrag:", + "FR":"Les quêtes du jour" + }, + "no_quests_today":{ + "NL":"Vandaag zijn er nog geen quests!", + "DE":"Heute gibt es noch keine Forschungen!", + "EN":"Today there are no quests yet!", + "IT":"Non sono ancora presenti spedizioni per oggi!", + "PT-BR":"TRANSLATE", + "RU":"Сегодня здесь еще нет квестов!", + "NO":"Ingen oppdrag er registrert i dag!", + "FR":"Il n'y a aucune quête aujourd'hui pour l'instant !" + }, + "quest_already_submitted":{ + "NL":"Quest voor deze pokestop is al aangemeld!", + "DE":"Forschung für diesen Pokestop ist bereits vorhanden!", + "EN":"Quest for this pokestop was already submitted!", + "IT":"La spedizione per questo Pokéstop è stata già inserita!", + "PT-BR":"TRANSLATE", + "RU":"Квест для этого покестопа уже был отправлен!", + "NO":"Det er allerede registrert ett oppdrag på dette pokestoppet", + "FR":"La quête pour ce Pokéstop a déjà été soumise" + }, + "select_quest_to_delete":{ + "NL":"Selecteer een queest om te verwijderen:", + "DE":"Zum Löschen Forschung auswählen:", + "EN":"Select quest to delete:", + "IT":"Seleziona la spedizione da eliminare:", + "PT-BR":"TRANSLATE", + "RU":"Выберите квест для удаления:", + "NO":"Velg hvilket oppdrag som skal slettes:", + "FR":"Sélectionne la quête à supprimer" + }, + "pokemon_not_found":{ + "NL":"Geen Pokemon gevonden!", + "DE":"Keine Pokemon gefunden!", + "EN":"No Pokemon found!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "add_this_quest":{ + "NL":"Deze quest toevoegen?", + "DE":"Diese Forschung hinzufügen?", + "EN":"Add this quest?", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "Rm":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "quest_successfully_saved":{ + "NL":"Quest is succesvol toegevoegd!", + "DE":"Forschung wurde erfolgreich hinzugefügt!", + "EN":"Quest was added successfully!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "delete_this_quest":{ + "NL":"Weet u het zeker dat u deze quest wilt verwijderen?", + "DE":"Diese Forschung wirklich löschen?", + "EN":"Really delete this quest?", + "IT":"Vuoi veramente eliminare questa spedizione?", + "PT-BR":"TRANSLATE", + "RU":"Действительно удалить этот квест?", + "NO":"Vil du virkelig at jeg skal slette dette oppdraget?", + "FR":"Veux-tu vraiment supprimer cette quête ?" + }, + "quest_deletion_was_canceled":{ + "NL":"Verwijderen van de quest is geannuleerd!", + "DE":"Löschung der Forschung wurde abgebrochen!", + "EN":"Deletion of the quest was canceled!", + "IT":"L'eliminazione della spedizione è stata annullata!", + "PT-BR":"TRANSLATE", + "RU":"Удаление этого квеста отменено!", + "NO":"Sletting av oppdraget ble avbrutt!", + "FR":"La suppression de la quête à été annulée" + }, + "quest_successfully_deleted":{ + "NL":"Quest is succesvol verwijderd!", + "DE":"Forschung wurde erfolgreich gelöscht!", + "EN":"Quest was successfully deleted!", + "IT":"La spedizione è stata eliminata con successo!", + "PT-BR":"TRANSLATE", + "RU":"Квест успешно удален", + "NO":"Oppdraget ble slettet!", + "FR":"La quête à été supprimée avec succès !" + }, + "encounter_successfully_saved":{ + "NL":"Pokemon encouter is succesvol opgeslagen!", + "DE":"Pokemon-Begegnung wurde erfolgreich gespeichert!", + "EN":"Pokemon encounter was saved successfully!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "delete_this_encounter":{ + "NL":"Weet u het zeker dat u de pokemon encouter wil verwijderen?", + "DE":"Diese Pokemon-Begegnung wirklich löschen?", + "EN":"Really delete this pokemon encounter?", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "Rm":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "encounter_deletion_was_canceled":{ + "NL":"Het verwijderen van de pokemon encouter is gestopt!", + "DE":"Löschung der Pokemon-Begegnung wurde abgebrochen!", + "EN":"Deletion of the pokemon encounter was canceled!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "encounter_successfully_deleted":{ + "NL":"Pokemon encouter is succesvol verwijderd!", + "DE":"Pokemon-Begegnung wurde erfolgreich gelöscht!", + "EN":"Pokemon encounter was successfully deleted!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "add_this_reward":{ + "NL":"Deze beloning toevoegen?", + "DE":"Diese Belohnung hinzufügen?", + "EN":"Add this reward?", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "Rm":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "delete_this_reward":{ + "NL":"Weet u het zeker dat u de beloning wil verwijdren?", + "DE":"Diese Belohnung wirklich löschen?", + "EN":"Really delete this reward?", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "Rm":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "available_rewards":{ + "NL":"Deze beloningen zijn beschikbaar:", + "DE":"Bereits verfügbare Belohnungen:", + "EN":"Already available rewards:", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "Rm":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "reward_deletion_was_canceled":{ + "NL":"Het verwijdern van deze beloning is geannuleerd!", + "DE":"Löschung der Belohnung wurde abgebrochen!", + "EN":"Deletion of the reward was canceled!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "reward_successfully_deleted":{ + "NL":"Beloning was succesvol verwijderd!", + "DE":"Belohnung wurde erfolgreich gelöscht!", + "EN":"Reward was successfully deleted!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "reward_successfully_saved":{ + "NL":"Beloning was succesvol toegevoegd!", + "DE":"Belohnung wurde erfolgreich hinzugefügt!", + "EN":"Reward was added successfully!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "delete_this_quicklist_entry":{ + "NL":"Weet u het zeker dat u deze quicklist wil verwijderen?", + "DE":"Diesen Eintrag der Schnellauswahl wirklich löschen?", + "EN":"Really delete this quicklist entry?", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "Rm":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "quicklist_entry_addition_was_canceled":{ + "NL":"Het toevoegen van de quest aan de quicklist is geannuleerd!", + "DE":"Hinzufügen der Forschung zur Schnellauswahl wurde abgebrochen!", + "EN":"Adding the quest to the quicklist was canceled!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "quicklist_entry_deletion_was_canceled":{ + "NL":"Het verwijderen van de quicklist is geannuleerd!", + "DE":"Löschung des Eintrags der Schnellauswahl wurde abgebrochen!", + "EN":"Deletion of the quicklist entry was canceled!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "quicklist_entry_successfully_added":{ + "NL":"Quest is succesvol toegevoegd aan de quicklist!", + "DE":"Forschung erfolgreich zur Schnellauswahl hinzugefügt!", + "EN":"Quest was successfully added to the quicklist!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "quicklist_entry_successfully_deleted":{ + "NL":"De quicklist quest is succesvol verwijderd!", + "DE":"Eintrag der Schnellauswahl wurde erfolgreich gelöscht!", + "EN":"Quicklist entry was successfully deleted!", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "add_this_quest_to_quicklist":{ + "NL":"Deze quest toevoegen aan de quicklist?", + "DE":"Diese Forschung zur Schnellauswahl hinzufügen?", + "EN":"Add this quest to the quicklist?", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "Rm":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "add_this_encounter":{ + "NL":"Deze pokemon encouter toevoegen?", + "DE":"Diese Pokemon-Begegnung hinzufügen?", + "EN":"Add this pokemon encounter?", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "Rm":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "edit_this_encounter":{ + "NL":"Weet u het zeker dat u de pokemon encouter wil aanpassen?", + "DE":"Diese Pokemon-Begegnung wirklich bearbeiten?", + "EN":"Really edit this pokemon encounter?", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "Rm":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "reward":{ + "NL":"Beloning", + "DE":"Belohnung", + "EN":"Reward", + "IT":"Ricompensa", + "PT-BR":"TRANSLATE", + "RU":"Награда", + "NO":"Belønning", + "FR":"Récompense" + }, + "reward_select_type":{ + "NL":"Selecteer het type beloning:", + "DE":"Art der Belohnung auswählen:", + "EN":"Select the reward type:", + "IT":"Seleziona il tipo di ricompensa:", + "PT-BR":"TRANSLATE", + "RU":"Выберите тип награды:", + "NO":"Velg type belønning:", + "FR":"Sélectionne le type de récompense" + }, + "reward_select_qty_reward":{ + "NL":"Selecteer de beloning:", + "DE":"Belohnung auswählen:", + "EN":"Select reward:", + "IT":"Seleziona ricompensa:", + "PT-BR":"TRANSLATE", + "RU":"Выберите нагарду:", + "NO":"Velg belønning:", + "FR":"Sélectionne la récompense" + }, + "quest_access_denied":{ + "NL":"Je hebt geen rechten om deze quest aan te passen!", + "DE":"Sie haben keine Berechtigung diese Forschung zu bearbeiten!", + "EN":"You are not allowed to edit this quest!", + "IT":"Non sei autorizzato a modificare questa Spedizione!", + "PT-BR":"Você não tem permissão para editar esta quest!", + "RU":"Вы не можете редактировать этот квест!", + "NO":"Du har ikke tillatelse til å redigere dette oppdraget!", + "FR":"Tu n'es pas autorisé à modifier cette quête !" + }, + "coordination_succes":{ + "NL":"Coördinatie geslaagd!", + "DE":"Koordinaten erfolgreich übermittelt!", + "EN":"Coordinates successfully submitted!", + "IT":"Coordinate inserite con successo!", + "PT-BR":"Coordenadas enviadas com sucesso!", + "RU":"Координаты успешно отправлены!", + "NO":"Koordinater ble lagt til!", + "FR":"Les coordonnées ont été soumises avec succès !" + }, + "send_location":{ + "NL":"Of stuur me alsjeblieft een locatie.", + "DE":"Oder sende mir einen Standort.", + "EN":"Or send me a location.", + "IT":"O inviami una localizzazione.", + "PT-BR":"Por favor, antes me envie a localização.", + "RU":"Или отправить мне локацию", + "NO":"Eller send meg lokasjonen din ved å trykke på bindersen", + "FR":"Ou envoie moi la localisation." + }, + "edit_quests_encounters_rewards_quicklist":{ + "NL":"Edit quests, beloning, pokemon encounters en quest quicklist:", + "DE":"Forschungen, Belohnungen, Pokemon-Begegnungen und Quest-Schnellauswahl bearbeiten:", + "EN":"Edit quests, rewards, pokemon encounters and quest quicklist entries:", + "IT":"TRANSLATE.", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "selected_pokemon":{ + "NL":"Geselecteerde Pokemon:", + "DE":"Aktuell ausgewählte Pokemon:", + "EN":"Currently selected pokemon:", + "IT":"TRANSLATE.", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "selected_pokemon_types":{ + "NL":"Geselecteerde pokemon type:", + "DE":"Aktuell ausgewählte Pokemon-Typen:", + "EN":"Currently selected pokemon types:", + "IT":"TRANSLATE.", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "select_id_to_add":{ + "NL":"Kies ID om toe te voegen:", + "DE":"ID auswählen zum Hinzufügen:", + "EN":"Select ID to add:", + "IT":"TRANSLATE.", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "select_id_to_edit":{ + "NL":"Kies ID om te wijzigen:", + "DE":"ID auswählen zum Bearbeiten:", + "EN":"Select ID to edit:", + "IT":"TRANSLATE.", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "select_id_to_delete":{ + "NL":"Kies ID om te verwijderen:", + "DE":"ID auswählen zum Löschen:", + "EN":"Select ID to delete:", + "IT":"TRANSLATE.", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "pokemon_of_type":{ + "NL":"POKEMON_TYPE-type pokemon", + "DE":"Pokemon vom Typ POKEMON_TYPE", + "EN":"POKEMON_TYPE-type pokemon", + "IT":"TRANSLATE.", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "encounter":{ + "NL":"Pokemon encounter", + "DE":"Pokemon-Begegnung", + "EN":"Pokemon encounter", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" + }, + "quicklist":{ + "NL":"Quicklist", + "DE":"Schnellauswahl", + "EN":"Quicklist", + "IT":"TRANSLATE", + "PT-BR":"TRANSLATE", + "RU":"TRANSLATE", + "NO":"TRANSLATE", + "FR":"TRANSLATE" } } - diff --git a/lang/pokemon_de.json b/lang/pokemon_de.json deleted file mode 100644 index f701b35..0000000 --- a/lang/pokemon_de.json +++ /dev/null @@ -1,804 +0,0 @@ -[ - "Bisasam", - "Bisaknosp", - "Bisaflor", - "Glumanda", - "Glutexo", - "Glurak", - "Schiggy", - "Schillok", - "Turtok", - "Raupy", - "Safcon", - "Smettbo", - "Hornliu", - "Kokuna", - "Bibor", - "Taubsi", - "Tauboga", - "Tauboss", - "Rattfratz", - "Rattikarl", - "Habitak", - "Ibitak", - "Rettan", - "Arbok", - "Pikachu", - "Raichu", - "Sandan", - "Sandamer", - "Nidoran♀", - "Nidorina", - "Nidoqueen", - "Nidoran♂", - "Nidorino", - "Nidoking", - "Piepi", - "Pixi", - "Vulpix", - "Vulnona", - "Pummeluff", - "Knuddeluff", - "Zubat", - "Golbat", - "Myrapla", - "Duflor", - "Giflor", - "Paras", - "Parasek", - "Bluzuk", - "Omot", - "Digda", - "Digdri", - "Mauzi", - "Snobilikat", - "Enton", - "Entoron", - "Menki", - "Rasaff", - "Fukano", - "Arkani", - "Quapsel", - "Quaputzi", - "Quappo", - "Abra", - "Kadabra", - "Simsala", - "Machollo", - "Maschock", - "Machomei", - "Knofensa", - "Ultrigaria", - "Sarzenia", - "Tentacha", - "Tentoxa", - "Kleinstein", - "Georok", - "Geowaz", - "Ponita", - "Gallopa", - "Flegmon", - "Lahmus", - "Magnetilo", - "Magneton", - "Porenta", - "Dodu", - "Dodri", - "Jurob", - "Jugong", - "Sleima", - "Sleimok", - "Muschas", - "Austos", - "Nebulak", - "Alpollo", - "Gengar", - "Onix", - "Traumato", - "Hypno", - "Krabby", - "Kingler", - "Voltobal", - "Lektrobal", - "Owei", - "Kokowei", - "Tragosso", - "Knogga", - "Kicklee", - "Nockchan", - "Schlurp", - "Smogon", - "Smogmog", - "Rihorn", - "Rizeros", - "Chaneira", - "Tangela", - "Kangama", - "Seeper", - "Seemon", - "Goldini", - "Golking", - "Sterndu", - "Starmie", - "Pantimos", - "Sichlor", - "Rossana", - "Elektek", - "Magmar", - "Pinsir", - "Tauros", - "Karpador", - "Garados", - "Lapras", - "Ditto", - "Evoli", - "Aquana", - "Blitza", - "Flamara", - "Porygon", - "Amonitas", - "Amoroso", - "Kabuto", - "Kabutops", - "Aerodactyl", - "Relaxo", - "Arktos", - "Zapdos", - "Lavados", - "Dratini", - "Dragonir", - "Dragoran", - "Mewtu", - "Mew", - "Endivie", - "Lorblatt", - "Meganie", - "Feurigel", - "Igelavar", - "Tornupto", - "Karnimani", - "Tyracroc", - "Impergator", - "Wiesor", - "Wiesenior", - "Hoothoot", - "Noctuh", - "Ledyba", - "Ledian", - "Webarak", - "Ariados", - "Iksbat", - "Lampi", - "Lanturn", - "Pichu", - "Pii", - "Fluffeluff", - "Togepi", - "Togetic", - "Natu", - "Xatu", - "Voltilamm", - "Waaty", - "Ampharos", - "Blubella", - "Marill", - "Azumarill", - "Mogelbaum", - "Quaxo", - "Hoppspross", - "Hubelupf", - "Papungha", - "Griffel", - "Sonnkern", - "Sonnflora", - "Yanma", - "Felino", - "Morlord", - "Psiana", - "Nachtara", - "Kramurx", - "Laschoking", - "Traunfugil", - "Icognito", - "Woingenau", - "Girafarig", - "Tannza", - "Forstellka", - "Dummisel", - "Skorgla", - "Stahlos", - "Snubbull", - "Granbull", - "Baldorfish", - "Scherox", - "Pottrott", - "Skaraborn", - "Sniebel", - "Teddiursa", - "Ursaring", - "Schneckmag", - "Magcargo", - "Quiekel", - "Keifel", - "Corasonn", - "Remoraid", - "Octillery", - "Botogel", - "Mantax", - "Panzaeron", - "Hunduster", - "Hundemon", - "Seedraking", - "Phanpy", - "Donphan", - "Porygon2", - "Damhirplex", - "Farbeagle", - "Rabauz", - "Kapoera", - "Kussilla", - "Elekid", - "Magby", - "Miltank", - "Heiteira", - "Raikou", - "Entei", - "Suicune", - "Larvitar", - "Pupitar", - "Despotar", - "Lugia", - "Ho-Oh", - "Celebi", - "Geckarbor", - "Reptain", - "Gewaldro", - "Flemmli", - "Jungglut", - "Lohgock", - "Hydropi", - "Moorabbel", - "Sumpex", - "Fiffyen", - "Magnayen", - "Zigzachs", - "Geradaks", - "Waumpel", - "Schaloko", - "Papinella", - "Panekon", - "Pudox", - "Loturzel", - "Lombrero", - "Kappalores", - "Samurzel", - "Blanas", - "Tengulist", - "Schwalbini", - "Schwalboss", - "Wingull", - "Pelipper", - "Trasla", - "Kirlia", - "Guardevoir", - "Gehweiher", - "Maskeregen", - "Knilz", - "Kapilz", - "Bummelz", - "Muntier", - "Letarking", - "Nincada", - "Ninjask", - "Ninjatom", - "Flurmel", - "Krakeelo", - "Krawumms", - "Makuhita", - "Hariyama", - "Azurill", - "Nasgnet", - "Eneco", - "Enekoro", - "Zobiris", - "Flunkifer", - "Stollunior", - "Stollrak", - "Stolloss", - "Meditie", - "Meditalis", - "Frizelbliz", - "Voltenso", - "Plusle", - "Minun", - "Volbeat", - "Illumise", - "Roselia", - "Schluppuck", - "Schlukwech", - "Kanivanha", - "Tohaido", - "Wailmer", - "Wailord", - "Camaub", - "Camerupt", - "Qurtel", - "Spoink", - "Groink", - "Pandir", - "Knacklion", - "Vibrava", - "Libelldra", - "Tuska", - "Noktuska", - "Wablu", - "Altaria", - "Sengo", - "Vipitis", - "Lunastein", - "Sonnfel", - "Schmerbe", - "Welsar", - "Krebscorps", - "Krebutack", - "Puppance", - "Lepumentas", - "Liliep", - "Wielie", - "Anorith", - "Armaldo", - "Barschwa", - "Milotic", - "Formeo", - "Kecleon", - "Shuppet", - "Banette", - "Zwirrlicht", - "Zwirrklop", - "Tropius", - "Palimpalim", - "Absol", - "Isso", - "Schneppke", - "Firnontor", - "Seemops", - "Seejong", - "Walraisa", - "Perlu", - "Aalabyss", - "Saganabyss", - "Relicanth", - "Liebiskus", - "Kindwurm", - "Draschel", - "Brutalanda", - "Tanhel", - "Metang", - "Metagross", - "Regirock", - "Regice", - "Registeel", - "Latias", - "Latios", - "Kyogre", - "Groudon", - "Rayquaza", - "Jirachi", - "Deoxys", - "Chelast", - "Chelcarain", - "Chelterrar", - "Panflam", - "Panpyro", - "Panferno", - "Plinfa", - "Pliprin", - "Impoleon", - "Staralili", - "Staravia", - "Staraptor", - "Bidiza", - "Bidifas", - "Zirpurze", - "Zirpeise", - "Sheinux", - "Luxio", - "Luxtra", - "Knospi", - "Roserade", - "Koknodon", - "Rameidon", - "Schilterus", - "Bollterus", - "Burmy", - "Burmadame", - "Moterpel", - "Wadribie", - "Honweisel", - "Pachirisu", - "Bamelin", - "Bojelin", - "Kikugi", - "Kinoso", - "Schalellos", - "Gastrodon", - "Ambidiffel", - "Driftlon", - "Drifzepeli", - "Haspiror", - "Schlapor", - "Traunmagil", - "Kramshef", - "Charmian", - "Shnurgarst", - "Klingplim", - "Skunkapuh", - "Skunktank", - "Bronzel", - "Bronzong", - "Mobai", - "Pantimimi", - "Wonneira", - "Plaudagei", - "Kryppuk", - "Kaumalat", - "Knarksel", - "Knakrack", - "Mampfaxo", - "Riolu", - "Lucario", - "Hippopotas", - "Hippoterus", - "Pionskora", - "Piondragi", - "Glibunkel", - "Toxiquak", - "Venuflibis", - "Finneon", - "Lumineon", - "Mantirps", - "Shnebedeck", - "Rexblisar", - "Snibunna", - "Magnezone", - "Schlurplek", - "Rihornior", - "Tangoloss", - "Elevoltek", - "Magbrant", - "Togekiss", - "Yanmega", - "Folipurba", - "Glaziola", - "Skorgro", - "Mamutel", - "Porygon-Z", - "Galagladi", - "Voluminas", - "Zwirrfinst", - "Frosdedje", - "Rotom", - "Selfe", - "Vesprit", - "Tobutz", - "Dialga", - "Palkia", - "Heatran", - "Regigigas", - "Giratina", - "Cresselia", - "Phione", - "Manaphy", - "Darkrai", - "Shaymin", - "Arceus", - "Victini", - "Serpifeu", - "Efoserp", - "Serpiroyal", - "Floink", - "Ferkokel", - "Flambirex", - "Ottaro", - "Zwottronin", - "Admurai", - "Nagelotz", - "Kukmarda", - "Yorkleff", - "Terribark", - "Bissbark", - "Felilou", - "Kleoparda", - "Vegimak", - "Vegichita", - "Grillmak", - "Grillchita", - "Sodamak", - "Sodachita", - "Somniam", - "Somnivora", - "Dusselgurr", - "Navitaub", - "Fasasnob", - "Elezeba", - "Zebritz", - "Kiesling", - "Sedimantur", - "Brockoloss", - "Fleknoil", - "Fletiamo", - "Rotomurf", - "Stalobor", - "Ohrdoch", - "Praktibalk", - "Strepoli", - "Meistagrif", - "Schallquap", - "Mebrana", - "Branawarz", - "Jiutesto", - "Karadonis", - "Strawickl", - "Folikon", - "Matrifol", - "Toxiped", - "Rollum", - "Cerapendra", - "Waumboll", - "Elfun", - "Lilminip", - "Dressella", - "Barschuft", - "Ganovil", - "Rokkaiman", - "Rabigator", - "Flampion", - "Flampivian", - "Maracamba", - "Lithomith", - "Castellith", - "Zurrokex", - "Irokex", - "Symvolara", - "Makabaja", - "Echnatoll", - "Galapaflos", - "Karippas", - "Flapteryx", - "Aeropteryx", - "Unratütox", - "Deponitox", - "Zorua", - "Zoroark", - "Picochilla", - "Chillabell", - "Mollimorba", - "Hypnomorba", - "Morbitesse", - "Monozyto", - "Mitodos", - "Zytomega", - "Piccolente", - "Swaroness", - "Gelatini", - "Gelatroppo", - "Gelatwino", - "Sesokitz", - "Kronjuwild", - "Emolga", - "Laukaps", - "Cavalanzas", - "Tarnpignon", - "Hutsassa", - "Quabbel", - "Apoquallyp", - "Mamolida", - "Wattzapf", - "Voltula", - "Kastadur", - "Tentantel", - "Klikk", - "Kliklak", - "Klikdiklak", - "Zapplardin", - "Zapplalek", - "Zapplarang", - "Pygraulon", - "Megalon", - "Lichtel", - "Laternecto", - "Skelabra", - "Milza", - "Sharfax", - "Maxax", - "Petznief", - "Siberio", - "Frigometri", - "Schnuthelm", - "Hydragil", - "Flunschlik", - "Fu", - "Shu", - "Shardrago", - "Golbit", - "Golgantes", - "Gladiantri", - "Caesurio", - "Bisofank", - "Geronimatz", - "Washakwil", - "Skallyk", - "Grypheldis", - "Furnifraß", - "Fermicula", - "Kapuno", - "Duodino", - "Trikephalo", - "Ignivor", - "Ramoth", - "Kobalium", - "Terrakium", - "Viridium", - "Boreos", - "Voltolos", - "Reshiram", - "Zekrom", - "Demeteros", - "Kyurem", - "Keldeo", - "Meloetta", - "Genesect", - "Igamaro", - "Igastarnish", - "Brigaron", - "Fynx", - "Rutena", - "Fennexis", - "Froxy", - "Amphizel", - "Quajutsu", - "Scoppel", - "Grebbit", - "Dartiri", - "Dartignis", - "Fiaro", - "Purmel", - "Puponcho", - "Vivillon", - "Leufeo", - "Pyroleo", - "Flabébé", - "Floette", - "Florges", - "Mähikel", - "Chevrumm", - "Pam", - "Pandagro", - "Coiffwaff", - "Psiau", - "Psiaugon", - "Gramokles", - "Duokles", - "Durengard", - "Parfi", - "Parfinesse", - "Flauschling", - "Sabbaione", - "Iscalar", - "Calamanero", - "Bithora", - "Thanathora", - "Algitt", - "Tandrak", - "Scampisto", - "Wummer", - "Eguana", - "Elezard", - "Balgoras", - "Monargoras", - "Amarino", - "Amagarga", - "Feelinara", - "Resladero", - "Dedenne", - "Rocara", - "Viscora", - "Viscargot", - "Viscogon", - "Clavion", - "Paragoni", - "Trombork", - "Irrbis", - "Pumpdjinn", - "Arktip", - "Arktilas", - "eF-eM", - "UHaFnir", - "Xerneas", - "Yveltal", - "Zygarde", - "Diancie", - "Hoopa", - "Volcanion", - "Bauz", - "Arboretoss", - "Silvarro", - "Flamiau", - "Miezunder", - "Fuegro", - "Robball", - "Marikeck", - "Primarene", - "Peppeck", - "Trompeck", - "Tukanon", - "Mangunior", - "Manguspektor", - "Mabula", - "Akkup", - "Donarion", - "Krabbox", - "Krawell", - "Choreogel", - "Wommel", - "Bandelby", - "Wuffels", - "Wolwerock", - "Lusardin", - "Garstella", - "Aggrostella", - "Pampuli", - "Pampross", - "Araqua", - "Aranestro", - "Imantis", - "Mantidea", - "Bubungus", - "Lamellux", - "Molunk", - "Amfira", - "Velursi", - "Kosturso", - "Frubberl", - "Frubaila", - "Fruyal", - "Curelei", - "Kommandutan", - "Quartermak", - "Reißlaus", - "Tectass", - "Sankabuh", - "Colossand", - "Gufa", - "Typ:Null", - "Amigento", - "Meteno", - "Koalelu", - "Tortunator", - "Togedemaru", - "Mimigma", - "Knirfish", - "Sen-Long", - "Moruda", - "Miniras", - "Mediras", - "Grandiras", - "Kapu-Riki", - "Kapu-Fala", - "Kapu-Toro", - "Kapu-Kime", - "Cosmog", - "Cosmovum", - "Solgaleo", - "Lunala", - "Anego", - "Masskito", - "Schabelle", - "Voltriant", - "Kaguron", - "Katagami", - "Schlingking", - "Necrozma", - "Magearna", - "Marshadow" -] diff --git a/lang/pokemon_en.json b/lang/pokemon_en.json deleted file mode 100644 index 9eab0ae..0000000 --- a/lang/pokemon_en.json +++ /dev/null @@ -1,804 +0,0 @@ -[ - "Bulbasaur", - "Ivysaur", - "Venusaur", - "Charmander", - "Charmeleon", - "Charizard", - "Squirtle", - "Wartortle", - "Blastoise", - "Caterpie", - "Metapod", - "Butterfree", - "Weedle", - "Kakuna", - "Beedrill", - "Pidgey", - "Pidgeotto", - "Pidgeot", - "Rattata", - "Raticate", - "Spearow", - "Fearow", - "Ekans", - "Arbok", - "Pikachu", - "Raichu", - "Sandshrew", - "Sandslash", - "Nidoran♀", - "Nidorina", - "Nidoqueen", - "Nidoran♂", - "Nidorino", - "Nidoking", - "Clefairy", - "Clefable", - "Vulpix", - "Ninetales", - "Jigglypuff", - "Wigglytuff", - "Zubat", - "Golbat", - "Oddish", - "Gloom", - "Vileplume", - "Paras", - "Parasect", - "Venonat", - "Venomoth", - "Diglett", - "Dugtrio", - "Meowth", - "Persian", - "Psyduck", - "Golduck", - "Mankey", - "Primeape", - "Growlithe", - "Arcanine", - "Poliwag", - "Poliwhirl", - "Poliwrath", - "Abra", - "Kadabra", - "Alakazam", - "Machop", - "Machoke", - "Machamp", - "Bellsprout", - "Weepinbell", - "Victreebel", - "Tentacool", - "Tentacruel", - "Geodude", - "Graveler", - "Golem", - "Ponyta", - "Rapidash", - "Slowpoke", - "Slowbro", - "Magnemite", - "Magneton", - "Farfetch’d", - "Doduo", - "Dodrio", - "Seel", - "Dewgong", - "Grimer", - "Muk", - "Shellder", - "Cloyster", - "Gastly", - "Haunter", - "Gengar", - "Onix", - "Drowzee", - "Hypno", - "Krabby", - "Kingler", - "Voltorb", - "Electrode", - "Exeggcute", - "Exeggutor", - "Cubone", - "Marowak", - "Hitmonlee", - "Hitmonchan", - "Lickitung", - "Koffing", - "Weezing", - "Rhyhorn", - "Rhydon", - "Chansey", - "Tangela", - "Kangaskhan", - "Horsea", - "Seadra", - "Goldeen", - "Seaking", - "Staryu", - "Starmie", - "Mr. Mime", - "Scyther", - "Jynx", - "Electabuzz", - "Magmar", - "Pinsir", - "Tauros", - "Magikarp", - "Gyarados", - "Lapras", - "Ditto", - "Eevee", - "Vaporeon", - "Jolteon", - "Flareon", - "Porygon", - "Omanyte", - "Omastar", - "Kabuto", - "Kabutops", - "Aerodactyl", - "Snorlax", - "Articuno", - "Zapdos", - "Moltres", - "Dratini", - "Dragonair", - "Dragonite", - "Mewtwo", - "Mew", - "Chikorita", - "Bayleef", - "Meganium", - "Cyndaquil", - "Quilava", - "Typhlosion", - "Totodile", - "Croconaw", - "Feraligatr", - "Sentret", - "Furret", - "Hoothoot", - "Noctowl", - "Ledyba", - "Ledian", - "Spinarak", - "Ariados", - "Crobat", - "Chinchou", - "Lanturn", - "Pichu", - "Cleffa", - "Igglybuff", - "Togepi", - "Togetic", - "Natu", - "Xatu", - "Mareep", - "Flaaffy", - "Ampharos", - "Bellossom", - "Marill", - "Azumarill", - "Sudowoodo", - "Politoed", - "Hoppip", - "Skiploom", - "Jumpluff", - "Aipom", - "Sunkern", - "Sunflora", - "Yanma", - "Wooper", - "Quagsire", - "Espeon", - "Umbreon", - "Murkrow", - "Slowking", - "Misdreavus", - "Unown", - "Wobbuffet", - "Girafarig", - "Pineco", - "Forretress", - "Dunsparce", - "Gligar", - "Steelix", - "Snubbull", - "Granbull", - "Qwilfish", - "Scizor", - "Shuckle", - "Heracross", - "Sneasel", - "Teddiursa", - "Ursaring", - "Slugma", - "Magcargo", - "Swinub", - "Piloswine", - "Corsola", - "Remoraid", - "Octillery", - "Delibird", - "Mantine", - "Skarmory", - "Houndour", - "Houndoom", - "Kingdra", - "Phanpy", - "Donphan", - "Porygon2", - "Stantler", - "Smeargle", - "Tyrogue", - "Hitmontop", - "Smoochum", - "Elekid", - "Magby", - "Miltank", - "Blissey", - "Raikou", - "Entei", - "Suicune", - "Larvitar", - "Pupitar", - "Tyranitar", - "Lugia", - "Ho-Oh", - "Celebi", - "Treecko", - "Grovyle", - "Sceptile", - "Torchic", - "Combusken", - "Blaziken", - "Mudkip", - "Marshtomp", - "Swampert", - "Poochyena", - "Mightyena", - "Zigzagoon", - "Linoone", - "Wurmple", - "Silcoon", - "Beautifly", - "Cascoon", - "Dustox", - "Lotad", - "Lombre", - "Ludicolo", - "Seedot", - "Nuzleaf", - "Shiftry", - "Taillow", - "Swellow", - "Wingull", - "Pelipper", - "Ralts", - "Kirlia", - "Gardevoir", - "Surskit", - "Masquerain", - "Shroomish", - "Breloom", - "Slakoth", - "Vigoroth", - "Slaking", - "Nincada", - "Ninjask", - "Shedinja", - "Whismur", - "Loudred", - "Exploud", - "Makuhita", - "Hariyama", - "Azurill", - "Nosepass", - "Skitty", - "Delcatty", - "Sableye", - "Mawile", - "Aron", - "Lairon", - "Aggron", - "Meditite", - "Medicham", - "Electrike", - "Manectric", - "Plusle", - "Minun", - "Volbeat", - "Illumise", - "Roselia", - "Gulpin", - "Swalot", - "Carvanha", - "Sharpedo", - "Wailmer", - "Wailord", - "Numel", - "Camerupt", - "Torkoal", - "Spoink", - "Grumpig", - "Spinda", - "Trapinch", - "Vibrava", - "Flygon", - "Cacnea", - "Cacturne", - "Swablu", - "Altaria", - "Zangoose", - "Seviper", - "Lunatone", - "Solrock", - "Barboach", - "Whiscash", - "Corphish", - "Crawdaunt", - "Baltoy", - "Claydol", - "Lileep", - "Cradily", - "Anorith", - "Armaldo", - "Feebas", - "Milotic", - "Castform", - "Kecleon", - "Shuppet", - "Banette", - "Duskull", - "Dusclops", - "Tropius", - "Chimecho", - "Absol", - "Wynaut", - "Snorunt", - "Glalie", - "Spheal", - "Sealeo", - "Walrein", - "Clamperl", - "Huntail", - "Gorebyss", - "Relicanth", - "Luvdisc", - "Bagon", - "Shelgon", - "Salamence", - "Beldum", - "Metang", - "Metagross", - "Regirock", - "Regice", - "Registeel", - "Latias", - "Latios", - "Kyogre", - "Groudon", - "Rayquaza", - "Jirachi", - "Deoxys", - "Turtwig", - "Grotle", - "Torterra", - "Chimchar", - "Monferno", - "Infernape", - "Piplup", - "Prinplup", - "Empoleon", - "Starly", - "Staravia", - "Staraptor", - "Bidoof", - "Bibarel", - "Kricketot", - "Kricketune", - "Shinx", - "Luxio", - "Luxray", - "Budew", - "Roserade", - "Cranidos", - "Rampardos", - "Shieldon", - "Bastiodon", - "Burmy", - "Wormadam", - "Mothim", - "Combee", - "Vespiquen", - "Pachirisu", - "Buizel", - "Floatzel", - "Cherubi", - "Cherrim", - "Shellos", - "Gastrodon", - "Ambipom", - "Drifloon", - "Drifblim", - "Buneary", - "Lopunny", - "Mismagius", - "Honchkrow", - "Glameow", - "Purugly", - "Chingling", - "Stunky", - "Skuntank", - "Bronzor", - "Bronzong", - "Bonsly", - "Mime Jr.", - "Happiny", - "Chatot", - "Spiritomb", - "Gible", - "Gabite", - "Garchomp", - "Munchlax", - "Riolu", - "Lucario", - "Hippopotas", - "Hippowdon", - "Skorupi", - "Drapion", - "Croagunk", - "Toxicroak", - "Carnivine", - "Finneon", - "Lumineon", - "Mantyke", - "Snover", - "Abomasnow", - "Weavile", - "Magnezone", - "Lickilicky", - "Rhyperior", - "Tangrowth", - "Electivire", - "Magmortar", - "Togekiss", - "Yanmega", - "Leafeon", - "Glaceon", - "Gliscor", - "Mamoswine", - "Porygon-Z", - "Gallade", - "Probopass", - "Dusknoir", - "Froslass", - "Rotom", - "Uxie", - "Mesprit", - "Azelf", - "Dialga", - "Palkia", - "Heatran", - "Regigigas", - "Giratina", - "Cresselia", - "Phione", - "Manaphy", - "Darkrai", - "Shaymin", - "Arceus", - "Victini", - "Snivy", - "Servine", - "Serperior", - "Tepig", - "Pignite", - "Emboar", - "Oshawott", - "Dewott", - "Samurott", - "Patrat", - "Watchog", - "Lillipup", - "Herdier", - "Stoutland", - "Purrloin", - "Liepard", - "Pansage", - "Simisage", - "Pansear", - "Simisear", - "Panpour", - "Simipour", - "Munna", - "Musharna", - "Pidove", - "Tranquill", - "Unfezant", - "Blitzle", - "Zebstrika", - "Roggenrola", - "Boldore", - "Gigalith", - "Woobat", - "Swoobat", - "Drilbur", - "Excadrill", - "Audino", - "Timburr", - "Gurdurr", - "Conkeldurr", - "Tympole", - "Palpitoad", - "Seismitoad", - "Throh", - "Sawk", - "Sewaddle", - "Swadloon", - "Leavanny", - "Venipede", - "Whirlipede", - "Scolipede", - "Cottonee", - "Whimsicott", - "Petilil", - "Lilligant", - "Basculin", - "Sandile", - "Krokorok", - "Krookodile", - "Darumaka", - "Darmanitan", - "Maractus", - "Dwebble", - "Crustle", - "Scraggy", - "Scrafty", - "Sigilyph", - "Yamask", - "Cofagrigus", - "Tirtouga", - "Carracosta", - "Archen", - "Archeops", - "Trubbish", - "Garbodor", - "Zorua", - "Zoroark", - "Minccino", - "Cinccino", - "Gothita", - "Gothorita", - "Gothitelle", - "Solosis", - "Duosion", - "Reuniclus", - "Ducklett", - "Swanna", - "Vanillite", - "Vanillish", - "Vanilluxe", - "Deerling", - "Sawsbuck", - "Emolga", - "Karrablast", - "Escavalier", - "Foongus", - "Amoonguss", - "Frillish", - "Jellicent", - "Alomomola", - "Joltik", - "Galvantula", - "Ferroseed", - "Ferrothorn", - "Klink", - "Klang", - "Klinklang", - "Tynamo", - "Eelektrik", - "Eelektross", - "Elgyem", - "Beheeyem", - "Litwick", - "Lampent", - "Chandelure", - "Axew", - "Fraxure", - "Haxorus", - "Cubchoo", - "Beartic", - "Cryogonal", - "Shelmet", - "Accelgor", - "Stunfisk", - "Mienfoo", - "Mienshao", - "Druddigon", - "Golett", - "Golurk", - "Pawniard", - "Bisharp", - "Bouffalant", - "Rufflet", - "Braviary", - "Vullaby", - "Mandibuzz", - "Heatmor", - "Durant", - "Deino", - "Zweilous", - "Hydreigon", - "Larvesta", - "Volcarona", - "Cobalion", - "Terrakion", - "Virizion", - "Tornadus", - "Thundurus", - "Reshiram", - "Zekrom", - "Landorus", - "Kyurem", - "Keldeo", - "Meloetta", - "Genesect", - "Chespin", - "Quilladin", - "Chesnaught", - "Fennekin", - "Braixen", - "Delphox", - "Froakie", - "Frogadier", - "Greninja", - "Bunnelby", - "Diggersby", - "Fletchling", - "Fletchinder", - "Talonflame", - "Scatterbug", - "Spewpa", - "Vivillon", - "Litleo", - "Pyroar", - "Flabebe", - "Floette", - "Florges", - "Skiddo", - "Gogoat", - "Pancham", - "Pangoro", - "Furfrou", - "Espurr", - "Meowstic", - "Honedge", - "Doublade", - "Aegislash", - "Spritzee", - "Aromatisse", - "Swirlix", - "Slurpuff", - "Inkay", - "Malamar", - "Binacle", - "Barbaracle", - "Skrelp", - "Dragalge", - "Clauncher", - "Clawitzer", - "Helioptile", - "Heliolisk", - "Tyrunt", - "Tyrantrum", - "Amaura", - "Aurorus", - "Sylveon", - "Hawlucha", - "Dedenne", - "Carbink", - "Goomy", - "Sliggoo", - "Goodra", - "Klefki", - "Phantump", - "Trevenant", - "Pumpkaboo", - "Gourgeist", - "Bergmite", - "Avalugg", - "Noibat", - "Noivern", - "Xerneas", - "Yveltal", - "Zygarde", - "Diancie", - "Hoopa", - "Volcanion", - "Rowlet", - "Dartrix", - "Decidueye", - "Litten", - "Torracat", - "Incineroar", - "Popplio", - "Brionne", - "Primarina", - "Pikipek", - "Trumbeak", - "Toucannon", - "Yungoos", - "Gumshoos", - "Grubbin", - "Charjabug", - "Vikavolt", - "Crabrawler", - "Crabominable", - "Oricorio", - "Cutiefly", - "Ribombee", - "Rockruff", - "Lycanroc", - "Wishiwashi", - "Mareanie", - "Toxapex", - "Mudbray", - "Mudsdale", - "Dewpider", - "Araquanid", - "Fomantis", - "Lurantis", - "Morelull", - "Shiinotic", - "Salandit", - "Salazzle", - "Stufful", - "Bewear", - "Bounsweet", - "Steenee", - "Tsareena", - "Comfey", - "Oranguru", - "Passimian", - "Wimpod", - "Golisopod", - "Sandygast", - "Palossand", - "Pyukumuku", - "Type: Null", - "Silvally", - "Minior", - "Komala", - "Turtonator", - "Togedemaru", - "Mimikyu", - "Bruxish", - "Drampa", - "Dhelmise", - "Jangmo-o", - "Hakamo-o", - "Kommo-o", - "Tapu Koko", - "Tapu Lele", - "Tapu Bulu", - "Tapu Fini", - "Cosmog", - "Cosmoem", - "Solgaleo", - "Lunala", - "Nihilego", - "Buzzwole", - "Pheromosa", - "Xurkitree", - "Celesteela", - "Kartana", - "Guzzlord", - "Necrozma", - "Magearna", - "Marshadow" -] diff --git a/lang/pokemon_fr.json b/lang/pokemon_fr.json deleted file mode 100644 index bbd98bc..0000000 --- a/lang/pokemon_fr.json +++ /dev/null @@ -1,804 +0,0 @@ -[ - "Bulbizarre", - "Herbizarre", - "Florizarre", - "Salamèche", - "Reptincel", - "Dracaufeu", - "Carapuce", - "Carabaffe", - "Tortank", - "Chenipan", - "Chrysacier", - "Papilusion", - "Aspicot", - "Coconfort", - "Dardargnan", - "Roucool", - "Roucoups", - "Roucarnage", - "Rattata", - "Rattatac", - "Piafabec", - "Rapasdepic", - "Abo", - "Arbok", - "Pikachu", - "Raichu", - "Sabelette", - "Sablaireau", - "Nidoran♀", - "Nidorina", - "Nidoqueen", - "Nidoran♂", - "Nidorino", - "Nidoking", - "Mélofée", - "Mélodelfe", - "Goupix", - "Feunard", - "Rondoudou", - "Grodoudou", - "Nosferapti", - "Nosferalto", - "Mystherbe", - "Ortide", - "Rafflesia", - "Paras", - "Parasect", - "Mimitoss", - "Aéromite", - "Taupiqueur", - "Triopikeur", - "Miaouss", - "Persian", - "Psykokwak", - "Akwakwak", - "Férosinge", - "Colossinge", - "Caninos", - "Arcanin", - "Ptitard", - "Têtarte", - "Tartard", - "Abra", - "Kadabra", - "Alakazam", - "Machoc", - "Machopeur", - "Mackogneur", - "Chétiflor", - "Boustiflor", - "Empiflor", - "Tentacool", - "Tentacruel", - "Racaillou", - "Gravalanch", - "Grolem", - "Ponyta", - "Galopa", - "Ramoloss", - "Flagadoss", - "Magnéti", - "Magnéton", - "Canarticho", - "Doduo", - "Dodrio", - "Otaria", - "Lamantine", - "Tadmorv", - "Grotadmorv", - "Kokiyas", - "Crustabri", - "Fantominus", - "Spectrum", - "Ectoplasma", - "Onix", - "Soporifik", - "Hypnomade", - "Krabby", - "Krabboss", - "Voltorbe", - "Électrode", - "Nœunœuf", - "Noadkoko", - "Osselait", - "Ossatueur", - "Kicklee", - "Tygnon", - "Excelangue", - "Smogo", - "Smogogo", - "Rhinocorne", - "Rhinoféros", - "Leveinard", - "Saquedeneu", - "Kangourex", - "Hypotrempe", - "Hypocéan", - "Poissirène", - "Poissoroy", - "Stari", - "Staross", - "Mime", - "Insécateur", - "Lippoutou", - "Élektek", - "Magmar", - "Scarabrute", - "Tauros", - "Magicarpe", - "Léviator", - "Lokhlass", - "Métamorph", - "Évoli", - "Aquali", - "Voltali", - "Pyroli", - "Porygon", - "Amonita", - "Amonistar", - "Kabuto", - "Kabutops", - "Ptéra", - "Ronflex", - "Artikodin", - "Électhor", - "Sulfura", - "Minidraco", - "Draco", - "Dracolosse", - "Mewtwo", - "Mew", - "Germignon", - "Macronium", - "Méganium", - "Héricendre", - "Feurisson", - "Typhlosion", - "Kaiminus", - "Crocrodil", - "Aligatueur", - "Fouinette", - "Fouinar", - "Hoothoot", - "Noarfang", - "Coxy", - "Coxyclaque", - "Mimigal", - "Migalos", - "Nostenfer", - "Loupio", - "Lanturn", - "Pichu", - "Mélo", - "Toudoudou", - "Togepi", - "Togetic", - "Natu", - "Xatu", - "Wattouat", - "Lainergie", - "Pharamp", - "Joliflor", - "Marill", - "Azumarill", - "Simularbre", - "Tarpaud", - "Granivol", - "Floravol", - "Cotovol", - "Capumain", - "Tournegrin", - "Héliatronc", - "Yanma", - "Axoloto", - "Maraiste", - "Mentali", - "Noctali", - "Cornèbre", - "Roigada", - "Feuforêve", - "Zarbi", - "Qulbutoké", - "Girafarig", - "Pomdepic", - "Foretress", - "Insolourdo", - "Scorplane", - "Steelix", - "Snubbull", - "Granbull", - "Qwilfish", - "Cizayox", - "Caratroc", - "Scarhino", - "Farfuret", - "Teddiursa", - "Ursaring", - "Limagma", - "Volcaropod", - "Marcacrin", - "Cochignon", - "Corayon", - "Rémoraid", - "Octillery", - "Cadoizo", - "Démanta", - "Airmure", - "Malosse", - "Démolosse", - "Hyporoi", - "Phanpy", - "Donphan", - "Porygon2", - "Cerfrousse", - "Queulorior", - "Debugant", - "Kapoera", - "Lippouti", - "Élekid", - "Magby", - "Écrémeuh", - "Leuphorie", - "Raikou", - "Entei", - "Suicune", - "Embrylex", - "Ymphect", - "Tyranocif", - "Lugia", - "Ho-Oh", - "Celebi", - "Arcko", - "Massko", - "Jungko", - "Poussifeu", - "Galifeu", - "Braségali", - "Gobou", - "Flobio", - "Laggron", - "Medhyèna", - "Grahyèna", - "Zigzaton", - "Linéon", - "Chenipotte", - "Armulys", - "Charmillon", - "Blindalys", - "Papinox", - "Nénupiot", - "Lombre", - "Ludicolo", - "Grainipiot", - "Pifeuil", - "Tengalice", - "Nirondelle", - "Hélédelle", - "Goélise", - "Bekipan", - "Tarsal", - "Kirlia", - "Gardevoir", - "Arakdo", - "Maskadra", - "Balignon", - "Chapignon", - "Parecool", - "Vigoroth", - "Monaflèmit", - "Ningale", - "Ninjask", - "Munja", - "Chuchmur", - "Ramboum", - "Brouhabam", - "Makuhita", - "Hariyama", - "Azurill", - "Tarinor", - "Skitty", - "Delcatty", - "Ténéfix", - "Mysdibule", - "Galekid", - "Galegon", - "Galeking", - "Méditikka", - "Charmina", - "Dynavolt", - "Élecsprint", - "Posipi", - "Négapi", - "Muciole", - "Lumivole", - "Rosélia", - "Gloupti", - "Avaltout", - "Carvanha", - "Sharpedo", - "Wailmer", - "Wailord", - "Chamallot", - "Camérupt", - "Chartor", - "Spoink", - "Groret", - "Spinda", - "Kraknoix", - "Vibraninf", - "Libégon", - "Cacnea", - "Cacturne", - "Tylton", - "Altaria", - "Mangriff", - "Séviper", - "Séléroc", - "Solaroc", - "Barloche", - "Barbicha", - "Écrapince", - "Colhomard", - "Balbuto", - "Kaorine", - "Lilia", - "Vacilys", - "Anorith", - "Armaldo", - "Barpau", - "Milobellus", - "Morphéo", - "Kecleon", - "Polichombr", - "Branette", - "Skelénox", - "Téraclope", - "Tropius", - "Éoko", - "Absol", - "Okéoké", - "Stalgamin", - "Oniglali", - "Obalie", - "Phogleur", - "Kaimorse", - "Coquiperl", - "Serpang", - "Rosabyss", - "Relicanth", - "Lovdisc", - "Draby", - "Drackhaus", - "Drattak", - "Terhal", - "Métang", - "Métalosse", - "Regirock", - "Regice", - "Registeel", - "Latias", - "Latios", - "Kyogre", - "Groudon", - "Rayquaza", - "Jirachi", - "Deoxys", - "Tortipouss", - "Boskara", - "Torterra", - "Ouisticram", - "Chimpenfeu", - "Simiabraz", - "Tiplouf", - "Prinplouf", - "Pingoléon", - "Étourmi", - "Étourvol", - "Étouraptor", - "Keunotor", - "Castorno", - "Crikzik", - "Mélokrik", - "Lixy", - "Luxio", - "Luxray", - "Rozbouton", - "Roserade", - "Kranidos", - "Charkos", - "Dinoclier", - "Bastiodon", - "Cheniti", - "Cheniselle", - "Papilord", - "Apitrini", - "Apireine", - "Pachirisu", - "Mustébouée", - "Mustéflott", - "Ceribou", - "Ceriflor", - "Sancoki", - "Tritosor", - "Capidextre", - "Baudrive", - "Grodrive", - "Laporeille", - "Lockpin", - "Magirêve", - "Corboss", - "Chaglam", - "Chaffreux", - "Korillon", - "Moufouette", - "Moufflair", - "Archéomire", - "Archéodong", - "Manzaï", - "Jr", - "Ptiravi", - "Pijako", - "Spiritomb", - "Griknot", - "Carmache", - "Carchacrok", - "Goinfrex", - "Riolu", - "Lucario", - "Hippopotas", - "Hippodocus", - "Rapion", - "Drascore", - "Cradopaud", - "Coatox", - "Vortente", - "Écayon", - "Luminéon", - "Babimanta", - "Blizzi", - "Blizzaroi", - "Dimoret", - "Magnézone", - "Coudlangue", - "Rhinastoc", - "Bouldeneu", - "Élekable", - "Maganon", - "Togekiss", - "Yanméga", - "Phyllali", - "Givrali", - "Scorvol", - "Mammochon", - "Z", - "Gallame", - "Tarinorme", - "Noctunoir", - "Momartik", - "Motisma", - "Créhelf", - "Créfollet", - "Créfadet", - "Dialga", - "Palkia", - "Heatran", - "Regigigas", - "Giratina", - "Cresselia", - "Phione", - "Manaphy", - "Darkrai", - "Shaymin", - "Arceus", - "Victini", - "Vipélierre", - "Lianaja", - "Majaspic", - "Gruikui", - "Grotichon", - "Roitiflam", - "Moustillon", - "Mateloutre", - "Clamiral", - "Ratentif", - "Miradar", - "Ponchiot", - "Ponchien", - "Mastouffe", - "Chacripan", - "Léopardus", - "Feuillajou", - "Feuiloutan", - "Flamajou", - "Flamoutan", - "Flotajou", - "Flotoutan", - "Munna", - "Mushana", - "Poichigeon", - "Colombeau", - "Déflaisan", - "Zébribon", - "Zéblitz", - "Nodulithe", - "Géolithe", - "Gigalithe", - "Chovsourir", - "Rhinolove", - "Rototaupe", - "Minotaupe", - "Nanméouïe", - "Charpenti", - "Ouvrifier", - "Bétochef", - "Tritonde", - "Batracné", - "Crapustule", - "Judokrak", - "Karaclée", - "Larveyette", - "Couverdure", - "Manternel", - "Venipatte", - "Scobolide", - "Brutapode", - "Doudouvet", - "Farfaduvet", - "Chlorobule", - "Fragilady", - "Bargantua", - "Mascaïman", - "Escroco", - "Crocorible", - "Darumarond", - "Darumacho", - "Maracachi", - "Crabicoque", - "Crabaraque", - "Baggiguane", - "Baggaïd", - "Cryptéro", - "Tutafeh", - "Tutankafer", - "Carapagos", - "Mégapagos", - "Arkéapti", - "Aéroptéryx", - "Miamiasme", - "Miasmax", - "Zorua", - "Zoroark", - "Chinchidou", - "Pashmilla", - "Scrutella", - "Mesmérella", - "Sidérella", - "Nucléos", - "Méios", - "Symbios", - "Couaneton", - "Lakmécygne", - "Sorbébé", - "Sorboul", - "Sorbouboul", - "Vivaldaim", - "Haydaim", - "Emolga", - "Carabing", - "Lançargot", - "Trompignon", - "Gaulet", - "Viskuse", - "Moyade", - "Mamanbo", - "Statitik", - "Mygavolt", - "Grindur", - "Noacier", - "Tic", - "Clic", - "Cliticlic", - "Anchwatt", - "Lampéroie", - "Ohmassacre", - "Lewsor", - "Neitram", - "Funécire", - "Mélancolux", - "Lugulabre", - "Coupenotte", - "Incisache", - "Tranchodon", - "Polarhume", - "Polagriffe", - "Hexagel", - "Escargaume", - "Limaspeed", - "Limonde", - "Kungfouine", - "Shaofouine", - "Drakkarmin", - "Gringolem", - "Golemastoc", - "Scalpion", - "Scalproie", - "Frison", - "Furaiglon", - "Gueriaigle", - "Vostourno", - "Vaututrice", - "Aflamanoir", - "Fermite", - "Solochi", - "Diamat", - "Trioxhydre", - "Pyronille", - "Pyrax", - "Cobaltium", - "Terrakium", - "Viridium", - "Boréas", - "Fulguris", - "Reshiram", - "Zekrom", - "Démétéros", - "Kyurem", - "Keldeo", - "Meloetta", - "Genesect", - "Marisson", - "Boguérisse", - "Blindépique", - "Feunnec", - "Roussil", - "Goupelin", - "Grenousse", - "Croâporal", - "Amphinobi", - "Sapereau", - "Excavarenne", - "Passerouge", - "Braisillon", - "Flambusard", - "Lépidonille", - "Pérégrain", - "Prismillon", - "Hélionceau", - "Némélios", - "Flabébé", - "Floette", - "Florges", - "Cabriolaine", - "Chevroum", - "Pandespiègle", - "Pandarbare", - "Couafarel", - "Psystigri", - "Mistigrix", - "Monorpale", - "Dimoclès", - "Exagide", - "Fluvetin", - "Cocotine", - "Sucroquin", - "Cupcanaille", - "Sepiatop", - "Sepiatroce", - "Opermine", - "Golgopathe", - "Venalgue", - "Kravarech", - "Flingouste", - "Gamblast", - "Galvaran", - "Iguolta", - "Ptyranidur", - "Rexillius", - "Amagara", - "Dragmara", - "Nymphali", - "Brutalibré", - "Dedenne", - "Strassie", - "Mucuscule", - "Colimucus", - "Muplodocus", - "Trousselin", - "Brocélôme", - "Desséliande", - "Pitrouille", - "Banshitrouye", - "Grelaçon", - "Séracrawl", - "Sonistrelle", - "Bruyverne", - "Xerneas", - "Yveltal", - "Zygarde", - "Diancie", - "Hoopa", - "Volcanion", - "Brindibou", - "Efflèche", - "Archéduc", - "Flamiaou‎‎", - "Matoufeu", - "Félinferno", - "Otaquin", - "Otarlette", - "Oratoria", - "Picassaut", - "Piclairon", - "Bazoucan", - "Manglouton", - "Argouste", - "Larvibule", - "Chrysapile", - "Lucanon", - "Crabagarre", - "Crabominable", - "Plumeline", - "Bombydou", - "Rubombelle", - "Rocabot", - "Lougaroc", - "Froussardine", - "Vorastérie", - "Prédastérie", - "Tiboudet", - "Bourrinos", - "Araqua", - "Tarenbulle", - "Mimantis", - "Floramantis", - "Spododo", - "Lampignon", - "Tritox", - "Malamandre", - "Nounourson", - "Chelours", - "Croquine", - "Candine", - "Sucreine", - "Guérilande", - "Gouroutan", - "Quartermac", - "Sovkipou", - "Sarmuraï", - "Bacabouh", - "Trépassable", - "Concombaffe", - "Type:0", - "Silvallié", - "Météno", - "Dodoala", - "Boumata", - "Togedemaru", - "Mimiqui", - "Denticrisse", - "Draïeul", - "Sinistrail", - "Bébécaille", - "Écaïd", - "Ékaïser", - "Tokorico", - "Tokopiyon", - "Tokotoro", - "Tokopisco", - "Cosmog", - "Cosmovum", - "Solgaleo", - "Lunala", - "Zéroïd", - "Mouscoto", - "Cancrelove", - "Câblifère", - "Bamboiselle", - "Katagami", - "Engloutyran", - "Necrozma", - "Magearna", - "Marshadow" -] diff --git a/lang/pokemon_ru.json b/lang/pokemon_ru.json deleted file mode 100644 index 038f4d3..0000000 --- a/lang/pokemon_ru.json +++ /dev/null @@ -1,804 +0,0 @@ -[ - "Бульбазавр", - "Ивизавр", - "Венузавр", - "Чармандер", - "Чармелеон", - "Чаризард", - "Сквиртл", - "Вартортл", - "Бластойз", - "Катерпи", - "Метапод", - "Баттерфри", - "Видл", - "Какуна", - "Бидрилл", - "Пиджи", - "Пиджеотто", - "Пиджит", - "Раттата", - "Рэтикейт", - "Спироу", - "Фироу", - "Эканс", - "Эрбок", - "Пикачу", - "Райчу", - "Сэндшру", - "Сэндслэш", - "Нидоран♀", - "Нидорина", - "Нидоквин", - "Нидоран♂", - "Нидорино", - "Нидокинг", - "Клефейри", - "Клефейбл", - "Вульпикс", - "Найнтейлс", - "Джигглипуф", - "Вигглитаф", - "Зубат", - "Голбат", - "Оддиш", - "Глум", - "Вайлплум", - "Парас", - "Парасект", - "Венонат", - "Веномот", - "Диглетт", - "Дагтрио", - "Мяут", - "Персиан", - "Псидак", - "Голдак", - "Манки", - "Праймейп", - "Гроулит", - "Арканайн", - "Поливаг", - "Поливирл", - "Поливрэт", - "Абра", - "Кадабра", - "Алаказам", - "Мачоп", - "Мачок", - "Мачемп", - "Беллспраут", - "Випинбелл", - "Виктрибел", - "Тентакул", - "Тентакруэль", - "Джеодуд", - "Гравелер", - "Голем", - "Понита", - "Рапидаш", - "Слоупок", - "Слоубро", - "Магнемайт", - "Магнетон", - "Фарфетчд", - "Додуо", - "Додрио", - "Сил", - "Дьюгонг", - "Граймер", - "Мак", - "Шеллдер", - "Клойстер", - "Гастли", - "Хонтер", - "Генгар", - "Оникс", - "Дроузи", - "Гипно", - "Крабби", - "Кинглер", - "Волторб", - "Электрод", - "Экзеггут", - "Экзеггутор", - "Кубон", - "Маровак", - "Хитмонли", - "Хитмончан", - "Ликитунг", - "Коффинг", - "Визинг", - "Райхорн", - "Райдон", - "Ченси", - "Тангела", - "Кангасхан", - "Хорси", - "Сидра", - "Голдин", - "Сикинг", - "Старью", - "Старми", - "Мистер Майм", - "Скайтер", - "Джинкс", - "Электробазз", - "Магмар", - "Пинсир", - "Торос", - "Мэджикарп", - "Гаярдос", - "Лапрас", - "Дитто", - "Иви", - "Вапореон", - "Джолтеон", - "Флареон", - "Поригон", - "Оманайт", - "Омастар", - "Кабуто", - "Кабутопс", - "Аэродактиль", - "Снорлакс", - "Артикуно", - "Запдос", - "Молтрес", - "Дратини", - "Драгонэйр", - "Драгонит", - "Мьюту", - "Мью", - "Чикорита", - "Бейлиф", - "Меганиум", - "Синдаквил", - "Квилава", - "Тайфложн", - "Тотодайл", - "Кроконав", - "Фералигатр", - "Сентрет", - "Фуррет", - "Хутхут", - "Ноктаул", - "Ледиба", - "Ледиан", - "Спинарак", - "Ариадос", - "Кробат", - "Чинчоу", - "Лантурн", - "Пичу", - "Клеффа", - "Игглибафф", - "Тогепи", - "Тогетик", - "Нату", - "Ксату", - "Мэрип", - "Флаффи", - "Амфарос", - "Беллоссом", - "Мэрилл", - "Азумэрилл", - "Судовудо", - "Политод", - "Хоппип", - "Скиплум", - "Джамплафф", - "Эйпом", - "Санкерн", - "Санфлора", - "Янма", - "Вупер", - "Квэгсайр", - "Эспеон", - "Амбреон", - "Маркроу", - "Слоукинг", - "Мисдривус", - "Аноун", - "Воббафет", - "Жирафариг", - "Пайнеко", - "Форретресс", - "Данспорс", - "Глайгер", - "Стиликс", - "Снаббл", - "Гранбулл", - "Квилфиш", - "Сизор", - "Шакл", - "Геракросс", - "Снизел", - "Теддиурса", - "Урсаринг", - "Слагма", - "Магкарго", - "Свайнаб", - "Пилосвайн", - "Корсола", - "Реморейд", - "Октиллери", - "Дэлибёд", - "Мантин", - "Скармори", - "Хаундаур", - "Хаундум", - "Кингдра", - "Фанфи", - "Донфан", - "Поригон 2", - "Стэнтлер", - "Смиргл", - "Тирогу", - "Хитмонтоп", - "Смучам", - "Элекид", - "Магби", - "Милтанк", - "Блисси", - "Райкоу", - "Энтей", - "Суйкун", - "Ларвитар", - "Пупитар", - "Тиранитар", - "Люджия", - "Хо-Ох", - "Целеби", - "Трико", - "Гроувайл", - "Скептайл", - "Торчик", - "Комбускен", - "Блейзикен", - "Мадкип", - "Марштомп", - "Свамперт", - "Пучиена", - "Майтиена", - "Зигзагун", - "Лайнун", - "Вёрмпл", - "Силкун", - "Бьютифлай", - "Каскун", - "Дастокс", - "Лотад", - "Ломбре", - "Лудиколо", - "Сидот", - "Назлиф", - "Шифтри", - "Тейлоу", - "Свеллоу", - "Вингалл", - "Пелиппер", - "Ральтс", - "Кирлия", - "Гардевуар", - "Сёрскит", - "Маскверейн", - "Шрумиш", - "Брелум", - "Слэйкот", - "Вигорот", - "Слэйкинг", - "Нинкада", - "Нинджаск", - "Шединджа", - "Висмур", - "Лаудред", - "Эксплауд", - "Макухита", - "Харияма", - "Азурилл", - "Ноуспасс", - "Скитти", - "Делкатти", - "Саблай", - "Мэвайл", - "Арон", - "Лейрон", - "Аггрон", - "Медитайт", - "Медичам", - "Электрайк", - "Манектрик", - "Плюсл", - "Минун", - "Волбит", - "Иллюмизи", - "Розалия", - "Галпин", - "Свалот", - "Карванна", - "Шарпидо", - "Вэйлмер", - "Вэйлорд", - "Намел", - "Камерапт", - "Торкл", - "Споинк", - "Грампиг", - "Спинда", - "Трапинч", - "Вибрава", - "Флайгон", - "Какния", - "Кактурн", - "Сваблу", - "Алтария", - "Зангус", - "Сивайпер", - "Лунатон", - "Солрок", - "Барбоа", - "Вискэш", - "Корфиш", - "Кродант", - "Балтой", - "Клэйдол", - "Лилип", - "Крэдили", - "Анорит", - "Армальдо", - "Фибас", - "Майлотик", - "Кастформ", - "Кеклеон", - "Шаппет", - "Бэнетт", - "Даскулл", - "Дасклопс", - "Тропиус", - "Чаймеко", - "Эбсол", - "Винаут", - "Снорант", - "Глэйли", - "Сфил", - "Силео", - "Уолрейн", - "Кламперл", - "Хантэйл", - "Горебисс", - "Реликант", - "Лювдиск", - "Багон", - "Шелгон", - "Саламенс", - "Белдум", - "Метанг", - "Метагросс", - "Реджирок", - "Реджайс", - "Реджистил", - "Латиас", - "Латиос", - "Кайогр", - "Граудон", - "Рэйкваза", - "Джирачи", - "Деоксис", - "Туртвиг", - "Гротл", - "Тортерра", - "Чимчар", - "Монферно", - "Инфернейп", - "Пиплуп", - "Принплуп", - "Эмполеон", - "Старли", - "Старавия", - "Стараптор", - "Бидуф", - "Бибарел", - "Крикетот", - "Крикетун", - "Шинкс", - "Люксио", - "Люксрей", - "Бадью", - "Роузрейд", - "Крэйнидос", - "Рампардос", - "Шилдон", - "Бастиодон", - "Бурми", - "Вормадам", - "Мотим", - "Комби", - "Веспиквин", - "Пачирису", - "Буизел", - "Флотцел", - "Черуби", - "Черрим", - "Шеллос", - "Гастродон", - "Эмбипом", - "Дрифлун", - "Дрифблим", - "Банири", - "Лопанни", - "Мисмагиус", - "Хончкроу", - "Глеймяу", - "Пурагли", - "Чинглинг", - "Станки", - "Скунтанк", - "Бронзор", - "Бронзонг", - "Бонслай", - "Майм Младший", - "Хэппини", - "Чатот", - "Спиритомб", - "Гибл", - "Габайт", - "Гарчомп", - "Манчлакс", - "Риолу", - "Лукарио", - "Гиппопотас", - "Гипподон", - "Скорупи", - "Драпион", - "Кроганк", - "Токсикроук", - "Карнивайн", - "Финнеон", - "Люминеон", - "Мантик", - "Сновер", - "Абомасноу", - "Вивайл", - "Магнезон", - "Ликилики", - "Райпериор", - "Тангроут", - "Элективайр", - "Магмортар", - "Тогекисс", - "Янмега", - "Лифеон", - "Гласеон", - "Глайскор", - "Мамосвайн", - "Поригон-Z", - "Галлейд", - "Пробопасс", - "Даскнуар", - "Фросласс", - "Ротом", - "Юкси", - "Месприт", - "Азельф", - "Диалга", - "Палкия", - "Хитран", - "Реджигигас", - "Гиратина", - "Крисселия", - "Фион", - "Манапи", - "Даркрай", - "Шеймин", - "Аркеус", - "Виктини", - "Снайви", - "Сервайн", - "Серпериор", - "Тепиг", - "Пигнайт", - "Эмбор", - "Ошавотт", - "Девотт", - "Самуротт", - "Патрат", - "Уочхог", - "Лиллипап", - "Хердиер", - "Стаутлэнд", - "Пуррлойн", - "Лайпард", - "Пансейдж", - "Симисейдж", - "Пансир", - "Симисир", - "Панпур", - "Симипур", - "Мунна", - "Мушарна", - "Пидав", - "Транквилл", - "Анфезант", - "Блитцл", - "Зебстрайка", - "Роггенрола", - "Болдор", - "Гигалит", - "Вубэт", - "Свубэт", - "Дрилбур", - "Экскадрилл", - "Аудино", - "Тимбурр", - "Гурдурр", - "Конкельдурр", - "Тимпол", - "Палпитоад", - "Сейсмитоад", - "Тро", - "Соук", - "Севадл", - "Свадлун", - "Левани", - "Венипид", - "Вирлипид", - "Сколипид", - "Коттони", - "Вимсискотт", - "Петилил", - "Лиллигант", - "Баскулин", - "Сэндайл", - "Крокорок", - "Крукодайл", - "Дарумакка", - "Дарманитан", - "Марактус", - "Двэббл", - "Крастл", - "Скрэгги", - "Скрафти", - "Сиджилиф", - "Ямаск", - "Кофагригус", - "Тиртуга", - "Карракоста", - "Аркен", - "Аркеопс", - "Траббиш", - "Гарбодор", - "Зоруа", - "Зороарк", - "Минчино", - "Чинчино", - "Гофита", - "Гофорита", - "Гофителль", - "Солозис", - "Дуозион", - "Реониклус", - "Даклетт", - "Сванна", - "Ваниллайт", - "Ваниллиш", - "Ваниллакс", - "Дирлинг", - "Соусбак", - "Эмолга", - "Каррабласт", - "Эскавалир", - "Фунгус", - "Амунгус", - "Фрилиш", - "Джеллисент", - "Аломомола", - "Джолтик", - "Галвантула", - "Ферросид", - "Ферроторн", - "Клинк", - "Клэнг", - "Клинклэнг", - "Тайнамо", - "Илектрик", - "Илектросс", - "Илджием", - "Бихием", - "Литвик", - "Лампент", - "Шанделюр", - "Эксью", - "Фраксур", - "Гаксорус", - "Кабчу", - "Бертик", - "Криогонал", - "Шелмет", - "Аксельгор", - "Станфиск", - "Меньфу", - "Меньшао", - "Драддигон", - "Голетт", - "Голурк", - "Паониард", - "Бишарп", - "Буффалант", - "Раффлет", - "Брэйвиари", - "Валлаби", - "Мандибазз", - "Хитмор", - "Дюрант", - "Дайно", - "Звайлос", - "Гидрайгон", - "Ларвеста", - "Волкарона", - "Кобалион", - "Терракион", - "Виризион", - "Торнадус", - "Тандурус", - "Реширам", - "Зекром", - "Лэндорус", - "Кюрем", - "Келдео", - "Мелоэтта", - "Генесект", - "Чеспин", - "Квилладин", - "Чеснот", - "Феннекин", - "Брайксен", - "Дельфокс", - "Фроки", - "Фрогадир", - "Грениндзя", - "Баннелби", - "Диггерзби", - "Флечлинг", - "Флечиндер", - "Тэйлонфлейм", - "Скаттербаг", - "Спьюпа", - "Вивиллон", - "Литлео", - "Пайроар", - "Флабэбэ", - "Флоэтт", - "Флоргес", - "Скиддо", - "Гогоат", - "Панчам", - "Пангоро", - "Фурфру", - "Эспур", - "Мяустик", - "Хонэдж", - "Даблейд", - "Аегислэш", - "Спритзи", - "Ароматизз", - "Свирликс", - "Сларпафф", - "Инкей", - "Маламар", - "Бинакл", - "Барбаракл", - "Скрельп", - "Драгалг", - "Клончер", - "Кловицер", - "Гелиоптайл", - "Гелиолиск", - "Тайрант", - "Тайрентрум", - "Амаура", - "Аврорус", - "Сильвеон", - "Холуча", - "Деденне", - "Карбинк", - "Гуми", - "Слигу", - "Гудра", - "Клефки", - "Фантамп", - "Тривернант", - "Пампакмбу", - "Гургейст", - "Бергмайт", - "Авалагг", - "Нойбат", - "Нойверн", - "Ксернеас", - "Ивельтал", - "Зайгард", - "Дианси", - "Хупа", - "Вулканион", - "Роулет", - "Дартрикс", - "Десиджуай", - "Литтен", - "Торракат", - "Инсинероар", - "Попплио", - "Бриан", - "Примарина", - "Пикипек", - "Трамбик", - "Тукэнон", - "Янгус", - "Гамшус", - "Граббин", - "Чарьябаг", - "Викаволт", - "Крабролер", - "Крабаминабл", - "Орикорио", - "Кьютифлай", - "Рибомби", - "Рокрафф", - "Лайканрок", - "Вишиваши", - "Марини", - "Токсапекс", - "Мадбрей", - "Мадсдэйл", - "Дьюпайдер", - "Аракванид", - "Фомантис", - "Лурантис", - "Морилалл", - "Шинатик", - "Саландит", - "Салаззл", - "Стаффул", - "Бeвеар", - "Баунсвит", - "Стини", - "Царина", - "Комфей", - "Орангуру", - "Пассимиан", - "Вимпод", - "Голисопод", - "Сэндигаст", - "Палоссэнд", - "Пьюкумуку", - "Тип: Ноль", - "Силвалли", - "Миниор", - "Комала", - "Тартонэйтор", - "Тогедемару", - "Мимикью", - "Браксиш", - "Дрампа", - "Делмайз", - "Джангмо-о", - "Хакамо-o", - "Коммо-o", - "Тапу Коко", - "Тапу Леле", - "Тапу Булу", - "Тапу Фини", - "Космог", - "Космоэм", - "Солгалео", - "Лунала", - "Нихилэго", - "Баззвоул", - "Феромоза", - "Ксёркитри", - "Селестила", - "Картана", - "Газзлорд", - "Некрозма", - "Магирна", - "Маршедоу" -] diff --git a/lang/quest-language.json b/lang/quest-language.json deleted file mode 100644 index f48597b..0000000 --- a/lang/quest-language.json +++ /dev/null @@ -1,332 +0,0 @@ -{ - "quest":{ - "NL":"Quest", - "DE":"Forschung", - "EN":"Quest", - "IT":"Spedizione", - "PT-BR":"TRANSLATE", - "RU":"Квест", - "NO":"Oppdrag", - "FR":"Quête" - }, - "pokestop":{ - "NL":"Pokestop", - "DE":"Pokestop", - "EN":"Pokestop", - "IT":"Pokéstop", - "PT-BR":"TRANSLATE", - "RU":"Покестоп", - "NO":"Pokestop", - "FR":"Pokéstop" - }, - "pokestops_not_found":{ - "NL":"Error! Geen Pokestops gevonden!", - "DE":"Fehler! Keine Pokestops gefunden!", - "EN":"Error! No pokestops found!", - "IT":"Errore! Nessun Pokéstop trovato!", - "PT-BR":"Erro! Nenhum pokestops encontrado!", - "RU":"Ошибка! Покестоп не найден!", - "NO":"Feil! Ingen pokestop funnet!", - "FR":"Erreur ! Aucun Pokéstop trouvé !" - }, - "pokestops_not_found_command_text":{ - "NL":"Stuur /quest met een deel of een volledige pokestop naam.", - "DE":"Bitte /quest mit einem Teil oder dem vollständigen Namen des Pokestops aufrufen:", - "EN":"Please call /quest with a part or the complete name of the pokestop:", - "IT":"Prego usare /quest con una il nome completo di un Pokéstop o una sua parte:", - "PT-BR":"TRANSLATE", - "RU":"Введите /quest с частью или полным названием покестопа:", - "NO":"Vennligst bruk /quest med en del av navnet på pokestoppet:", - "FR":"Tape /quest avec une partie ou le nom complet d'un Pokéstop" - }, - "pokestops_not_found_command_example":{ - "NL":"/quest PokeCity Stop", - "DE":"/quest PokeStadt Stop", - "EN":"/quest PokeCity Stop", - "IT":"/quest PokéCity Stop", - "PT-BR":"/quest PokeCity Stop", - "RU":"/quest PokeCity Stop", - "NO":"/quest PokeCity Stop", - "FR":"/quest PokeCity Stop" - }, - "unnamed_pokestop":{ - "NL":"Onbekende pokestop", - "DE":"Unbekannter Pokestop", - "EN":"Unknown Pokestop", - "IT":"Pokéstop sconosciuto", - "PT-BR":"TRANSLATE", - "RU":"Неизвестный покестоп", - "NO":"Ukjent Pokestop", - "FR":"Pokéstop inconnu" - }, - "quest_by_pokestop":{ - "NL":"Maak een quest, selecteer een pokestop:", - "DE":"Lege eine Forschung per Pokestop-Auswahl an:", - "EN":"Make a quest per pokestop selection:", - "IT":"Crea una spedizione per il Pokéstop selezionato:", - "PT-BR":"TRANSLATE", - "RU":"Создать квест для выбранного покестопа:", - "NO":"Lag en quest per pokestop valg", - "FR":"Sélectionner une quête pour un Pokéstop" - }, - "quest_select_type":{ - "NL":"Selecteer een quest type:", - "DE":"Art der Forschung auswählen:", - "EN":"Select the quest type:", - "IT":"Seleziona il tipo di spedizione:", - "PT-BR":"TRANSLATE", - "RU":"Выберите тип квеста:", - "NO":"Velg quest type", - "FR":"Sélectionne le type de quête" - }, - "quest_select_qty_action":{ - "NL":"Selecteer de taak van de quest:", - "DE":"Aufgabe der Forschung auswählen:", - "EN":"Select the task of the quest:", - "IT":"Seleziona l'obiettivo della spedizione:", - "PT-BR":"TRANSLATE", - "RU":"Выберите задание квеста:", - "NO":"Velg hvilket oppdrag som er her:", - "FR":"Sélectionne la tâche de la quête" - }, - "quest_saved":{ - "NL":"Quest opgeslagen:", - "DE":"Forschung gespeichert:", - "EN":"Quest saved:", - "IT":"Spedizione salvata:", - "PT-BR":"TRANSLATE", - "RU":"Сохраненный квест:", - "NO":"Oppdrag lagret:", - "FR":"Quête sauvegardée" - }, - "quests_today":{ - "NL":"De quests van vandaag:", - "DE":"Heutige Forschungen:", - "EN":"Today's quests:", - "IT":"Spedizioni di oggi:", - "PT-BR":"TRANSLATE", - "RU":"Сегодняшние квесты:", - "NO":"Dagens oppdrag:", - "FR":"Les quêtes du jour" - }, - "no_quests_today":{ - "NL":"Vandaag zijn er nog geen quests!", - "DE":"Heute gibt es noch keine Forschungen!", - "EN":"Today there are no quests yet!", - "IT":"Non sono ancora presenti spedizioni per oggi!", - "PT-BR":"TRANSLATE", - "RU":"Сегодня здесь еще нет квестов!", - "NO":"Ingen oppdrag er registrert i dag!", - "FR":"Il n'y a aucune quête aujourd'hui pour l'instant !" - }, - "quest_already_submitted":{ - "NL":"Quest voor deze pokestop is al aangemeld!", - "DE":"Forschung für diesen Pokestop ist bereits vorhanden!", - "EN":"Quest for this pokestop was already submitted!", - "IT":"La spedizione per questo Pokéstop è stata già inserita!", - "PT-BR":"TRANSLATE", - "RU":"Квест для этого покестопа уже был отправлен!", - "NO":"Det er allerede registrert ett oppdrag på dette pokestoppet", - "FR":"La quête pour ce Pokéstop a déjà été soumise" - }, - "select_quest_to_delete":{ - "NL":"Selecteer een queest om te verwijderen:", - "DE":"Zum Löschen Forschung auswählen:", - "EN":"Select quest to delete:", - "IT":"Seleziona la spedizione da eliminare:", - "PT-BR":"TRANSLATE", - "RU":"Выберите квест для удаления:", - "NO":"Velg hvilket oppdrag som skal slettes:", - "FR":"Sélectionne la quête à supprimer" - }, - "delete_this_quest":{ - "NL":"Weet u het zeker dat u deze quest wilt verwijderen?", - "DE":"Diese Forschung wirklich löschen?", - "EN":"Really delete this quest?", - "IT":"Vuoi veramente eliminare questa spedizione?", - "PT-BR":"TRANSLATE", - "RU":"Действительно удалить этот квест?", - "NO":"Vil du virkelig at jeg skal slette dette oppdraget?", - "FR":"Veux-tu vraiment supprimer cette quête ?" - }, - "quest_deletion_was_canceled":{ - "NL":"Verwijderen van de quest is geannuleerd!", - "DE":"Löschung der Forschung wurde abgebrochen!", - "EN":"Deletion of the quest was canceled!", - "IT":"L'eliminazione della spedizione è stata annullata!", - "PT-BR":"TRANSLATE", - "RU":"Удаление этого квеста отменено!", - "NO":"Sletting av oppdraget ble avbrutt!", - "FR":"La suppression de la quête à été annulée" - }, - "quest_successfully_deleted":{ - "NL":"Quest is succesvol verwijderd!", - "DE":"Forschung wurde erfolgreich gelöscht!", - "EN":"Quest was successfully deleted!", - "IT":"La spedizione è stata eliminata con successo!", - "PT-BR":"TRANSLATE", - "RU":"Квест успешно удален", - "NO":"Oppdraget ble slettet!", - "FR":"La quête à été supprimée avec succès !" - }, - "reward":{ - "NL":"Beloning", - "DE":"Belohnung", - "EN":"Reward", - "IT":"Ricompensa", - "PT-BR":"TRANSLATE", - "RU":"Награда", - "NO":"Belønning", - "FR":"Récompense" - }, - "reward_select_type":{ - "NL":"Selecteer het type beloning:", - "DE":"Art der Belohnung auswählen:", - "EN":"Select the reward type:", - "IT":"Seleziona il tipo di ricompensa:", - "PT-BR":"TRANSLATE", - "RU":"Выберите тип награды:", - "NO":"Velg type belønning:", - "FR":"Sélectionne le type de récompense" - }, - "reward_select_qty_reward":{ - "NL":"Selecteer de beloning:", - "DE":"Belohnung auswählen:", - "EN":"Select reward:", - "IT":"Seleziona ricompensa:", - "PT-BR":"TRANSLATE", - "RU":"Выберите нагарду:", - "NO":"Velg belønning:", - "FR":"Sélectionne la récompense" - }, - "create_raid_or_quest":{ - "NL":"Wat wil je aanmaken:", - "DE":"Raid oder Forschung anlegen:", - "EN":"Create raid or quest:", - "IT":"Crea Raid o spedizione:", - "PT-BR":"TRANSLATE", - "RU":"Создать рейд или квест:", - "NO":"Opprett raid eller oppdrag", - "FR":"Créer un raid ou une quête" - }, - "quest_access_denied":{ - "NL":"Je hebt geen rechten om deze quest aan te passen!", - "DE":"Sie haben keine Berechtigung diese Forschung zu bearbeiten!", - "EN":"You are not allowed to edit this quest!", - "IT":"Non sei autorizzato a modificare questa Spedizione!", - "PT-BR":"Você não tem permissão para editar esta quest!", - "RU":"Вы не можете редактировать этот квест!", - "NO":"Du har ikke tillatelse til å redigere dette oppdraget!", - "FR":"Tu n'es pas autorisé à modifier cette quête !" - }, - "coordination_succes":{ - "NL":"Coördinatie geslaagd!", - "DE":"Koordinaten erfolgreich übermittelt!", - "EN":"Coordinates successfully submitted!", - "IT":"Coordinate inserite con successo!", - "PT-BR":"Coordenadas enviadas com sucesso!", - "RU":"Координаты успешно отправлены!", - "NO":"Koordinater ble lagt til!", - "FR":"Les coordonnées ont été soumises avec succès !" - }, - "send_location":{ - "NL":"Of stuur me alsjeblieft een locatie.", - "DE":"Oder sende mir einen Standort.", - "EN":"Or send me a location.", - "IT":"O inviami una localizzazione.", - "PT-BR":"Por favor, antes me envie a localização.", - "RU":"Или отправить мне локацию", - "NO":"Eller send meg lokasjonen din ved å trykke på bindersen", - "FR":"Ou envoie moi la localisation." - }, - "mods_details":{ - "NL":"Selecteer moderator voor meer informatie:", - "DE":"Für Details Moderator auswählen:", - "EN":"Select moderator for details:", - "PT-BR":"Escolha moderador para detalhes:", - "RU":"Выберите модератора для деталей:", - "NO":"Velg moderator for å vise detaljer", - "FR":"Sélectionne un modérateur pour plus de détails" - }, - "mods_add_new":{ - "NL":"Nieuwe moderator toevoegen:", - "DE":"Neuen Moderator hinzufügen:", - "EN":"Add new moderator:", - "IT":"Aggiungi nuovo moderatore:", - "PT-BR":"Adicionar novo moderador:", - "RU":"Добавить нового модератора:", - "NO":"Legg til ny moderator", - "FR":"Ajouter un nouveau modérateur :" - }, - "mods_delete":{ - "NL":"Moderator verwijderen:", - "DE":"Moderator löschen:", - "EN":"Delete moderator:", - "IT":"Rimuovi moderatore:", - "PT-BR":"Excluir moderador:", - "RU":"Удалить модератора:", - "NO":"Slett moderator:", - "FR":"Supprimer un modérteur :" - }, - "mods_list_of_all":{ - "NL":"Lijst met alle moderators.", - "DE":"Liste aller Moderatoren.", - "EN":"List of all moderators.", - "IT":"Lista di tutti i moderatori.", - "PT-BR":"Lista de todos os moderadores.", - "RU":"Список всех модераторов:", - "NO":"Lise over alle moderatorer", - "FR":"Liste des modérateurs :" - }, - "mods_list_add_delete":{ - "NL":"Lijst, toevoegen of verwijderen van moderators", - "DE":"Moderatoren anzeigen, hinzufügen oder löschen", - "EN":"List, add or remove moderators", - "IT":"Lista, aggiungi o rimuovi moderatori", - "PT-BR":"Listar, adicionar ou remover moderadores", - "RU":"Список, добавить или удалить модераторов", - "NO":"List, legg til eller fjern moderatorer", - "FR":"Liste, ajouter ou supprimer un modérateur" - }, - "mods_not_found":{ - "NL":"Error! Geen Moderator of gebruiker gevonden!", - "DE":"Fehler! Keine Moderatoren oder Benutzer gefunden!", - "EN":"Error! No moderators or users found!", - "IT":"Errore! Nessun moderatore o utente trovato!", - "PT-BR":"Erro! Nenhum moderador ou usuário encontrado!", - "RU":"Ошибка! Нет модераторов или ползователей", - "NO":"Feil! Ingen moderator eller brukere funnet!", - "FR":"Erreur : aucun modérateur ou utilisateur trouvé !" - }, - "mods_saved_mod":{ - "NL":"Moderator opgeslagen!", - "DE":"Moderator gespeichert!", - "EN":"Moderator saved!", - "IT":"Moderatore salvato!", - "PT-BR":"Moderador salvo!", - "RU":"Модератор сохранен!", - "NO":"Moderator lagret!", - "FR":"Modérateur enregistré !" - }, - "mods_delete_mod":{ - "NL":"Moderator verwijderd!", - "DE":"Moderator gelöscht!", - "EN":"Moderator deleted!", - "IT":"Moderatore rimosso!", - "PT-BR":"Moderador excluído!", - "RU":"Модератор удален!", - "NO":"Moderator slettet!", - "FR":"Modérateur supprimé !" - }, - "mods_info_about_mod":{ - "NL":"Informatie over deze moderator:", - "DE":"Infos zum diesem Moderator:", - "EN":"Info about this moderator:", - "IT":"Informazioni su questo moderatore:", - "PT-BR":"Informações sobre esse moderador:", - "RU":"Информация о модераторе", - "NO":"Informasjon om denne moderatoren", - "FR":"Info sur ce modérateur :" - } -} - diff --git a/lang/quest_action.json b/lang/quest_action.json new file mode 100644 index 0000000..3b39c39 --- /dev/null +++ b/lang/quest_action.json @@ -0,0 +1,278 @@ +{ + "quest_action_1001" : { + "NL": "Egg:Eggs", + "DE": "Ei aus:Eier aus", + "EN": "Egg:Eggs", + "FR": "Œuf:Œufs" + }, + "quest_action_2001" : { + "NL": "Pokestop:Pokestops", + "DE": "Pokestop:Pokestops", + "EN": "Pokestop:Pokestops", + "FR": "Pokéstop:Pokéstops" + }, + "quest_action_2002" : { + "NL": "pokestop or gym:pokestops or gyms", + "DE": "Pokestop oder Arena:Pokestops oder Arenen", + "EN": "pokestop or gym:pokestops or gyms", + "FR": "pokéstop ou arène:pokéstops ou arènes" + }, + "quest_action_2003" : { + "NL": "Pokestop you have not visited before:Pokestops you have not visited before", + "DE": "Pokestop, den du noch nicht besucht hast:Pokestops, die du noch nicht besucht hast", + "EN": "Pokestop you have not visited before:Pokestops you have not visited before", + "FR": "Pokéstop que tu n'as jamais visité avant:Pokéstops que tu n'as jamais visités avant" + }, + "quest_action_3001" : { + "NL": "Candy for walking with your buddy:Candies for walking with your buddy", + "DE": "Bonbon durch Spazieren mit deinem Kumpel:Bonbons durch Spazieren mit deinem Kumpel", + "EN": "Candy for walking with your buddy:Candies for walking with your buddy", + "FR": "Bonbon en marchant avec ton copain:Bonbons en marchant avec ton copain" + }, + "quest_action_4001" : { + "NL": "Pokemon:Pokemon", + "DE": "Pokemon:Pokemon", + "EN": "Pokemon:Pokemon", + "FR": "Pokémon:Pokémon" + }, + "quest_action_4002" : { + "NL": "Pokémon using an item:Pokémon using items", + "DE": "Pokemon mit Entwicklungsitem:Pokemon mit Entwicklungsitem", + "EN": "Pokémon using an item:Pokémon using items", + "FR": "TRANSLATE:TRANSLATE" + }, + "quest_action_5001" : { + "NL": "nice throw:nice throws", + "DE": "guten Wurf:gute Würfe", + "EN": "nice throw:nice throws", + "FR": "joli lancer:jolis lancers" + }, + "quest_action_5002" : { + "NL": "nice throw in a row:nice throws in a row", + "DE": "guten Wurf hintereinander:gute Würfe hintereinander", + "EN": "nice throw in a row:nice throws in a row", + "FR": "joli lancer à la suite:jolis lancers à la suite" + }, + "quest_action_5003" : { + "NL": "nice curveball:nice curveball throws", + "DE": "guten Curveball-Wurf:gute Curveball-Würfe", + "EN": "nice curveball throw:nice curveball throws", + "FR": "joli lancer à effet:jolis lancers à effet" + }, + "quest_action_5004" : { + "NL": "nice curveball throw in a row:nice curveball throws in a row", + "DE": "guten Curveball-Wurf hintereinander:gute Curveball-Würfe hintereinander", + "EN": "nice curveball throw in a row:nice curveball throws in a row", + "FR": "joli lancer à effet à la suite:jolis lancers à effet à la suite" + }, + "quest_action_5010" : { + "NL": "great throw:great throws", + "DE": "großartigen Wurf:großartige Würfe", + "EN": "great throw:great throws", + "FR": "superbe lancer:superbes lancers" + }, + "quest_action_5011" : { + "NL": "great throw in a row:great throws in a row", + "DE": "großartigen Wurf hintereinander:großartige Würfe hintereinander", + "EN": "great throw in a row:great throws in a row", + "FR": "superbe lancer à la suite:superbes lancers à la suite" + }, + "quest_action_5012" : { + "NL": "great curveball:great curveball throws", + "DE": "großartigen Curveball-Wurf:großartige Curveball-Würfe", + "EN": "great curveball throw:great curveball throws", + "FR": "superbe lancer à effet:superbes lancers à effet" + }, + "quest_action_5013" : { + "NL": "great curveball throw in a row:great curveball throws in a row", + "DE": "großartigen Curveball-Wurf hintereinander:großartige Curveball-Würfe hintereinander", + "EN": "great curveball throw in a row:great curveball throws in a row", + "FR": "superbe lancer à effet à la suite:superbes lancers à effet à la suite" + }, + "quest_action_5020" : { + "NL": "excellent throw:excellent throws", + "DE": "fabelhaften Wurf:fabelhafte Würfe", + "EN": "excellent throw:excellent throws", + "FR": "excellent lancer:excellents lancers" + }, + "quest_action_5021" : { + "NL": "excellent throw in a row:excellent throws in a row", + "DE": "fabelhaften Wurf hintereinander:fabelhafte Würfe hintereinander", + "EN": "excellent throw in a row:excellent throws in a row", + "FR": "excellent lancer à la suite:excellents lancers à la suite" + }, + "quest_action_5022" : { + "NL": "excellent curveball:excellent curveball throws", + "DE": "fabelhaften Curveball-Wurf:fabelhafte Curveball-Würfe", + "EN": "excellent curveball throw:excellent curveball throws", + "FR": "excellement lancer à effet:excellents lancers à effet" + }, + "quest_action_5023" : { + "NL": "excellent curveball throw in a row:excellent curveball throws in a row", + "DE": "fabelhaften Curveball-Wurf hintereinander:fabelhafte Curveball-Würfe hintereinander", + "EN": "excellent curveball throw in a row:excellent curveball throws in a row", + "FR": "excellent lancer à effet à la suite:excellents lancers à effet à la suite" + }, + "quest_action_5030" : { + "NL": "curveball throw:curveball throws", + "DE": "Curveball-Wurf:Curveball-Würfe", + "EN": "curveball throw:curveball throws", + "FR": "lancer à effet:lancers à effet" + }, + "quest_action_5031" : { + "NL": "curveball throw in a row:curveball throws in a row", + "DE": "Curveball-Wurf hintereinander:Curveball-Würfe hintereinander", + "EN": "curveball throw in a row:curveball throws in a row", + "FR": "lancer à effet à la suite:lancers à effet à la suite" + }, + "quest_action_6001" : { + "NL": "Pokemon:Pokemon", + "DE": "Pokemon:Pokemon", + "EN": "Pokemon:Pokemon", + "FR": "Pokémon:Pokémon" + }, + "quest_action_6002" : { + "NL": "Pokemon with weatherboost:Pokemon with weatherboost", + "DE": "Pokemon mit Wetterverstärkung:Pokemon mit Wetterverstärkung", + "EN": "Pokemon with weatherboost:Pokemon with weatherboost", + "FR": "Pokémon boosté par la météo:Pokémon boostés par la météo" + }, + "quest_action_6010" : { + "NL": "Seed Pokemon that is seen walking in a river:Seed Pokemon that are seen walking in a river", + "DE": "Samen-Pokemon, das in einem Fluss spazieren geht (Fange 1 Bisasam):Samen-Pokemon, die in einem Fluss spazieren gehen (Bisasam)", + "EN": "Seed Pokemon that is seen walking in a river:Seed Pokemon that are seen walking in a river", + "FR": "Seed Pokemon that is seen walking in a river:Seed Pokemon that are seen walking in a river" + }, + "quest_action_6011" : { + "NL": "Water-type Pokemon carried in a backpack:Water-type Pokemon carried in a backpack", + "DE": "Wasser-Pokemon, das in einem Rucksack getragen wird (Fange 1 Enton):Wasser-Pokemon, das in einem Rucksack getragen wird (Enton)", + "EN": "Water-type Pokemon carried in a backpack:Water-type Pokemon carried in a backpack", + "FR": "Water-type Pokemon carried in a backpack:Water-type Pokemon carried in a backpack" + }, + "quest_action_6012" : { + "NL": "Fire-type Evolution of Eevee:Fire-type Evolution of Eevee", + "DE": "Feuer-Typ-Entwicklung von Evoli (Fange 1 Flamara):Feuer-Typ-Entwicklung von Evoli (Flamara)", + "EN": "Fire-type Evolution of Eevee:Fire-type Evolution of Eevee", + "FR": "Fire-type Evolution of Eevee:Fire-type Evolution of Eevee" + }, + "quest_action_7001" : { + "NL": "time in a gym:times in a gym", + "DE": "Mal in einer Arena:Mal in einer Arena", + "EN": "time in a gym:times in a gym", + "FR": "fois dans une arène:fois dans une arène" + }, + "quest_action_7002" : { + "NL": "time in a raid:times in a raid", + "DE": "Mal in einem Raid:Mal in einem Raid", + "EN": "time in a raid:times in a raid", + "FR": "fois dans une raid:fois dans une raid" + }, + "quest_action_7003" : { + "NL": "time a team leader:times a team leader", + "DE": "Mal gegen einen Teamleader:Mal gegen einen Teamleader", + "EN": "time a team leader:times a team leader", + "FR": "time a team leader:times a team leader" + }, + "quest_action_7004" : { + "NL": "other trainer:times another trainer", + "DE": "Mal gegen einen anderen Trainer:Mal gegen einen anderen Trainer", + "EN": "other trainer:times another trainer", + "FR": "other trainer:times another trainer" + }, + "quest_action_8001" : { + "NL": "gymbattle:gymbattles", + "DE": "Arenakampf:Arenakämpfe", + "EN": "gymbattle:gymbattles", + "FR": "combat d'arène:combats d'arène" + }, + "quest_action_8002" : { + "NL": "raid:raids", + "DE": "Raid:Raids", + "EN": "raid:raids", + "FR": "raid:raids" + }, + "quest_action_8003" : { + "NL": "Tier-3 Raid or higher:Tier-3 Raids or higher", + "DE": "Level-3-Raid oder höher:Level-3-Raids oder höher", + "EN": "Tier-3 Raid or higher:Tier-3 Raids or higher", + "FR": "raid de niveau 3 ou plus:raid de niveau 3 ou plus" + }, + "quest_action_8004" : { + "NL": "Tier-2 Raid or higher:Tier-2 Raids or higher", + "DE": "Level-2-Raid oder höher:Level-2-Raids oder höher", + "EN": "Tier-2 Raid or higher:Tier-2 Raids or higher", + "FR": "raid de niveau 2 ou plus:raid de niveau 2 ou plus" + }, + "quest_action_9001" : { + "NL": "time a supereffective charged move in a gym:times a supereffective charged move in a gym", + "DE": "Mal eine sehr effektive Lade-Attacke in einem Kampf ein:Mal eine sehr effektive Lade-Attacke in einem Kampf ein", + "EN": "time a supereffective charged move in a gym:times a supereffective charged move in a gym", + "FR": "fois une attaque chargée surper efficace dans une arène:fois une attaue chargée super efficace dans une arène" + }, + "quest_action_9002" : { + "NL": "time a supereffective charged move in a gym or raid:times a supereffective charged move in a gym or raids", + "DE": "Mal eine sehr effektive Lade-Attacke in einem Kampf oder Raid ein:Mal eine sehr effektive Lade-Attacke in einem Kampf oder Raid ein", + "EN": "time a supereffective charged move in a gym or raid:times a supereffective charged move in a gym or raids", + "FR": "fois une attaque chargée surper efficace dans une arène:fois une attaue chargée super efficace dans une arène" + }, + "quest_action_9010" : { + "NL": "berry to catch pokemon:berries to catch pokemon", + "DE": "Beere beim Fangen von Pokemon:Beeren beim Fangen von Pokemon", + "EN": "berry to catch pokemon:berries to catch pokemon", + "FR": "baie pour attraper un Pokémon:baies pour attraper un Pokémon" + }, + "quest_action_9011" : { + "NL": "Pinap Berry while catching Pokemon:Pinap Berries while catching Pokemon", + "DE": "Sananabeere beim Fangen von Pokemon:Sananabeere beim Fangen von Pokemon", + "EN": "Pinap Berry while catching Pokemon:Pinap Berries while catching Pokemon", + "FR": "Baie Nanana:Baies Nananas" + }, + "quest_action_9012" : { + "NL": "Razz Berry to help catch a Pokemon:Razz Berries to help catch a Pokemon", + "DE": "Himmihbeere beim Fangen von Pokemon:Himmihbeeren beim Fangen von Pokemon", + "EN": "Razz Berry to help catch a Pokemon:Razz Berries to help catch a Pokemon", + "FR": "TRANSLATE:TRANSLATE" + }, + "quest_action_9013" : { + "NL": "Nanab Berry to help catch a Pokemon:Nanab Berries to help catch a Pokemon", + "DE": "Nanabbeere beim Fangen von Pokemon:Nanabbeeren beim Fangen von Pokemon", + "EN": "Nanab Berry to help catch a Pokemon:Razz Berries to help catch a Pokemon", + "FR": "TRANSLATE:TRANSLATE" + }, + "quest_action_10001" : { + "NL": "time a pokemon:times a pokemon", + "DE": "Pokemon:Pokemon", + "EN": "time a pokemon:times a pokemon", + "FR": "fois un Pokémon:fois un Pokémon" + }, + "quest_action_11001" : { + "NL": "Gift:Gifts", + "DE": "Geschenk:Geschenke", + "EN": "Gift:Gifts", + "FR": "cadeau:cadeaux" + }, + "quest_action_11002" : { + "NL": "Pokemon:Pokemon", + "DE": "Pokemon:Pokemon", + "EN": "Pokemon:Pokemon", + "FR": "Pokémon:Pokémon" + }, + "quest_action_12001" : { + "NL": "Pokemon:Pokemon", + "DE": "Pokemon:Pokemon", + "EN": "Pokemon:Pokemon", + "FR": "Pokémon:Pokémon" + }, + "quest_action_13002" : { + "NL": "Team GO Rocket Grunt:Team GO Rocket Grunts", + "DE": "Team GO Rocket Rüpel:Team GO Rocket Rüpel", + "EN": "Team GO Rocket Grunt:Team GO Rocket Grunts", + "FR": "Team GO Rocket Grunt:Team GO Rocket Grunts" + }, + "quest_action_14002" : { + "NL": "Pokemon:Pokemon", + "DE": "Pokemon:Pokemon", + "EN": "Pokemon:Pokemon", + "FR": "Pokémon:Pokémon" + } +} diff --git a/lang/quest_event.json b/lang/quest_event.json new file mode 100644 index 0000000..3a6080b --- /dev/null +++ b/lang/quest_event.json @@ -0,0 +1,20 @@ +{ + "quest_event_1" : { + "NL": "Eggstravaganza", + "DE": "Ei-Spektakel", + "EN": "Eggstravaganza", + "FR": "Eggstravaganza" + }, + "quest_event_2" : { + "NL": "Detective Pikachu", + "DE": "Meisterdetektiv Pikachu", + "EN": "Detective Pikachu", + "FR": "Detective Pikachu" + }, + "quest_event_3" : { + "NL": "Adventure Week 2019", + "DE": "Abenteuerwoche 2019", + "EN": "Adventure Week 2019", + "FR": "Adventure Week 2019" + } +} diff --git a/lang/quest_type.json b/lang/quest_type.json new file mode 100644 index 0000000..649b34f --- /dev/null +++ b/lang/quest_type.json @@ -0,0 +1,86 @@ +{ + "quest_type_1" : { + "NL": "Hatch", + "DE": "Brüte", + "EN": "Hatch", + "FR": "Fais éclore" + }, + "quest_type_2" : { + "NL": "Spin", + "DE": "Drehe", + "EN": "Spin", + "FR": "Tourne" + }, + "quest_type_3" : { + "NL": "Earn", + "DE": "Verdiene", + "EN": "Earn", + "FR": "Gagne" + }, + "quest_type_4" : { + "NL": "Evolve", + "DE": "Entwickle", + "EN": "Evolve", + "FR": "Fais évoluer" + }, + "quest_type_5" : { + "NL": "Make", + "DE": "Lande", + "EN": "Make", + "FR": "Fais" + }, + "quest_type_6" : { + "NL": "Catch", + "DE": "Fange", + "EN": "Catch", + "FR": "Attrape" + }, + "quest_type_7" : { + "NL": "Battle", + "DE": "Kämpfe", + "EN": "Battle", + "FR": "Combat" + }, + "quest_type_8" : { + "NL": "Win", + "DE": "Gewinne", + "EN": "Win", + "FR": "Gagne" + }, + "quest_type_9" : { + "NL": "Use", + "DE": "Verwende/Setze", + "EN": "Use", + "FR": "Utilise" + }, + "quest_type_10" : { + "NL": "Power-up", + "DE": "Power-Up", + "EN": "Power-up", + "FR": "Recharge" + }, + "quest_type_11" : { + "NL": "Send/Transfer", + "DE": "Verschicke", + "EN": "Send/Transfer", + "FR": "Envoie" + }, + "quest_type_12" : { + "NL": "Trade", + "DE": "Tausche", + "EN": "Trade", + "FR": "Echange" + }, + "quest_type_13" : { + "NL": "Defeat", + "DE": "Besiege", + "EN": "Defeat", + "FR": "Defeat" + }, + "quest_type_14" : { + "NL": "Snapshot", + "DE": "Fotografiere", + "EN": "Snapshot", + "FR": "Snapshot" + } +} diff --git a/lang/reward_type.json b/lang/reward_type.json new file mode 100644 index 0000000..1f67ea9 --- /dev/null +++ b/lang/reward_type.json @@ -0,0 +1,116 @@ +{ + "reward_type_1" : { + "NL": "Pokemon:Pokemon", + "DE": "Pokemon:Pokemon", + "EN": "Pokemon:Pokemon", + "FR": "Pokémon:Pokémon" + }, + "reward_type_2" : { + "NL": "Pokeball:Pokeballs", + "DE": "Pokeball:Pokebälle", + "EN": "Pokeball:Pokeballs", + "FR": "Poké Ball: Poké Balls" + }, + "reward_type_3" : { + "NL": "Stardust:Stardust", + "DE": "Sternenstaub:Sternenstaub", + "EN": "Stardust:Stardust", + "FR": "Poussières d'étoiles:Poussières d'étoiles" + }, + "reward_type_4" : { + "NL": "Rare candy:Rare candies", + "DE": "Sonderbonbon:Sonderbonbons", + "EN": "Rare candy:Rare candies", + "FR": "Super Bonbon:Supers Bonbons" + }, + "reward_type_5" : { + "NL": "Fast-TM:Fast-TMs", + "DE": "Sofort-TM:Sofort-TMs", + "EN": "Fast-TM:Fast-TMs", + "FR": "CT Attaque Immédiate:CT Attaque Immédiate" + }, + "reward_type_6" : { + "NL": "Charged-TM:Charged-TMs", + "DE": "Lade-TM:Lade-TMs", + "EN": "Charged-TM:Charged-TMs", + "FR": "CAT Attaque Chargée:CT Attaque Chargée" + }, + "reward_type_7" : { + "NL": "Berry:Berries", + "DE": "Beere:Beeren", + "EN": "Berry:Berries", + "FR": "Baie:Baies" + }, + "reward_type_8" : { + "NL": "golden Berry:golden Berries", + "DE": "goldene Beere:goldene Beeren", + "EN": "golden Berry:golden Berries", + "FR": "Baie Framby dorée:Baies Framby dorées" + }, + "reward_type_9" : { + "NL": "silver Berry:silver Berries", + "DE": "silberne Beere:silberne Beeren", + "EN": "silver Berry:silver Berries", + "FR": "Baie Nanana argentée:Baies Nanana argentées" + }, + "reward_type_10" : { + "NL": "Potion:Potions", + "DE": "Trank:Tränke", + "EN": "Potion:Potions", + "FR": "Potion:Potions" + }, + "reward_type_11" : { + "NL": "Max Potion:Max Potions", + "DE": "Top-Trank:Top-Tränke", + "EN": "Max Potion:Max Potions", + "FR": "Potion Max:Potions Max" + }, + "reward_type_12" : { + "NL": "Revive:Revives", + "DE": "Beleber:Beleber", + "EN": "Revive:Revives", + "FR": "Rappel:Rappels" + }, + "reward_type_13" : { + "NL": "Max Revive:Max Revives", + "DE": "Top-Beleber:Top-Beleber", + "EN": "Max Revive:Max Revives", + "FR": "Rappel Max:Rappels Max" + }, + "reward_type_14" : { + "NL": "Evolve Item:Evolve items", + "DE": "Entwicklungs-Item:Entwicklungs-Items", + "EN": "Evolve Item:Evolve items", + "FR": "Objet d'évolution:Objets d'évolution" + }, + "reward_type_15" : { + "NL": "Dragon Scale:Dragon Scales", + "DE": "Drachenhaut:Drachenhäute", + "EN": "Dragon Scale:Dragon Scales", + "FR": "Ecaille Draco:Ecailles Draco" + }, + "reward_type_16" : { + "NL": "Sun Stone:Sun Stones", + "DE": "Sonnenstein:Sonnensteine", + "EN": "Sun Stones:Sun Stones", + "FR": "Pierre Soleil:Pierres Soleil" + }, + "reward_type_17" : { + "NL": "King's Rock:King's Rocks", + "DE": "King-Stein:King-Steine", + "EN": "King's Rock:King's Rocks", + "FR": "Roche Royale:Roches Royale" + }, + "reward_type_18" : { + "NL": "Metal Coat:Metal Coats", + "DE": "Metallmantel:Metallmäntel", + "EN": "Metal Coat:Metal Coats", + "FR": "Peau Métal:Peaux Métal" + }, + "reward_type_19" : { + "NL": "Up-Grade:Up-Grades", + "DE": "Up-Grade:Up-Grades", + "EN": "Up-Grade:Up-Grades", + "FR": "Améliorator:Améliorators" + } +} diff --git a/logic.php b/logic.php old mode 100755 new mode 100644 index d1b82ba..b5226ed --- a/logic.php +++ b/logic.php @@ -1,156 +1,4 @@ ' . getTranslation('bot_access_denied') . ''; - // Edit message or send new message based on value of $update_type - if ($update_type == 'callback_query') { - $keys = []; - // Edit message. - edit_message($update, $response_msg, $keys); - // Answer the callback. - answerCallbackQuery($update[$update_type]['id'], getTranslation('bot_access_denied')); - } else { - sendMessage($update[$update_type]['from']['id'], $response_msg); - } - exit; - } - } else { - $msg = ''; - $msg .= !empty($update['message']['from']['id']) ? "Id: " . $update['message']['from']['id'] . CR : ''; - $msg .= !empty($update['message']['from']['username']) ? "Username: " . $update['message']['from']['username'] . CR : ''; - $msg .= !empty($update['message']['from']['first_name']) ? "First Name: " . $update['message']['from']['first_name'] . CR : ''; - debug_log("Bot access is not restricted! Allowing access for user: " . CR . $msg); - return true; - } -} /** * Quest access check. @@ -158,7 +6,7 @@ function bot_access_check($update, $access_type = BOT_ACCESS, $return_result = f * @param $data * @return bool */ -function quest_access_check($update, $data, $return_result = false) +function quest_access_check($update, $data, $permission, $return_result = false) { // Default: Deny access to quests $quest_access = false; @@ -168,59 +16,25 @@ function quest_access_check($update, $data, $return_result = false) " SELECT user_id FROM quests - WHERE id = {$data['id']} + WHERE id = {$data['id']} " ); $quest = $rs->fetch_assoc(); + // Check permissions if ($update['callback_query']['from']['id'] != $quest['user_id']) { - // Build query. - $rs = my_query( - " - SELECT COUNT(*) - FROM users - WHERE user_id = {$update['callback_query']['from']['id']} - AND moderator = 1 - " - ); - - $row = $rs->fetch_row(); - - if (empty($row['0'])) { - $admin_access = bot_access_check($update, BOT_ADMINS, true); - if ($admin_access) { - // Allow quest access - $quest_access = true; - } - } else { - // Allow quest access - $quest_access = true; - } - } else { - // Allow quest access - $quest_access = true; - } - - // Allow or deny access to the quest and log result - if ($quest_access && !$return_result) { - debug_log("Allowing access to the quest"); - } else if ($quest_access && $return_result) { - debug_log("Allowing access to the quest"); - return $quest_access; - } else if (!$quest_access && $return_result) { - debug_log("Denying access to the quest"); - return $quest_access; + // Check "-all" permission + $permission = $permission . '-all'; + $quest_access = bot_access_check($update, $permission, $return_result); } else { - $keys = []; - if (isset($update['callback_query']['inline_message_id'])) { - editMessageText($update['callback_query']['inline_message_id'], '' . getTranslation('quest_access_denied') . '', $keys); - } else { - editMessageText($update['callback_query']['message']['message_id'], '' . getTranslation('quest_access_denied') . '', $keys, $update['callback_query']['message']['chat']['id'], $keys); - } - answerCallbackQuery($update['callback_query']['id'], getTranslation('quest_access_denied')); - exit; + // Check "-own" permission + $permission = $permission . '-own'; + $quest_access = bot_access_check($update, $permission, $return_result); } + + // Return result + return $quest_access; } /** @@ -236,7 +50,8 @@ function quest_duplication_check($pokestop_id) " SELECT id, pokestop_id FROM quests - WHERE quest_date = CURDATE() + WHERE quest_date > UTC_DATE() + AND quest_date < UTC_DATE() + INTERVAL 1 DAY AND pokestop_id > 0 AND pokestop_id = {$pokestop_id} " @@ -251,252 +66,191 @@ function quest_duplication_check($pokestop_id) } /** - * Get raid level of a pokemon. - * @param $pokedex_id - * @return string + * Invasion access check. + * @param $update + * @param $data + * @return bool */ -function get_raid_level($pokedex_id) +function invasion_access_check($update, $data, $permission, $return_result = false) { - // Make sure $pokedex_id is numeric - if(is_numeric($pokedex_id)) { - // Get raid level from database - $rs = my_query( - " - SELECT raid_level - FROM pokemon - WHERE pokedex_id = $pokedex_id - " - ); + // Default: Deny access to invasions + $quest_access = false; - $raid_level = '0'; - while ($level = $rs->fetch_assoc()) { - $raid_level = $level['raid_level']; - } - } else { - $raid_level = '0'; - } + // Build query. + $rs = my_query( + " + SELECT user_id + FROM invasions + WHERE id = {$data['id']} + " + ); - return $raid_level; -} + $invasion = $rs->fetch_assoc(); -/** - * Get local name of pokemon. - * @param $pokedex_id - * @param $override_language - * @param $type: raid|quest - * @return string - */ -function get_local_pokemon_name($pokedex_id, $override_language = false, $type = '') -{ - // Get translation type - if($override_language == true && $type != '' && ($type == 'raid' || $type == 'quest')) { - $getTypeTranslation = 'get' . ucfirst($type) . 'Translation'; + // Check permissions + if ($update['callback_query']['from']['id'] != $invasion['user_id']) { + // Check "-all" permission + $permission = $permission . '-all'; + $invasion_access = bot_access_check($update, $permission, $return_result); } else { - $getTypeTranslation = 'getTranslation'; - } - // Init pokemon name and define fake pokedex ids used for raid eggs - $pokemon_name = ''; - $eggs = $GLOBALS['eggs']; - - // Get eggs from normal translation. - if(in_array($pokedex_id, $eggs)) { - $pokemon_name = $getTypeTranslation('egg_' . substr($pokedex_id, -1)); - } else { - $pokemon_name = $getTypeTranslation('pokemon_id_' . $pokedex_id); - } - - // Fallback 1: Valid pokedex id or just a raid egg? - if($pokedex_id === "NULL" || $pokedex_id == 0) { - $pokemon_name = $getTypeTranslation('egg_0'); - - // Fallback 2: Get original pokemon name from database - } else if(empty($pokemon_name) && $type == 'raid') { - $rs = my_query( - " - SELECT pokemon_name - FROM pokemon - WHERE pokedex_id = $pokedex_id - " - ); - - while ($pokemon = $rs->fetch_assoc()) { - $pokemon_name = $pokemon['pokemon_name']; - } + // Check "-own" permission + $permission = $permission . '-own'; + $invasion_access = bot_access_check($update, $permission, $return_result); } - return $pokemon_name; + // Return result + return $invasion_access; } /** - * Get questlist entry. - * @param $questlist_id + * Invasion duplication check. + * @param $pokestop_id * @return array */ -function get_questlist_entry($questlist_id) +function invasion_duplication_check($pokestop_id) { - // Get the questlist entry by id. + // Check if invasion already exists for this pokestop. + // Exclude unnamed pokestops with pokestop_id 0. $rs = my_query( " - SELECT * - FROM questlist - WHERE id = {$questlist_id} + SELECT id, pokestop_id + FROM invasions + WHERE end_time > UTC_TIMESTAMP() + AND pokestop_id > 0 + AND pokestop_id = {$pokestop_id} " ); // Get the row. - $ql_entry = $rs->fetch_assoc(); + $invasion = $rs->fetch_assoc(); - debug_log($ql_entry); + debug_log($invasion); - return $ql_entry; + return $invasion; } /** - * Get quest. - * @param $quest_id + * Get invasion. + * @param $invasion_id * @return array */ -function get_quest($quest_id) +function get_invasion($invasion_id) { - // Get the quest data by id. + // Get the invasion data by id. $rs = my_query( " - SELECT quests.*, + SELECT invasions.*, users.name, - pokestops.pokestop_name, pokestops.lat, pokestops.lon, pokestops.address, - questlist.quest_type, questlist.quest_quantity, questlist.quest_action, - rewardlist.reward_type, rewardlist.reward_quantity, - encounterlist.pokedex_ids - FROM quests + pokestops.pokestop_name, pokestops.lat, pokestops.lon, pokestops.address + FROM invasions LEFT JOIN users - ON quests.user_id = users.user_id + ON invasions.user_id = users.user_id LEFT JOIN pokestops - ON quests.pokestop_id = pokestops.id - LEFT JOIN questlist - ON quests.quest_id = questlist.id - LEFT JOIN rewardlist - ON quests.reward_id = rewardlist.id - LEFT JOIN encounterlist - ON quests.quest_id = encounterlist.quest_id - WHERE quests.id = {$quest_id} + ON invasions.pokestop_id = pokestops.id + WHERE invasions.id = {$invasion_id} " ); // Get the row. - $quest = $rs->fetch_assoc(); + $invasion = $rs->fetch_assoc(); - debug_log($quest); + debug_log($invasion); - return $quest; + return $invasion; } /** - * Get quest and reward as formatted string. - * @param $quest array + * Get invasion as formatted string. + * @param $invasion array * @param $add_creator bool * @param $add_timestamp bool * @param $compact_format bool * @param $override_language bool + * @param $inline_format bool * @return array */ -function get_formatted_quest($quest, $add_creator = false, $add_timestamp = false, $compact_format = false, $override_language = false) +function get_formatted_invasion($invasion, $add_creator = false, $add_timestamp = false, $compact_format = false, $override_language = false, $inline_format = false) { /** Example: + * Invasion: 13:05 to approx. 13:35 * Pokestop: Reward-Stop Number 1 - * Quest-Street 5, 13579 Poke-City - * Quest: Hatch 1 Egg - * Reward: Magikarp or Onix + * Invasion-Street 5, 13579 Poke-City + * Info: Snorlax (Snorlax, Snorlax and Dragonite battle) */ // Get translation type if($override_language == true) { - $getTypeTranslation = 'getQuestTranslation'; + $getTypeTranslation = 'getPublicTranslation'; } else { $getTypeTranslation = 'getTranslation'; } // Pokestop name and address. - $pokestop_name = SP . '' . (!empty($quest['pokestop_name']) ? ($quest['pokestop_name']) : ($getTypeTranslation('unnamed_pokestop'))) . '' . CR; + $pokestop_name = '' . (!empty($invasion['pokestop_name']) ? ($invasion['pokestop_name']) : ($getTypeTranslation('unnamed_pokestop'))) . '' . CR; // Get pokestop info. - $stop = get_pokestop($quest['pokestop_id']); + $stop = get_pokestop($invasion['pokestop_id']); // Add google maps link. - if(!empty($quest['address'])) { - $pokestop_address = '' . $quest['address'] . ''; - } else if(!empty($stop['address'])) { + if(!empty($stop['address'])) { $pokestop_address = '' . $stop['address'] . ''; + } else if(!empty($invasion['address'])) { + $pokestop_address = '' . $invasion['address'] . ''; } else { - $pokestop_address = 'http://maps.google.com/maps?q=' . $quest['lat'] . ',' . $quest['lon'] . ''; - } - - // Quest action: Singular or plural? - $quest_action = explode(":", $getTypeTranslation('quest_action_' . $quest['quest_action'])); - $quest_action_singular = $quest_action[0]; - $quest_action_plural = $quest_action[1]; - $qty_action = $quest['quest_quantity'] . SP . (($quest['quest_quantity'] > 1) ? ($quest_action_plural) : ($quest_action_singular)); - - // Reward type: Singular or plural? - $reward_type = explode(":", $getTypeTranslation('reward_type_' . $quest['reward_type'])); - $reward_type_singular = $reward_type[0]; - $reward_type_plural = $reward_type[1]; - $qty_reward = $quest['reward_quantity'] . SP . (($quest['reward_quantity'] > 1) ? ($reward_type_plural) : ($reward_type_singular)); - - // Reward pokemon forecast? - $msg_poke = ''; - - if($quest['pokedex_ids'] != '0' && $quest['reward_type'] == 1) { - $quest_pokemons = explode(',', $quest['pokedex_ids']); - // Get local pokemon name - foreach($quest_pokemons as $pokedex_id) { - $msg_poke .= ($override_language == true) ? (get_local_pokemon_name($pokedex_id, true, 'quest')) : (get_local_pokemon_name($pokedex_id)); - $msg_poke .= ' / '; - } - // Trim last slash - $msg_poke = rtrim($msg_poke,' / '); - $msg_poke = (!empty($msg_poke) ? $msg_poke : ''); + $pokestop_address = 'http://maps.google.com/maps?q=' . $invasion['lat'] . ',' . $invasion['lon'] . ''; } - // Build quest message + // Build invasion message $msg = ''; if($compact_format == false) { - $msg .= $getTypeTranslation('pokestop') . ':' . $pokestop_name . $pokestop_address . CR; - $msg .= $getTypeTranslation('quest') . ': ' . $getTypeTranslation('quest_type_' . $quest['quest_type']) . SP . $qty_action . '' . CR; - $msg .= $getTypeTranslation('reward') . ': ' . (!empty($msg_poke) ? $msg_poke : $qty_reward) . '' . CR; + $msg .= '' . $getTypeTranslation('invasion') . SP . dt2time($invasion['start_time']) . SP . $getTypeTranslation('until_approx') . SP . dt2time($invasion['end_time']) . '' . CR; + $msg .= $getTypeTranslation('pokestop') . ': ' . $pokestop_name . $pokestop_address; + } else if ($inline_format == true) { + $msg .= dt2time($invasion['start_time']) . SP . $getTypeTranslation('until_approx') . SP . dt2time($invasion['end_time']); } else { - $msg .= $getTypeTranslation('quest_type_' . $quest['quest_type']) . SP . $qty_action . ' — ' . (!empty($msg_poke) ? $msg_poke : $qty_reward); + $msg .= dt2time($invasion['start_time']) . SP . $getTypeTranslation('until_approx') . SP . dt2time($invasion['end_time']) . CR . $pokestop_name . $pokestop_address; + } + + // Add comment to message. + if(!empty($invasion['comment'])) { + $msg .= CR . $getTypeTranslation('info') . ': ' . '' . $invasion['comment'] . ''; } //Add custom message from the config. - if (defined('MAP_URL') && !empty(MAP_URL)) { - $msg .= CR . MAP_URL ; + if($compact_format == false && defined('MAP_URL') && !empty(MAP_URL)) { + $msg .= CR . CR . MAP_URL; + } else if($compact_format == false) { + $msg .= CR; } // Display creator. - $msg .= ($quest['user_id'] && $add_creator == true) ? (CR . $getTypeTranslation('created_by') . ': ' . htmlspecialchars($quest['name']) . '') : ''; + $msg .= ($invasion['user_id'] && $add_creator == true) ? (CR . $getTypeTranslation('created_by') . ': ' . htmlspecialchars($invasion['name']) . '') : ''; - // Add update time and quest id to message. + // Add update time and invasion id to message. if($add_timestamp == true) { - $quest_date = explode(' ', $quest['quest_date']); - $msg .= CR . '' . $getTypeTranslation('updated') . ': ' . $quest_date[0] . ''; - $msg .= ' ' . substr(strtoupper(BOT_ID), 0, 1) . '-ID = ' . $quest['id']; // DO NOT REMOVE! --> NEEDED FOR CLEANUP PREPARATION! + $msg .= CR . '' . $getTypeTranslation('updated') . ': ' . dt2time('now', 'H:i:s') . ''; + // Commented without the little dirty hack: + //$msg .= ' ' . substr(strtoupper(BOT_ID), 0, 1) . '-ID = ' . $invasion['id']; // DO NOT REMOVE! --> NEEDED FOR CLEANUP PREPARATION! + // Dirty hack: Make invasion ID negative, so we can differ from quest id. + $msg .= ' ' . substr(strtoupper(BOT_ID), 0, 1) . '-ID = -' . $invasion['id']; // DO NOT REMOVE! --> NEEDED FOR CLEANUP PREPARATION! } return $msg; } + /** - * Get today's quests as formatted string. + * Get current invasions as formatted string. * @return string */ -function get_todays_formatted_quests() +function get_current_formatted_invasions() { - // Get the quest data by id. + // Get the invasion data by id. $rs = my_query( " SELECT id - FROM quests - WHERE quest_date = CURDATE() + FROM invasions + WHERE end_time > UTC_TIMESTAMP() " ); @@ -504,88 +258,39 @@ function get_todays_formatted_quests() $msg = ''; $count = 0; - // Get the quests. - while ($todays_quests = $rs->fetch_assoc()) { - $quest = get_quest($todays_quests['id']); - $msg .= CR . '' . (!empty($quest['pokestop_name']) ? ($quest['pokestop_name']) : (getTranslation('unnamed_pokestop'))) . '' . CR; - $msg .= get_formatted_quest($quest, false, false, true, false); + // Get the invasions. + while ($current_invasions = $rs->fetch_assoc()) { + $invasion = get_invasion($current_invasions['id']); + $msg .= CR . get_formatted_invasion($invasion, false, false, true, false); $msg .= CR; $count = $count + 1; } - // No quests today? + // No invasions currently? if($count == 0) { - $msg = getTranslation('no_quests_today'); + $msg = getTranslation('no_invasions_currently'); } else { // Add update time to message. - $msg .= CR . '' . getTranslation('updated') . ': ' . date('H:i:s') . ''; + $msg .= CR . '' . getTranslation('updated') . ': ' . dt2time('now', 'H:i:s') . ''; } return $msg; } /** - * Get rewardlist entry. - * @param $reward_id - * @return array - */ -function get_rewardlist_entry($reward_id) -{ - // Get the reward data by id. - $rs = my_query( - " - SELECT * - FROM rewardlist - WHERE id = {$reward_id} - " - ); - - // Get the row. - $reward = $rs->fetch_assoc(); - - debug_log($reward); - - return $reward; -} - -/** - * Get encounterlist entry. - * @param $reward_id - * @return array - */ -function get_encounterlist_entry($quest_id) -{ - // Get the reward data by id. - $rs = my_query( - " - SELECT pokedex_ids - FROM encounterlist - WHERE quest_id = {$quest_id} - " - ); - - // Get the row. - $encounters = $rs->fetch_assoc(); - - debug_log($encounters); - - return $encounters; -} - -/** - * Delete quest. - * @param $quest_id + * Delete invasion. + * @param $invasion_id */ -function delete_quest($quest_id) +function delete_invasion($invasion_id) { global $db; - // Delete telegram messages for quest. + // Delete telegram messages for invasion. $rs = my_query( " SELECT * FROM qleanup - WHERE quest_id = '{$quest_id}' + WHERE quest_id = '-{$invasion_id}' AND chat_id <> 0 " ); @@ -596,85 +301,2064 @@ function delete_quest($quest_id) // Delete every telegram message while ($row = $rs->fetch_assoc()) { // Delete telegram message. - debug_log('Deleting telegram message ' . $row['message_id'] . ' from chat ' . $row['chat_id'] . ' for quest ' . $row['quest_id']); + debug_log('Deleting telegram message ' . $row['message_id'] . ' from chat ' . $row['chat_id'] . ' for invasion ' . $row['quest_id']); delete_message($row['chat_id'], $row['message_id']); $counter = $counter + 1; } // Nothing to delete on telegram. if ($counter == 0) { - debug_log('Quest with ID ' . $quest_id . ' was not found in the cleanup table! Skipping deletion of telegram messages!'); + debug_log('Invasion with ID ' . $invasion_id . ' was not found in the cleanup table! Skipping deletion of telegram messages!'); } - // Delete quest from cleanup table. - debug_log('Deleting quest ' . $quest_id . ' from the cleanup table:'); + // Delete invasion from cleanup table. + debug_log('Deleting invasion ' . $invasion_id . ' from the cleanup table:'); $rs_cleanup = my_query( " DELETE FROM qleanup - WHERE quest_id = '{$quest_id}' - OR cleaned = '{$quest_id}' + WHERE quest_id = '-{$invasion_id}' + OR cleaned = '-{$invasion_id}' " ); - // Delete quest from quest table. - debug_log('Deleting quest ' . $quest_id . ' from the quest table:'); - $rs_quests = my_query( + // Delete invasion from invasions table. + debug_log('Deleting invasion ' . $invasion_id . ' from the invasions table:'); + $rs_invasions = my_query( " - DELETE FROM quests - WHERE id = '{$quest_id}' + DELETE FROM invasions + WHERE id = '{$invasion_id}' " ); } /** - * Get pokestop. - * @param $pokestop_id - * @return array + * Get local name of pokemon. + * @param $pokedex_id + * @param $override_language + * @return string */ -function get_pokestop($pokestop_id, $update_pokestop = true) +function get_local_pokemon_name($pokedex_id, $override_language = false) { - global $db; + // Get translation type + if($override_language == true) { + $getTypeTranslation = 'getPublicTranslation'; + } else { + $getTypeTranslation = 'getTranslation'; + } - // Pokestop from database - if($pokestop_id != 0) { - // Get pokestop from database - $rs = my_query( - " - SELECT * - FROM pokestops - WHERE id = {$pokestop_id} - " - ); + // Init pokemon name and get translation + $pokemon_name = ''; + $pokemon_name = $getTypeTranslation('pokemon_id_' . $pokedex_id); + + return $pokemon_name; +} + +/** + * Get questlist entry. + * @param $questlist_id + * @return array + */ +function get_questlist_entry($questlist_id) +{ + // Get the questlist entry by id. + $rs = my_query( + " + SELECT * + FROM questlist + WHERE id = {$questlist_id} + " + ); + + // Get the row. + $ql_entry = $rs->fetch_assoc(); + + debug_log($ql_entry); + + return $ql_entry; +} + +/** + * Get quest. + * @param $quest_id + * @return array + */ +function get_quest($quest_id) +{ + // Get the quest data by id. + $rs = my_query( + " + SELECT quests.*, + users.name, + pokestops.pokestop_name, pokestops.lat, pokestops.lon, pokestops.address, + questlist.quest_event, questlist.quest_type, questlist.quest_quantity, questlist.quest_action, questlist.quest_pokedex_ids, questlist.quest_poketypes, + rewardlist.reward_type, rewardlist.reward_quantity, + encounterlist.pokedex_ids + FROM quests + LEFT JOIN users + ON quests.user_id = users.user_id + LEFT JOIN pokestops + ON quests.pokestop_id = pokestops.id + LEFT JOIN questlist + ON quests.quest_id = questlist.id + LEFT JOIN rewardlist + ON quests.reward_id = rewardlist.id + LEFT JOIN encounterlist + ON quests.quest_id = encounterlist.quest_id + WHERE quests.id = {$quest_id} + " + ); + + // Get the row. + $quest = $rs->fetch_assoc(); + + debug_log($quest); + + return $quest; +} + +/** + * Get formatted quest from questlist. + * @param quest_id + * @param hide_id + * @return string + */ +function get_formatted_questlist_entry($quest_id, $hide_id = false) +{ + // Get quest from questlist. + $ql_entry = get_questlist_entry($quest_id); + + // Init empty questlist message. + $msg_questlist = ''; + + // Build message. + $qty_action = get_quest_action($ql_entry); + if($hide_id == false) { + $msg_questlist .= 'ID: ' . $ql_entry['id'] . ' — '; + } + + // Event? + if($ql_entry['quest_event'] > 0) { + $msg_questlist .= getTranslation('quest_event_'. $ql_entry['quest_event']) . ':' . SP . getTranslation('quest_type_'. $ql_entry['quest_type']) . SP . $qty_action; + } else { + $msg_questlist .= getTranslation('quest_type_'. $ql_entry['quest_type']) . SP . $qty_action; + } + + return $msg_questlist; +} + +/** + * Get all quests in questlist. + * @param hide_encounter + * @return string + */ +function get_all_questlist_entries($hide_encounter = false) +{ + // Get all quests from questlist. + $rs = my_query( + " + SELECT * + FROM questlist + ORDER BY quest_event, id + " + ); + + // Init empty questlist message. + $msg_questlist = ''; + + // Build message. + while ($questlist = $rs->fetch_assoc()) { + // Hide quests with encounters if requested and found. + $el_entry = get_encounterlist_entry($questlist['id']); + if($hide_encounter == true && $el_entry) continue; + + // Get quest action. + $qty_action = get_quest_action($questlist); + + // Build questlist message. + $msg_questlist .= 'ID: ' . $questlist['id'] . ' — '; + + // Event? + if($questlist['quest_event'] > 0) { + $msg_questlist .= '' . getTranslation('quest_event_'. $questlist['quest_event']) . ':' . SP . getTranslation('quest_type_'. $questlist['quest_type']) . SP . $qty_action . CR; + } else { + $msg_questlist .= getTranslation('quest_type_'. $questlist['quest_type']) . SP . $qty_action . CR; + } + } + + return $msg_questlist; +} + +/** + * Get keys for all quests in questlist. + * @param action + * @param arg + * @param hide_encounter + * @return array + */ +function get_all_questlist_keys($action, $arg, $hide_encounter = false) +{ + // Get all quests from questlist. + $rs = my_query( + " + SELECT id + FROM questlist + ORDER BY quest_event, id + " + ); + + // Init empty keys array. + $keys = array(); + + // Add key for each quest + while ($ql_entry = $rs->fetch_assoc()) { + // Hide quests with encounters if requested and found. + $el_entry = get_encounterlist_entry($ql_entry['id']); + if($hide_encounter == true && $el_entry) continue; + + $keys[] = array( + 'text' => $ql_entry['id'], + 'callback_data' => $ql_entry['id'] . ':' . $action . ':' . $arg + ); + } + + // Add quick selection keys. + $keys = inline_key_array($keys, 5); + + //debug_log($keys); + + return $keys; +} + +/** + * Get all encounters in encounterlist. + * @return string + */ +function get_all_encounterlist_entries() +{ + // Get all encounters from encounterlist. + $rs = my_query( + " + SELECT * + FROM encounterlist + " + ); + + // Init empty encounterlist message. + $msg_enclist = ''; + + // Build message. + while ($enclist = $rs->fetch_assoc()) { + // Get quest. + $msg_quest = get_formatted_questlist_entry($enclist['quest_id'], true); + + // Get encounters + $quest_pokemons = explode(',', $enclist['pokedex_ids']); + + // Get local pokemon name + $msg_poke = ''; + foreach($quest_pokemons as $pokedex_id) { + $msg_poke .= get_local_pokemon_name($pokedex_id); + $msg_poke .= ' / '; + } + // Trim last slash + $msg_poke = rtrim($msg_poke,' / '); + + // Build encounterlist message. + $msg_enclist .= 'ID: ' . $enclist['id'] . ' — '; + $msg_enclist .= $msg_quest; + $msg_enclist .= SP . '(' . $msg_poke . ')' . CR; + } + + return $msg_enclist; +} + +/** + * Get formatted encounter from encounterlist. + * @param encounter_id + * @param hide_id + * @param hide_quest + * @return string + */ +function get_formatted_encounterlist_entry($encounter_id, $hide_id = false, $hide_quest = false) +{ + // Get encounters from encounterlist. + $rs = my_query( + " + SELECT * + FROM encounterlist + WHERE id = '{$encounter_id}' + " + ); + + // Init empty encounterlist message. + $msg_enclist = ''; + + // Build message. + while ($enclist = $rs->fetch_assoc()) { + // Get quest. + $msg_quest = get_formatted_questlist_entry($enclist['quest_id'], true); + + // Get encounters + $quest_pokemons = explode(',', $enclist['pokedex_ids']); + + // Get local pokemon name + $msg_poke = ''; + foreach($quest_pokemons as $pokedex_id) { + $msg_poke .= get_local_pokemon_name($pokedex_id); + $msg_poke .= ' / '; + } + // Trim last slash + $msg_poke = rtrim($msg_poke,' / '); + + // Build encounterlist message. + if($hide_id != true) { + $msg_enclist .= 'ID: ' . $enclist['id'] . ' — '; + } + if($hide_quest != true) { + $msg_enclist .= $msg_quest; + $msg_enclist .= SP . '(' . $msg_poke . ')' . CR; + } else { + $msg_enclist .= '' . $msg_poke . '' . CR; + } + } + + return $msg_enclist; +} + +/** + * Get keys for all encounters in encounterlist. + * @param $action + * @param $arg + * @return array + */ +function get_all_encounterlist_keys($action, $arg) +{ + // Get all encounters from encounterlist. + $rs = my_query( + " + SELECT id + FROM encounterlist + " + ); + + // Init empty keys array. + $keys = array(); + + // Add key for each encounters + while ($enc_entry = $rs->fetch_assoc()) { + $keys[] = array( + 'text' => $enc_entry['id'], + 'callback_data' => $enc_entry['id'] . ':' . $action . ':' . $arg + ); + } + + // Set keys. + $keys = inline_key_array($keys, 5); + + //debug_log($keys); + + return $keys; +} + +/** + * Get all rewards in rewardlist. + * @param $skip + * @param $show_hidden + * @param $quest_id + * @param $w_column + * @param $w_operator + * @param $w_value + * @return string + */ +function get_all_rewardlist_entries($skip = false, $show_hidden = true, $quest_id = 0, $w_column = 'id', $w_operator = '>', $w_value = 0) +{ + // Build WHERE. + $where = $w_column . SP . $w_operator . SP . $w_value; + + // Get all rewards. + $rs = my_query( + " + SELECT id, reward_type + FROM rewardlist + WHERE $where + " + ); + + // Init empty message. + $msg_rewardlist = ''; + + // Hidden rewards + $hide_rewards = array(); + $hide_rewards = (QUEST_HIDE_REWARDS == true && !empty(QUEST_HIDDEN_REWARDS)) ? (explode(',', QUEST_HIDDEN_REWARDS)) : ''; + + // Build message. + while ($rewardlist = $rs->fetch_assoc()) { + // Skip reward pokemon to avoid deletion. + if($skip == true && $rewardlist['id'] == 1) continue; + + // Skip hidden rewards. + if($show_hidden == false && QUEST_HIDE_REWARDS == true && in_array($rewardlist['reward_type'], $hide_rewards)) continue; + + // Build message. + $msg_rewardlist .= get_formatted_rewardlist_entry($rewardlist['id'], $quest_id) . CR; + } + + return $msg_rewardlist; +} + +/** + * Get formatted reward from rewardlist. + * @param reward_id + * @param quest_id + * @param hide_id + * @return string + */ +function get_formatted_rewardlist_entry($reward_id, $quest_id = 0, $hide_id = false) +{ + // Get reward from rewardlist. + $rl_entry = get_rewardlist_entry($reward_id); + + // Init empty rewardlist message. + $msg_rewardlist = ''; + + // No reward forecast. + //if($quest_id > 0) { + if($quest_id == 0) { + // Reward type: Singular or plural? + $reward_type = explode(":", getTranslation('reward_type_' . $rl_entry['reward_type'])); + $reward_type_singular = $reward_type[0]; + $reward_type_plural = $reward_type[1]; + $qty_reward = $rl_entry['reward_quantity'] . SP . (($rl_entry['reward_quantity'] > 1) ? ($reward_type_plural) : ($reward_type_singular)); + + // Build message. + if($hide_id == false) { + $msg_rewardlist .= 'ID: ' . $rl_entry['id'] . ' — '; + } + $msg_rewardlist .= $qty_reward; + + // Get reward pokemon forecast. + } else { + $ql_entry = get_questlist_entry($quest_id); + + // Rewardlist entry. + $rl_entry = get_rewardlist_entry($reward_id); + + // Reward type: Singular or plural? + $reward_type = explode(":", getTranslation('reward_type_' . $rl_entry['reward_type'])); + $reward_type_singular = $reward_type[0]; + $reward_type_plural = $reward_type[1]; + $qty_reward = $rl_entry['reward_quantity'] . SP . (($rl_entry['reward_quantity'] > 1) ? ($reward_type_plural) : ($reward_type_singular)); + + // Reward pokemon forecast? + $msg_poke = ''; + + if($rl_entry['reward_type'] == 1) { + $el_entry = get_encounterlist_entry($ql_entry['id']); + $quest_pokemons = explode(',', $el_entry['pokedex_ids']); + // Get local pokemon name + foreach($quest_pokemons as $pokedex_id) { + $msg_poke .= get_local_pokemon_name($pokedex_id); + $msg_poke .= ' / '; + } + // Trim last slash + $msg_poke = rtrim($msg_poke,' / '); + $msg_poke = (!empty($msg_poke) ? $msg_poke : ''); + } + + // Forecast reward text. + if($hide_id == false) { + $msg_rewardlist .= 'ID: ' . $rl_entry['id'] . ' — '; + } + $msg_rewardlist .= (!empty($msg_poke) ? $msg_poke : $qty_reward); + } + + return $msg_rewardlist; +} + +/** + * Get keys for all rewards in rewardlist. + * @param $action + * @param $arg + * @param $skip + * @param $show_hidden + * @return array + */ +function get_all_rewardlist_keys($action, $arg, $skip = false, $show_hidden = true) +{ + // Get all rewards from rewardlist. + $rs = my_query( + " + SELECT id, reward_type + FROM rewardlist + " + ); + + // Init empty keys array. + $keys = array(); + + // Hidden rewards + $hide_rewards = array(); + $hide_rewards = (QUEST_HIDE_REWARDS == true && !empty(QUEST_HIDDEN_REWARDS)) ? (explode(',', QUEST_HIDDEN_REWARDS)) : ''; + + // Add key for each reward + while ($rl_entry = $rs->fetch_assoc()) { + // Skip reward pokemon to avoid deletion. + if($skip == true && $rl_entry['id'] == 1) continue; + + // Skip hidden rewards. + if($show_hidden == false && QUEST_HIDE_REWARDS == true && in_array($rl_entry['reward_type'], $hide_rewards)) continue; + + // Add keys. + $keys[] = array( + 'text' => $rl_entry['id'], + 'callback_data' => $rl_entry['id'] . ':' . $action . ':' . $arg + ); + } + + // Add quick selection keys. + $keys = inline_key_array($keys, 5); + + //debug_log($keys); + + return $keys; +} + + +/** + * Get keys for all entries in quicklist. + * @param action + * @param arg + * @param id_type + * @return array + */ +function get_all_quicklist_keys($action, $arg, $id_type = 'quest_id') +{ + // Get all entries from quicklist. + $rs = my_query( + " + SELECT id, quest_id + FROM quick_questlist + " + ); + + // Init empty keys array. + $keys = array(); + + // Get id type for keys text. + if($id_type != 'quest_id') { + $id_value = 'id'; + } else { + $id_value = 'quest_id'; + } + + // Add key for each quicklist entry + while ($ql_entry = $rs->fetch_assoc()) { + $keys[] = array( + 'text' => $ql_entry[$id_value], + 'callback_data' => $ql_entry['id'] . ':' . $action . ':' . $arg + ); + } + + // Add quick selection keys. + $keys = inline_key_array($keys, 5); + + //debug_log($keys); + + return $keys; +} + +/** + * Get all entries in quicklist. + * @param reward + * @param hide_id + * @param show_qq_id + * @return string + */ +function get_all_quicklist_entries($reward = false, $hide_id = false, $show_qq_id = false) +{ + // Get all quicklist entries. + $rs = my_query( + " + SELECT * + FROM quick_questlist + " + ); + + // Init empty message. + $msg_quicklist = ''; + + // Build message. + while ($quicklist = $rs->fetch_assoc()) { + // Show quick questlist id. + if($show_qq_id == true) { + $msg_quicklist .= 'ID: ' . $quicklist['id'] . ' — '; + } + + $msg_quicklist .= get_formatted_questlist_entry($quicklist['quest_id'], $hide_id); + // Get reward. + if($reward == true) { + $msg_quicklist .= SP . ' (' . get_formatted_rewardlist_entry($quicklist['reward_id'], $quicklist['quest_id'], true) . ')' . CR; + } else { + $msg_quicklist .= CR; + } + } + + return $msg_quicklist; +} + +/** + * Get quicklist entry. + * @param $quicklist_id + * @return array + */ +function get_quicklist_entry($quicklist_id) +{ + // Get the quicklist entry by id. + $rs = my_query( + " + SELECT * + FROM quick_questlist + WHERE id = {$quicklist_id} + " + ); + + // Get the row. + $ql_entry = $rs->fetch_assoc(); + + debug_log($ql_entry); + + return $ql_entry; +} + +/** + * Get quest action. + * @param $quest + * @param $override_language + * @return string + */ +function get_quest_action($quest, $override_language = false) +{ + // Get translation type + if($override_language == true) { + $getTypeTranslation = 'getPublicTranslation'; + } else { + $getTypeTranslation = 'getTranslation'; + } + + // Init Quantity Action Var. + $qty_action = ''; + + // Quest action - Translation? + if($quest['quest_action'] != '0') { + // Quest action: Singular or plural? + $quest_action = explode(":", $getTypeTranslation('quest_action_' . $quest['quest_action'])); + $quest_action_singular = $quest_action[0]; + $quest_action_plural = $quest_action[1]; + $qty_action = $quest['quest_quantity'] . SP . (($quest['quest_quantity'] > 1) ? ($quest_action_plural) : ($quest_action_singular)); + + // Quest action - Pokemons? + } else if($quest['quest_pokedex_ids'] != '0') { + // Init pokemon names. + $poke_names = ''; + $quest_pokemons = explode(',', $quest['quest_pokedex_ids']); + + // Get local pokemon names. + foreach($quest_pokemons as $pokedex_id) { + $poke_names .= get_local_pokemon_name($pokedex_id, $override_language); + $poke_names .= ', '; + } + // Trim last comma + $comma = ', '; + $poke_names = rtrim($poke_names,$comma); + + // Get position of last comma and replace it with 'or' in case of multiple Pokemon names + $pos = strrpos($poke_names, $comma); + if($pos !== false) + { + $poke_names = substr_replace($poke_names, SP . $getTypeTranslation('or') . SP, $pos, strlen($comma)); + } + $qty_action = $quest['quest_quantity'] . SP . (!empty($poke_names) ? $poke_names : ''); + + // Quest action - Pokemon Types? + } else if($quest['quest_poketypes'] != '0') { + // Init pokemon types. + $poke_types = ''; + $quest_poketypes = explode(',', $quest['quest_poketypes']); + + // Get local pokemon names. + foreach($quest_poketypes as $poketype_id) { + $poke_types .= $getTypeTranslation('pokemon_type_' . $poketype_id); + $poke_types .= ', '; + } + // Trim last comma + $comma = ', '; + $poke_types = rtrim($poke_types,$comma); + + // Get position of last comma and replace it with 'or' in case of multiple Pokemon types + $pos = strrpos($poke_types, $comma); + if($pos !== false) + { + $poke_types = substr_replace($poke_types, SP . $getTypeTranslation('or') . SP, $pos, strlen($comma)); + } + + // Get translation for pokemon types and replace POKEMON_TYPE with actual pokemon types + $poke_types = str_replace('POKEMON_TYPE', $poke_types, $getTypeTranslation('pokemon_of_type')); + $qty_action = $quest['quest_quantity'] . SP . (!empty($poke_types) ? $poke_types : ''); + } + + return $qty_action; +} + +/** + * Get quest and reward as formatted string. + * @param $quest array + * @param $add_creator bool + * @param $add_timestamp bool + * @param $compact_format bool + * @param $override_language bool + * @return array + */ +function get_formatted_quest($quest, $add_creator = false, $add_timestamp = false, $compact_format = false, $override_language = false) +{ + /** Example: + * Pokestop: Reward-Stop Number 1 + * Quest-Street 5, 13579 Poke-City + * Quest: Eggxtra-Event: Hatch 1 Egg + * Reward: Magikarp or Onix + */ + + /** Event-Example: + * Pokestop: Reward-Stop Number 1 + * Quest-Street 5, 13579 Poke-City + * Eggxtra-Event: Hatch 1 Egg + * Reward: Magikarp or Onix + */ + + // Get translation type + if($override_language == true) { + $getTypeTranslation = 'getPublicTranslation'; + } else { + $getTypeTranslation = 'getTranslation'; + } + + // Pokestop name and address. + $pokestop_name = SP . '' . (!empty($quest['pokestop_name']) ? ($quest['pokestop_name']) : ($getTypeTranslation('unnamed_pokestop'))) . '' . CR; + + // Get pokestop info. + $stop = get_pokestop($quest['pokestop_id']); + + // Add google maps link. + if(!empty($stop['address'])) { + $pokestop_address = '' . $stop['address'] . ''; + } else if(!empty($quest['address'])) { + $pokestop_address = '' . $quest['address'] . ''; + } else { + $pokestop_address = 'http://maps.google.com/maps?q=' . $quest['lat'] . ',' . $quest['lon'] . ''; + } + + $qty_action = get_quest_action($quest, $override_language); + + // Reward type: Singular or plural? + $reward_type = explode(":", $getTypeTranslation('reward_type_' . $quest['reward_type'])); + $reward_type_singular = $reward_type[0]; + $reward_type_plural = $reward_type[1]; + $qty_reward = $quest['reward_quantity'] . SP . (($quest['reward_quantity'] > 1) ? ($reward_type_plural) : ($reward_type_singular)); + + // Reward pokemon forecast? + $msg_poke = ''; + + if($quest['pokedex_ids'] != '0' && $quest['reward_type'] == 1) { + $quest_pokemons = explode(',', $quest['pokedex_ids']); + // Get local pokemon name + foreach($quest_pokemons as $pokedex_id) { + $msg_poke .= get_local_pokemon_name($pokedex_id, $override_language); + $msg_poke .= ' / '; + } + // Trim last slash + $msg_poke = rtrim($msg_poke,' / '); + $msg_poke = (!empty($msg_poke) ? $msg_poke : ''); + } + + // Event? + $msg_event = ''; + $msg_compact = ''; + if($quest['quest_event'] > 0) { + $msg_event = '' . $getTypeTranslation('quest_event_'. $quest['quest_event']) . ':' . SP; + $msg_compact = $getTypeTranslation('quest_event_'. $quest['quest_event']) . ':' . SP; + } else { + $msg_event = $getTypeTranslation('quest') . ':' . SP; + } + + // Build quest message + $msg = ''; + if($compact_format == false) { + $msg .= $getTypeTranslation('pokestop') . ':' . $pokestop_name . $pokestop_address . CR; + $msg .= $msg_event . '' . $getTypeTranslation('quest_type_' . $quest['quest_type']) . SP . $qty_action . '' . CR; + $msg .= $getTypeTranslation('reward') . ': ' . (!empty($msg_poke) ? $msg_poke : $qty_reward) . '' . CR; + } else { + $msg .= $msg_compact . $getTypeTranslation('quest_type_' . $quest['quest_type']) . SP . $qty_action . ' — ' . (!empty($msg_poke) ? $msg_poke : $qty_reward); + } + + //Add custom message from the config. + if($compact_format == false && defined('MAP_URL') && !empty(MAP_URL)) { + $msg .= CR . MAP_URL ; + } + + // Display creator. + $msg .= ($quest['user_id'] && $add_creator == true) ? (CR . $getTypeTranslation('created_by') . ': ' . htmlspecialchars($quest['name']) . '') : ''; + + // Add update time and quest id to message. + if($add_timestamp == true) { + $msg .= CR . '' . $getTypeTranslation('updated') . ': ' . dt2date($quest['quest_date']) . ''; + $msg .= ' ' . substr(strtoupper(BOT_ID), 0, 1) . '-ID = ' . $quest['id']; // DO NOT REMOVE! --> NEEDED FOR CLEANUP PREPARATION! + } + + return $msg; +} + +/** + * Get today's quests as formatted string. + * @return string + */ +function get_todays_formatted_quests() +{ + // Get the quest data by id. + $rs = my_query( + " + SELECT id + FROM quests + WHERE quest_date > UTC_DATE() + AND quest_date < UTC_DATE() + INTERVAL 1 DAY + " + ); + + // Init empty message and counter. + $msg = ''; + $count = 0; + + // Get the quests. + while ($todays_quests = $rs->fetch_assoc()) { + $quest = get_quest($todays_quests['id']); + $msg .= CR . '' . (!empty($quest['pokestop_name']) ? ($quest['pokestop_name']) : (getTranslation('unnamed_pokestop'))) . '' . CR; + $msg .= get_formatted_quest($quest, false, false, true, false); + $msg .= CR; + $count = $count + 1; + } + + // No quests today? + if($count == 0) { + $msg = getTranslation('no_quests_today'); + } else { + // Add update time to message. + $msg .= CR . '' . getTranslation('updated') . ': ' . dt2time('now', 'H:i:s') . ''; + } + + return $msg; +} + +/** + * Get rewardlist entry. + * @param $reward_id + * @return array + */ +function get_rewardlist_entry($reward_id) +{ + // Get the reward data by id. + $rs = my_query( + " + SELECT * + FROM rewardlist + WHERE id = {$reward_id} + " + ); + + // Get the row. + $reward = $rs->fetch_assoc(); + + debug_log($reward); + + return $reward; +} + + +/** + * Get encounterlist entry. + * @param quest_id + * @return array + */ +function get_encounterlist_entry($quest_id) +{ + // Get the reward data by id. + $rs = my_query( + " + SELECT * + FROM encounterlist + WHERE quest_id = {$quest_id} + " + ); + + // Get the row. + $encounters = $rs->fetch_assoc(); + + debug_log($encounters); + + return $encounters; +} + +/** + * Get entry count of all pokemons from json. + * @param start + * @return string + */ +function count_all_json_pokemon() +{ + // Init count. + $count = 0; + + // Set language. + $language = USERLANGUAGE; + + // Translation file. + $tfile = CORE_LANG_PATH . '/pokemon_' . strtolower($language) . '.json'; + + // Fallback to English language? + if(!is_file($tfile)) { + debug_log('File not found: ' . $tfile); + debug_log('Setting language to English now!'); + + // Set language. + $language = DEFAULT_LANGUAGE; + $tfile = CORE_LANG_PATH . '/pokemon_' . strtolower($language) . '.json'; + } + + // Get json. + $str = file_get_contents($tfile); + $json = json_decode($str, true); + + // Count entries. + $count = count($json); + + // Write to log. + debug_log($count, 'Pokemon count of ' . $tfile . ':'); + + return $count; +} + +/** + * Find dex id of specific pokemon from json. + * @param pokemon + * @return string + */ +function get_dex_entry($pokemon) +{ + // Init empty message. + $msg = ''; + + // Set language. + $language = USERLANGUAGE; + + // Translation file. + $tfile = CORE_LANG_PATH . '/pokemon_' . strtolower($language) . '.json'; + + // Fallback to English language? + if(!is_file($tfile)) { + debug_log('File not found: ' . $tfile); + debug_log('Setting language to English now!'); + + // Set language. + $language = DEFAULT_LANGUAGE; + $tfile = CORE_LANG_PATH . '/pokemon_' . strtolower($language) . '.json'; + } + + // Get json. + $str = file_get_contents($tfile); + $json = json_decode($str, true); + + // Find dex ids. + foreach($json as $index => $pokemon_name) { + // Lower for better comparison + $find = strtolower($pokemon); + $pokemon_name = strtolower($pokemon_name); + + // Find pokemon. + if(strpos($pokemon_name, $find) !== FALSE) { + $dex_id = $index + 1; + $msg .= 'ID: ' . $dex_id . ' — ' . getTranslation('pokemon_id_' . $dex_id) . CR; + } + } + + // Write to log. + debug_log('Found pokemon: ' . $msg); + + // Try English as fallback. + if(empty($msg)) { + // Set language. + $language = DEFAULT_LANGUAGE; + $tfile = CORE_LANG_PATH . '/pokemon_' . strtolower($language) . '.json'; + + // Get json. + $str = file_get_contents($tfile); + $json = json_decode($str, true); + + // Find dex ids. + foreach($json as $index => $pokemon_name) { + // Lower for better comparison + $find = strtolower($pokemon); + $pokemon_name = strtolower($pokemon_name); + + // Find pokemon. + if(strpos($pokemon_name, $find) !== FALSE) { + $dex_id = $index + 1; + $msg .= 'ID: ' . $dex_id . ' — ' . getTranslation('pokemon_id_' . $dex_id) . CR; + } + } + } + + // Empty message? + $msg = empty($msg) ? getTranslation('pokemon_not_found') : $msg; + + return $msg; +} + +/** + * Get strings for all pokemons from json. + * @param start + * @param first + * @param second + * @param third + * @param fourth + * @param fifth + * @return string + */ +function get_all_json_pokemon($start, $first = 0, $second = 0, $third = 0, $fourth = 0, $fifth = 0) +{ + // Init empty message. + $msg = ''; + + // Set start and end values. + $start = $start + 1; + $limit = count_all_json_pokemon(); + $end = ($limit > $start + 24) ? ($start + 24) : $limit; + + // Get pokemons from json. + for ($i = $start; $i <= $end; $i = $i + 1) { + // Skip if already selected. + if($first == $i || $second == $i || $third == $i || $fourth == $i) continue; + + // Build message. + $msg .= 'ID: ' . $i . ' — ' . getTranslation('pokemon_id_' . $i) . CR; + } + + // Write selected pokemon to log. + debug_log($first . ', ' . $second . ', ' . $third . ', ' . $fourth . ', ' . $fifth, 'Selected Pokemon IDs:'); + + // Already selected pokemon. + $msg .= CR; + if($first > 0 && $second == 0) { + $msg .= getTranslation('selected_pokemon'); + $msg .= CR . 'ID: ' . $first . ' — ' . getTranslation('pokemon_id_' . $first) . CR . CR; + } else if($first > 0 && $second > 0 && $third == 0) { + $msg .= getTranslation('selected_pokemon'); + $msg .= CR . 'ID: ' . $first . ' — ' . getTranslation('pokemon_id_' . $first); + $msg .= CR . 'ID: ' . $second . ' — ' . getTranslation('pokemon_id_' . $second) . CR . CR; + } else if($first > 0 && $second > 0 && $third > 0 && $fourth == 0) { + $msg .= getTranslation('selected_pokemon'); + $msg .= CR . 'ID: ' . $first . ' — ' . getTranslation('pokemon_id_' . $first); + $msg .= CR . 'ID: ' . $second . ' — ' . getTranslation('pokemon_id_' . $second); + $msg .= CR . 'ID: ' . $third . ' — ' . getTranslation('pokemon_id_' . $third) . CR . CR; + } else if($first > 0 && $second > 0 && $third > 0 && $fourth > 0 && $fifth == 0) { + $msg .= getTranslation('selected_pokemon'); + $msg .= CR . 'ID: ' . $first . ' — ' . getTranslation('pokemon_id_' . $first); + $msg .= CR . 'ID: ' . $second . ' — ' . getTranslation('pokemon_id_' . $second); + $msg .= CR . 'ID: ' . $third . ' — ' . getTranslation('pokemon_id_' . $third); + $msg .= CR . 'ID: ' . $fourth . ' — ' . getTranslation('pokemon_id_' . $fourth) . CR . CR; + } else if($first > 0 && $second > 0 && $third > 0 && $fourth > 0 && $fifth > 0) { + $msg .= getTranslation('selected_pokemon'); + $msg .= CR . 'ID: ' . $first . ' — ' . getTranslation('pokemon_id_' . $first); + $msg .= CR . 'ID: ' . $second . ' — ' . getTranslation('pokemon_id_' . $second); + $msg .= CR . 'ID: ' . $third . ' — ' . getTranslation('pokemon_id_' . $third); + $msg .= CR . 'ID: ' . $fourth . ' — ' . getTranslation('pokemon_id_' . $fourth); + $msg .= CR . 'ID: ' . $fifth . ' — ' . getTranslation('pokemon_id_' . $fifth) . CR . CR; + } + + return $msg; +} + +/** + * Get keys for all pokemons from json. + * @param id + * @param action + * @param arg + * @param start + * @param first + * @param second + * @param third + * @param fourth + * @param fifth + * @return array + */ +function get_all_json_pokemon_keys($id, $action, $arg, $start, $first = 0, $second = 0, $third = 0, $fourth = 0, $fifth = 0) +{ + // Init empty keys array. + $keys = array(); + + // Set start and end values. + $start = $start + 1; + $limit = count_all_json_pokemon(); + $end = ($limit > $start + 24) ? ($start + 24) : $limit; + + // Get arg. + $arg_split = explode('#', $arg); + $old_arg = $arg_split[0]; + + // Get pokemons from json. + for ($i = $start; $i <= $end; $i = $i + 1) { + // Set new arg. + if($first == 0) { + $new_arg = $i . ',0,0,0,0'; + } else if($first > 0 && $second == 0) { + $new_arg = $first . ',' . $i . ',0,0,0'; + } else if($first > 0 && $second > 0 && $third == 0) { + $new_arg = $first . ',' . $second . ',' . $i . ',0,0'; + } else if($first > 0 && $second > 0 && $third > 0 && $fourth == 0) { + $new_arg = $first . ',' . $second . ',' . $third . ',' . $i . ',0'; + } else if($first > 0 && $second > 0 && $third > 0 && $fourth > 0 && $fifth == 0) { + $new_arg = $first . ',' . $second . ',' . $third . ',' . $fourth . ',' . $i; + } + + // Skip if already selected. + if($first == $i || $second == $i || $third == $i || $fourth == $i) continue; + + // Add key for each pokemon id + $keys[] = array( + 'text' => $i, + 'callback_data' => $id . ':' . $action . ':' . $old_arg . '#' . $new_arg + ); + } + + // Keys array. + $keys = inline_key_array($keys, 5); + + return $keys; +} + +/** + * Get strings for all pokemon types from json. + * @param first + * @param second + * @param third + * @return string + */ +function get_all_json_pokemon_type($first, $second, $third) +{ + // Get all pokemon types from json. + $tfile = CORE_LANG_PATH . '/pokemon_types.json'; + $str = file_get_contents($tfile); + $json = json_decode($str, true); + + // Init empty message. + $msg = ''; + + // Build message. + foreach($json as $type_id_string => $type_translation_array) + { + // Get ID from string via substring + $type_id = substr($type_id_string, strrpos($type_id_string, '_') + 1); + + // Make sure ID is numeric + if(!(is_numeric($type_id))) { + // Fallback: Get ID from string via replace + $type_id = str_replace('pokemon_type_', '', $type_id_string); + } + + // Skip if already selected. + if($first == $type_id || $second == $type_id) continue; + + // Set message + $msg .= 'ID: ' . $type_id . ' — ' . getTranslation($type_id_string) . CR; + } + + // Write selected pokemon to log. + debug_log($first . ', ' . $second . ', ' . $third, 'Selected Pokemon Type IDs:'); + + // Already selected pokemon types. + $msg .= CR; + if($first > 0 && $second == 0) { + $msg .= getTranslation('selected_pokemon_types'); + $msg .= CR . 'ID: ' . $first . ' — ' . getTranslation('pokemon_type_' . $first) . CR . CR; + } else if($first > 0 && $second > 0 && $third == 0) { + $msg .= getTranslation('selected_pokemon'); + $msg .= CR . 'ID: ' . $first . ' — ' . getTranslation('pokemon_type_' . $first); + $msg .= CR . 'ID: ' . $second . ' — ' . getTranslation('pokemon_type_' . $second) . CR . CR; + } else if($first > 0 && $second > 0 && $third > 0) { + $msg .= getTranslation('selected_pokemon'); + $msg .= CR . 'ID: ' . $first . ' — ' . getTranslation('pokemon_type_' . $first); + $msg .= CR . 'ID: ' . $second . ' — ' . getTranslation('pokemon_type_' . $second); + $msg .= CR . 'ID: ' . $third . ' — ' . getTranslation('pokemon_type_' . $third) . CR . CR; + } + + return $msg; +} + +/** + * Get keys for all pokemon types from json. + * @param id + * @param action + * @param arg + * @param first + * @param second + * @param third + * @return array + */ +function get_all_json_pokemon_type_keys($id, $action, $arg, $first = 0, $second = 0, $third = 0) +{ + // Get all pokemon types from json. + $tfile = CORE_LANG_PATH . '/pokemon_types.json'; + $str = file_get_contents($tfile); + $json = json_decode($str, true); + + // Init empty keys array. + $keys = array(); + + // Get arg. + $arg_split = explode('#', $arg); + $old_arg = $arg_split[0]; + + // Get pokemons from json. + foreach($json as $type_id_string => $type_translation_array) + { + // Get ID from string via substring + $type_id = substr($type_id_string, strrpos($type_id_string, '_') + 1); + + // Make sure ID is numeric + if(!(is_numeric($type_id))) { + // Fallback: Get ID from string via replace + $type_id = str_replace('pokemon_type_', '', $type_id_string); + } + + // Skip if already selected. + if($first == $type_id || $second == $type_id) continue; + + // Set new arg. + if($first == 0) { + $new_arg = $type_id . ',0,0'; + } else if($first > 0 && $second == 0) { + $new_arg = $first . ',' . $type_id . ',0'; + } else if($first > 0 && $second > 0 && $third == 0) { + $new_arg = $first . ',' . $second . ',' . $type_id; + } + + // Add key for each pokemon type + $keys[] = array( + 'text' => getTranslation('pokemon_type_' . $type_id), + 'callback_data' => $id . ':' . $action . ':' . $old_arg . '#' . $new_arg + ); + } + + // Keys array. + $keys = inline_key_array($keys, 3); + + return $keys; +} + +/** + * Get strings for all quest types from json. + * @return string + */ +function get_all_json_quest_type() +{ + // Get all quest types from json. + $tfile = BOT_LANG_PATH . '/quest_type.json'; + $str = file_get_contents($tfile); + $json = json_decode($str, true); + + // Init empty message. + $msg = ''; + + // Build message. + foreach($json as $type_id_string => $type_translation_array) + { + // Get ID from string via substring + $type_id = substr($type_id_string, strrpos($type_id_string, '_') + 1); + + // Make sure ID is numeric + if(!(is_numeric($type_id))) { + // Fallback: Get ID from string via replace + $type_id = str_replace('quest_type_', '', $type_id_string); + } + + // Always use singular + $quest_type = explode(":", getTranslation($type_id_string)); + $quest_type_singular = $quest_type[0]; + //$quest_type_plural = $quest_type[1]; + + // Set message + $msg .= 'ID: ' . $type_id . ' — ' . $quest_type_singular . CR; + } + + return $msg; +} + +/** + * Get keys for all quest events from json. + * @param $action + * @param $arg + * @return array + */ +function get_all_json_quest_event_keys($action, $arg) +{ + // Get all quest events from json. + $tfile = BOT_LANG_PATH . '/quest_event.json'; + $str = file_get_contents($tfile); + $json = json_decode($str, true); + + // Init empty keys array. + $keys = array(); + + // Add key for no event. + $keys[] = array( + 'text' => getTranslation('no_event'), + 'callback_data' => 'no-0:' . $action . ':' . $arg + ); + + // Add keys. + foreach($json as $event_id_string => $event_translation_array) + { + // Get ID from string via substring + $event_id = substr($event_id_string, strrpos($event_id_string, '_') + 1); + + // Make sure ID is numeric + if(!(is_numeric($event_id))) { + // Fallback: Get ID from string via replace + $event_id = str_replace('quest_event_', '', $event_id_string); + } + + // Add key for each quest event + $keys[] = array( + 'text' => getTranslation('quest_event_' . $event_id), + 'callback_data' => $event_id . '-0:' . $action . ':' . $arg + ); + } + + // Add quickly added event. + $eventfile = BOT_LANG_PATH . '/event.json'; + if(is_file($eventfile)) { + $str = file_get_contents($tfile); + $json = json_decode($str, true); + + // Add key for current quest event + $keys[] = array( + 'text' => getTranslation('quest_event_9999'), + 'callback_data' => '9999-0:' . $action . ':' . $arg + ); + } + + // Keys array. + $keys = inline_key_array($keys, 1); + + return $keys; +} + +/** + * Get strings for all quest events from json. + * @return string + */ +function get_all_json_quest_event() +{ + // Get all quest event from json. + $tfile = BOT_LANG_PATH . '/quest_event.json'; + $str = file_get_contents($tfile); + $json = json_decode($str, true); + + // Init empty message. + $msg = ''; + + // Build message. + foreach($json as $event_id_string => $event_translation_array) + { + // Get ID from string via substring + $event_id = substr($event_id_string, strrpos($event_id_string, '_') + 1); + + // Make sure ID is numeric + if(!(is_numeric($event_id))) { + // Fallback: Get ID from string via replace + $event_id = str_replace('quest_event_', '', $event_id_string); + } + + // Always use singular + $quest_event = getTranslation($event_id_string); + + // Set message + $msg .= 'ID: ' . $event_id . ' — ' . $quest_event . CR; + } + + // Add quickly added event. + $eventfile = BOT_LANG_PATH . '/event.json'; + if(is_file($eventfile)) { + $str = file_get_contents($tfile); + $json = json_decode($str, true); + + // Get translation. + $quest_event = getTranslation('quest_event_9999'); + + // Set message + $msg .= 'ID: 9999 — ' . $quest_event . CR; + } + + return $msg; +} + +/** + * Get keys for all quest types from json. + * @param $action + * @param $arg + * @return array + */ +function get_all_json_quest_type_keys($action, $arg, $event = 0) +{ + // Get all quest types from json. + $tfile = BOT_LANG_PATH . '/quest_type.json'; + $str = file_get_contents($tfile); + $json = json_decode($str, true); + + // Init empty keys array. + $keys = array(); + + foreach($json as $type_id_string => $type_translation_array) + { + // Get ID from string via substring + $type_id = substr($type_id_string, strrpos($type_id_string, '_') + 1); + + // Make sure ID is numeric + if(!(is_numeric($type_id))) { + // Fallback: Get ID from string via replace + $type_id = str_replace('quest_type_', '', $type_id_string); + } + + // Event? + if($event > 0) { + $cb_id = $event . '-' . $type_id; + } else { + $cb_id = $type_id; + } + + // Add key for each quest type + $keys[] = array( + 'text' => getTranslation('quest_type_' . $type_id), + 'callback_data' => $cb_id . ':' . $action . ':' . $arg + ); + } + + // Keys array. + $keys = inline_key_array($keys, 3); + + return $keys; +} + +/** + * Get strings for all quest actions of a specific quest type from json. + * @param $quest_type_id + * @return string + */ +function get_all_json_quest_action($quest_type_id) +{ + // Get all quest actions from json. + $tfile = BOT_LANG_PATH . '/quest_action.json'; + $str = file_get_contents($tfile); + $json = json_decode($str, true); + + // Init empty message. + $msg = ''; + + // Build message. + foreach($json as $action_id_string => $action_translation_array) + { + // Get ID from string via substring + $action_id = substr($action_id_string, strrpos($action_id_string, '_') + 1); + + // Make sure ID is numeric + if(!(is_numeric($action_id))) { + // Fallback: Get ID from string via replace + $action_id = str_replace('quest_action_', '', $action_id_string); + } + + // Make sure action_id and quest_type_id start with the same number + if(strpos($action_id, $quest_type_id) !== 0) continue; + + // Every quest action is designed to be type_id + action_id and action_id is always 3 chars. + // To avoid quest actions being shown from another quest type check the length. + // Type_id + 3 should match the length of the complete quest action id length - continue if not. + // Example: quest_action_1001 vs. quest_action_11001 - start both with 1, but one is quest type 1 and the other is 11 + //debug_log($action_id, 'ACTION ID:'); + //debug_log($quest_type_id, 'QUEST TYPE ID:'); + //debug_log(strlen($action_id), 'LENGTH ACTION ID:'); + //debug_log(strlen($quest_type_id), 'LENGTH QUEST TYPE ID:'); + $len_qt_id = strlen($quest_type_id); + $len_a_id = strlen($action_id); + if(($len_qt_id + 3) <> $len_a_id) continue; + + // Always use singular + $quest_action = explode(":", getTranslation($action_id_string)); + $quest_action_singular = $quest_action[0]; + //$quest_action_plural = $quest_action[1]; + + // Set message + $msg .= 'ID: ' . $action_id . ' — ' . $quest_action_singular . CR; + } + + return $msg; +} + +/** + * Get keys for all quest actions of a specific quest type from json. + * @param $event + * @param $id + * @param $action + * @param $arg + * @return array + */ +function get_all_json_quest_action_keys($event, $id, $action, $arg) +{ + // Get all quest actions from json. + $tfile = BOT_LANG_PATH . '/quest_action.json'; + $str = file_get_contents($tfile); + $json = json_decode($str, true); + + // Init empty keys array. + $keys = array(); + + foreach($json as $action_id_string => $action_translation_array) + { + // Get ID from string via substring + $action_id = substr($action_id_string, strrpos($action_id_string, '_') + 1); + + // Make sure ID is numeric + if(!(is_numeric($action_id))) { + // Fallback: Get ID from string via replace + $action_id = str_replace('quest_action_', '', $action_id_string); + } + + // Make sure action_id and (quest_type)id start with the same number + if(strpos($action_id, $id) !== 0) continue; + + // Every quest action is designed to be type_id + action_id and action_id is always 3 chars. + // To avoid quest actions being shown from another quest type check the length. + // Type_id + 3 should match the length of the complete quest action id length - continue if not. + // Example: quest_action_1001 vs. quest_action_11001 - start both with 1, but one is quest type 1 and the other is 11 + //debug_log($action_id, 'ACTION ID:'); + //debug_log($id, 'QUEST TYPE ID:'); + //debug_log(strlen($action_id), 'LENGTH ACTION ID:'); + //debug_log(strlen($qid), 'LENGTH QUEST TYPE ID:'); + $len_qt_id = strlen($id); + $len_a_id = strlen($action_id); + if(($len_qt_id + 3) <> $len_a_id) continue; + + // Split arg. + $argsplit = explode('-', $arg); + + // Set new arg for callback data. + $newarg = $argsplit[0] . '-' . $argsplit[1] . '-' . $argsplit[2]; + + // Get quantity for singular or plural action translation. + $action_qty = $argsplit[1]; + $quest_action = explode(":", getTranslation('quest_action_' . $action_id)); + $quest_action_singular = $quest_action[0]; + $quest_action_plural = $quest_action[1]; + $action_qty_text = (($action_qty > 1) ? ($quest_action_plural) : ($quest_action_singular)); + + // Add key for each quest action + $keys[] = array( + 'text' => $action_qty_text, + 'callback_data' => $event . '-' . $id . ':' . $action . ':' . $newarg . '-' . $action_id + ); + } + + // Keys array. + $keys = inline_key_array($keys, 1); + + return $keys; +} + +/** + * Get strings for all reward types from json. + * @return string + */ +function get_all_json_reward() +{ + // Get all reward types from json. + $tfile = BOT_LANG_PATH . '/reward_type.json'; + $str = file_get_contents($tfile); + $json = json_decode($str, true); + + // Init empty message. + $msg = ''; + + // Hidden rewards + $hide_rewards = array(); + $hide_rewards = (QUEST_HIDE_REWARDS == true && !empty(QUEST_HIDDEN_REWARDS)) ? (explode(',', QUEST_HIDDEN_REWARDS)) : ''; + + // Build message. + foreach($json as $type_id_string => $type_translation_array) + { + // Get ID from string via substring + $type_id = substr($type_id_string, strrpos($type_id_string, '_') + 1); + + // Make sure ID is numeric + if(!(is_numeric($type_id))) { + // Fallback: Get ID from string via replace + $type_id = str_replace('reward_type_', '', $type_id_string); + } + + // Skip pokemon reward. + if($type_id == 1) continue; + + // Skip hidden rewards. + if(QUEST_HIDE_REWARDS == true && in_array($type_id, $hide_rewards)) continue; + + // Always use singular + $reward_type = explode(":", getTranslation($type_id_string)); + $reward_type_singular = $reward_type[0]; + //$reward_type_plural = $reward_type[1]; + + // Set message + $msg .= 'ID: ' . $type_id . ' — ' . $reward_type_singular . CR; + } + + return $msg; +} + +/** + * Get keys for all reward types from json. + * @param $action + * @param $arg + * @return array + */ +function get_all_json_reward_keys($action, $arg) +{ + // Get all reward types from json. + $tfile = BOT_LANG_PATH . '/reward_type.json'; + $str = file_get_contents($tfile); + $json = json_decode($str, true); + + // Init empty keys array. + $keys = array(); + + // Hidden rewards + $hide_rewards = array(); + $hide_rewards = (QUEST_HIDE_REWARDS == true && !empty(QUEST_HIDDEN_REWARDS)) ? (explode(',', QUEST_HIDDEN_REWARDS)) : ''; + + foreach($json as $type_id_string => $type_translation_array) + { + // Get ID from string via substring + $type_id = substr($type_id_string, strrpos($type_id_string, '_') + 1); + + // Make sure ID is numeric + if(!(is_numeric($type_id))) { + // Fallback: Get ID from string via replace + $type_id = str_replace('reward_type_', '', $type_id_string); + } + + // Skip pokemon reward. + if($type_id == 1) continue; + + // Skip hidden rewards. + if(QUEST_HIDE_REWARDS == true && in_array($type_id, $hide_rewards)) continue; + + // Add key for each reward id + $keys[] = array( + 'text' => explode(':', getTranslation('reward_type_' . $type_id))[0], + 'callback_data' => $type_id . ':' . $action . ':' . $arg + ); + } + + // Keys array. + $keys = inline_key_array($keys, 3); + + return $keys; +} + +/** + * Delete quest. + * @param $quest_id + */ +function delete_quest($quest_id) +{ + global $db; + + // Delete telegram messages for quest. + $rs = my_query( + " + SELECT * + FROM qleanup + WHERE quest_id = '{$quest_id}' + AND chat_id <> 0 + " + ); + + // Counter + $counter = 0; + + // Delete every telegram message + while ($row = $rs->fetch_assoc()) { + // Delete telegram message. + debug_log('Deleting telegram message ' . $row['message_id'] . ' from chat ' . $row['chat_id'] . ' for quest ' . $row['quest_id']); + delete_message($row['chat_id'], $row['message_id']); + $counter = $counter + 1; + } + + // Nothing to delete on telegram. + if ($counter == 0) { + debug_log('Quest with ID ' . $quest_id . ' was not found in the cleanup table! Skipping deletion of telegram messages!'); + } + + // Delete quest from cleanup table. + debug_log('Deleting quest ' . $quest_id . ' from the cleanup table:'); + $rs_cleanup = my_query( + " + DELETE FROM qleanup + WHERE quest_id = '{$quest_id}' + OR cleaned = '{$quest_id}' + " + ); + + // Delete quest from quest table. + debug_log('Deleting quest ' . $quest_id . ' from the quest table:'); + $rs_quests = my_query( + " + DELETE FROM quests + WHERE id = '{$quest_id}' + " + ); +} + +/** + * Delete questlist quest. + * @param questlist_id + */ +function delete_questlist_quest($questlist_id) +{ + global $db; + + // Delete quest from questlist table. + debug_log('Deleting quest with ID ' . $questlist_id . ' from the questlist table'); + $rs_quests = my_query( + " + DELETE FROM questlist + WHERE id = '{$questlist_id}' + " + ); +} + +/** + * Add questlist quest. + * @param quest_event + * @param quest_type + * @param quest_qty + * @param quest_action_type + * @param quest_action_value + */ +function add_questlist_quest($quest_event, $quest_type, $quest_qty, $quest_action_type, $quest_action_value) +{ + global $db; + + // Log received values. + debug_log('Received quest for event ' . $quest_event . ' . of type ' . $quest_type . ' with quantity ' . $quest_qty . ' and quest action ' . $quest_action_type . ' with value ' . $quest_action_value); + + // Get quest action type. + if($quest_action_type == 'dex') { + $quest_action_type = 'quest_pokedex_ids'; + } else if($quest_action_type == 'type') { + $quest_action_type = 'quest_poketypes'; + } else { + $quest_action_type = 'quest_action'; + } + + // Format quest action value. + if($quest_action_type == 'quest_pokedex_ids' || $quest_action_type == 'quest_poketypes') { + // Split position from quest action value + $pos_qa_value = explode('#', $quest_action_value); + + // Split quest action value + $qa_value = explode(',', $pos_qa_value[1]); + $first = $qa_value[0]; + $second = $qa_value[1]; + $third = $qa_value[2]; + + // Build quest action value - get rid of "0 values" + if($second == 0 && $third == 0) { + $quest_action_value = $first; + } else if($second > 0 && $third == 0) { + $quest_action_value = $first . ',' . $second; + } else if($second > 0 && $third > 0) { + $quest_action_value = $first . ',' . $second . ',' . $third; + } else { + // Fallback: Leave value as it is. + $quest_action_value = $quest_action_value; + } + } + + // Add quest to questlist table. + debug_log('Adding quest for event ' . $quest_event . ' . of type ' . $quest_type . ' with quantity ' . $quest_qty . ' and quest action ' . $quest_action_type . ' with value ' . $quest_action_value . ' to the questlist table'); + $rs = my_query( + " + INSERT INTO questlist + SET quest_event = '{$quest_event}', + quest_type = '{$quest_type}', + quest_quantity = '{$quest_qty}', + $quest_action_type = '{$quest_action_value}' + " + ); +} + +/** + * Delete rewardlist reward. + * @param $reward_id + */ +function delete_rewardlist_reward($reward_id) +{ + global $db; + + // Delete reward from rewardlist table. + debug_log('Deleting reward ' . $reward_id . ' from the rewardlist table'); + $rs_quests = my_query( + " + DELETE FROM rewardlist + WHERE id = '{$reward_id}' + " + ); +} + +/** + * Add rewardlist reward. + * @param $reward_type + * @param $reward_qty + */ +function add_rewardlist_reward($reward_type, $reward_quantity) +{ + global $db; + + // Add reward to rewardlist table. + debug_log('Adding reward of type ' . $reward_type . ' with quantity ' . $reward_quantity . ' to the rewardlist table'); + $rs = my_query( + " + INSERT INTO rewardlist + SET reward_type = '{$reward_type}', + reward_quantity = '{$reward_quantity}' + " + ); +} + +/** + * Add encounterlist entry. + * @param $quest_id + * @param $pokedex_ids + */ +function add_encounterlist_entry($quest_id, $pokedex_ids) +{ + global $db; + + // Log received values. + debug_log('Received encounters ' . $pokedex_ids . ' for quest with ID ' . $quest_id); + + // Split position from pokedex ids + $pos_dex_value = explode('#', $pokedex_ids); + + // Split pokedex ids + $dex_value = explode(',', $pos_dex_value[1]); + $first = $dex_value[0]; + $second = $dex_value[1]; + $third = $dex_value[2]; + $fourth = $dex_value[3]; + $fifth = $dex_value[4]; + + // Build quest action value - get rid of "0 values" + if($second == 0 && $third == 0) { + $dex_ids = $first; + } else if($second > 0 && $third == 0) { + $dex_ids = $first . ',' . $second; + } else if($second > 0 && $third > 0 && $fourth == 0) { + $dex_ids = $first . ',' . $second . ',' . $third; + } else if($second > 0 && $third > 0 && $fourth > 0 && $fifth == 0) { + $dex_ids = $first . ',' . $second . ',' . $third . ',' . $fourth; + } else if($second > 0 && $third > 0 && $fourth > 0 && $fifth == 0) { + $dex_ids = $first . ',' . $second . ',' . $third . ',' . $fourth; + } else if($second > 0 && $third > 0 && $fourth > 0 && $fifth > 0) { + $dex_ids = $first . ',' . $second . ',' . $third . ',' . $fourth . ',' . $fifth; + } else { + // Fallback: Leave value as it is. + $dex_ids = $pokedex_ids; + } + + // Add encounter to encounterlist table. + debug_log('Adding encounters with IDs ' . $dex_ids . ' for quest ID ' . $quest_id . ' to the encounterlist table'); + $rs = my_query( + " + INSERT INTO encounterlist + SET quest_id = '{$quest_id}', + pokedex_ids = '{$dex_ids}' + " + ); + +} + +/** + * Update encounterlist entry. + * @param $id + * @param $pokedex_ids + */ +function update_encounterlist_entry($id, $pokedex_ids) +{ + global $db; + + // Log received values. + debug_log('Received encounters ' . $pokedex_ids . ' for encounter with ID ' . $id); + + // Split position from pokedex ids + $pos_dex_value = explode('#', $pokedex_ids); + + // Split pokedex ids + $dex_value = explode(',', $pos_dex_value[1]); + $first = $dex_value[0]; + $second = $dex_value[1]; + $third = $dex_value[2]; + $fourth = $dex_value[3]; + $fifth = $dex_value[4]; + + // Build quest action value - get rid of "0 values" + if($second == 0 && $third == 0) { + $dex_ids = $first; + } else if($second > 0 && $third == 0) { + $dex_ids = $first . ',' . $second; + } else if($second > 0 && $third > 0 && $fourth == 0) { + $dex_ids = $first . ',' . $second . ',' . $third; + } else if($second > 0 && $third > 0 && $fourth > 0 && $fifth == 0) { + $dex_ids = $first . ',' . $second . ',' . $third . ',' . $fourth; + } else if($second > 0 && $third > 0 && $fourth > 0 && $fifth == 0) { + $dex_ids = $first . ',' . $second . ',' . $third . ',' . $fourth; + } else if($second > 0 && $third > 0 && $fourth > 0 && $fifth > 0) { + $dex_ids = $first . ',' . $second . ',' . $third . ',' . $fourth . ',' . $fifth; + } else { + // Fallback: Leave value as it is. + $dex_ids = $pokedex_ids; + } + + // Add encounter to encounterlist table. + debug_log('Adding encounters with IDs ' . $dex_ids . ' for encounter ID ' . $id . ' to the encounterlist table'); + $rs = my_query( + " + UPDATE encounterlist + SET pokedex_ids = '{$dex_ids}' + WHERE id = '{$id}' + " + ); + +} + +/** + * Delete encounterlist entry. + * @param $id + * @param $where + */ +function delete_encounterlist_entry($id, $where = 'id') +{ + global $db; - $stop = $rs->fetch_assoc(); + // Delete entry from encounterlist table. + debug_log('Deleting entry with ' . $where . ' = ' . $id . ' from the encounterlist table'); + $rs_quests = my_query( + " + DELETE FROM encounterlist + WHERE $where = '{$id}' + " + ); +} + +/** + * Delete quicklist entry. + * @param $id + * @param $where + */ +function delete_quicklist_entry($id, $where = 'id') +{ + global $db; + + // Delete entry from quicklist table. + debug_log('Deleting entry with ' . $where . ' = ' . $id . ' from the quicklist table'); + $rs_quests = my_query( + " + DELETE FROM quick_questlist + WHERE $where = '{$id}' + " + ); +} + +/** + * Add quicklist entry. + * @param $questlist_id + * @param $rewardlist_id + */ +function add_quicklist_entry($questlist_id, $rewardlist_id) +{ + global $db; + + // Add entry to quicklist table. + debug_log('Adding quest with ID ' . $questlist_id . ' and reward with ID ' . $rewardlist_id . ' to the quicklist table'); + $rs = my_query( + " + INSERT INTO quick_questlist + SET quest_id = '{$questlist_id}', + reward_id = '{$rewardlist_id}' + " + ); +} + +/** + * Get pokestop. + * @param $pokestop_id + * @return array + */ +function get_pokestop($pokestop_id, $update_pokestop = true) +{ + global $db; - // Get address and update address string. - if(!empty(GOOGLE_API_KEY) && $update_pokestop == true){ - // Get address. - $lat = $stop['lat']; - $lon = $stop['lon']; - $addr = get_address($lat, $lon); - - // Get full address - Street #, ZIP District - $address = ""; - $address .= (!empty($addr['street']) ? $addr['street'] : ""); - $address .= (!empty($addr['street_number']) ? " " . $addr['street_number'] : ""); - $address .= (!empty($addr) ? ", " : ""); - $address .= (!empty($addr['postal_code']) ? $addr['postal_code'] . " " : ""); - $address .= (!empty($addr['district']) ? $addr['district'] : ""); - - // Update pokestop address. + // Pokestop from database + if($pokestop_id != 0) { + // Get pokestop from database $rs = my_query( - " - UPDATE pokestops - SET address = '{$db->real_escape_string($address)}' - WHERE id = '{$pokestop_id}' - " - ); + " + SELECT * + FROM pokestops + WHERE id = {$pokestop_id} + " + ); - // Set pokestop address. - $stop['address'] = $address; - } + $stop = $rs->fetch_assoc(); + + // Get address and update address string. + if($update_pokestop == true){ + // Get address. + $lat = $stop['lat']; + $lon = $stop['lon']; + $stop_addr = $stop['address']; + + // Update pokestop address. + if(empty($stop_addr) || (strpos($stop_addr, getPublicTranslation('forest')) === 0) || MAPS_LOOKUP == true) { + $addr = get_address($lat, $lon); + if(!empty($addr)) { + $address = format_address($addr); + $rs = my_query( + " + UPDATE pokestops + SET address = '{$db->real_escape_string($address)}' + WHERE id = '{$pokestop_id}' + " + ); + + // Set pokestop address. + $stop['address'] = $address; + } + } + } // Unnamend pokestop } else { @@ -689,23 +2373,32 @@ function get_pokestop($pokestop_id, $update_pokestop = true) /** * Get pokestops starting with the searchterm. * @param $searchterm + * @param $action + * @param $type * @return bool|array */ -function get_pokestop_list_keys($searchterm) +function get_pokestop_list_keys($searchterm, $action = 'quest_create', $type = 'quest') { // Make sure the search term is not empty if(!empty($searchterm)) { // Get pokestop from database $rs = my_query( " - SELECT id, pokestop_name + SELECT quests.quest_date, pokestops.id, pokestops.pokestop_name, + CASE WHEN SUM(quests.quest_date > UTC_DATE() AND quests.quest_date < UTC_DATE() + INTERVAL 1 DAY) THEN 1 ELSE 0 END AS active_quest, + CASE WHEN SUM(invasions.end_time > UTC_TIMESTAMP()) THEN 1 ELSE 0 END AS active_invasion FROM pokestops - WHERE pokestop_name LIKE '$searchterm%' - OR pokestop_name LIKE '%$searchterm%' + LEFT JOIN quests + ON quests.pokestop_id = pokestops.id + LEFT JOIN invasions + ON invasions.pokestop_id = pokestops.id + WHERE pokestops.pokestop_name LIKE '$searchterm%' + OR pokestops.pokestop_name LIKE '%$searchterm%' + GROUP BY pokestops.pokestop_name ORDER BY CASE - WHEN pokestop_name LIKE '$searchterm%' THEN 1 - WHEN pokestop_name LIKE '%$searchterm%' THEN 2 + WHEN pokestops.pokestop_name LIKE '$searchterm%' THEN 1 + WHEN pokestops.pokestop_name LIKE '%$searchterm%' THEN 2 ELSE 3 END LIMIT 15 @@ -720,11 +2413,21 @@ function get_pokestop_list_keys($searchterm) // Pokestop name. $pokestop_name = (!empty($stops['pokestop_name']) ? ($stops['pokestop_name']) : (getTranslation('unnamed_pokestop'))); - // Add keys. - $keys[] = array( - 'text' => $pokestop_name, - 'callback_data' => $stops['id'] . ':quest_create:0' - ); + // No active quest + if(($stops['active_quest'] == 0 && $type == 'quest') || ($stops['active_invasion'] == 0 && $type == 'invasion')) { + // Add keys. + $keys[] = array( + 'text' => $pokestop_name, + 'callback_data' => $stops['id'] . ':' . $action . ':0' + ); + // Add warning emoji for active quest + } else { + // Add keys. + $keys[] = array( + 'text' => EMOJI_WARN . SP . $pokestop_name, + 'callback_data' => $stops['id'] . ':' . $action . ':0' + ); + } } if($keys) { @@ -746,14 +2449,16 @@ function get_pokestop_list_keys($searchterm) * @param $lat * @param $lon * @param $radius + * @param $action + * @param $type * @return array */ -function get_pokestops_in_radius_keys($lat, $lon, $radius) +function get_pokestops_in_radius_keys($lat, $lon, $radius, $action = 'quest_create', $type = 'quest') { $radius = $radius / 1000; // Get all pokestop within the radius $rs = my_query( - " SELECT id, pokestop_name, + " SELECT pokestops.id, pokestops.pokestop_name, ( 6371 * acos( @@ -765,8 +2470,15 @@ function get_pokestops_in_radius_keys($lat, $lon, $radius) sin(radians({$lat})) * sin(radians(lat)) ) - ) AS distance + ) AS distance, + CASE WHEN SUM(quests.quest_date > UTC_DATE() AND quests.quest_date < UTC_DATE() + INTERVAL 1 DAY) THEN 1 ELSE 0 END AS active_quest, + CASE WHEN SUM(invasions.end_time > UTC_TIMESTAMP()) THEN 1 ELSE 0 END AS active_invasion FROM pokestops + LEFT JOIN quests + ON quests.pokestop_id = pokestops.id + LEFT JOIN invasions + ON invasions.pokestop_id = pokestops.id + GROUP BY pokestops.pokestop_name HAVING distance < {$radius} ORDER BY distance LIMIT 10 @@ -781,11 +2493,21 @@ function get_pokestops_in_radius_keys($lat, $lon, $radius) // Pokestop name. $pokestop_name = (!empty($stops['pokestop_name']) ? ($stops['pokestop_name']) : (getTranslation('unnamed_pokestop'))); - // Add keys. - $keys[] = array( - 'text' => $pokestop_name, - 'callback_data' => $stops['id'] . ':quest_create:0' - ); + // No active quest + if(($stops['active_quest'] == 0 && $type == 'quest') || ($stops['active_invasion'] == 0 && $type == 'invasion')) { + // Add keys. + $keys[] = array( + 'text' => $pokestop_name, + 'callback_data' => $stops['id'] . ':' . $action . ':0' + ); + // Add warning emoji for active quest + } else { + // Add keys. + $keys[] = array( + 'text' => EMOJI_WARN . SP . $pokestop_name, + 'callback_data' => $stops['id'] . ':' . $action . ':0' + ); + } } // Add unknown pokestop. @@ -799,140 +2521,6 @@ function get_pokestops_in_radius_keys($lat, $lon, $radius) return $keys; } -/** - * Get gym. - * @param $id - * @return array - */ -function get_gym($id) -{ - // Get gym from database - $rs = my_query( - " - SELECT * - FROM gyms - WHERE id = {$id} - " - ); - - $gym = $rs->fetch_assoc(); - - return $gym; -} - -/** - * Get pokemon info as formatted string. - * @param $pokedex_id - * @return array - */ -function get_pokemon_info($pokedex_id) -{ - /** Example: - * Raid boss: Mewtwo (#ID) - * Weather: Icons - * CP: CP values (Boosted CP values) - */ - $info = ''; - $info .= getTranslation('raid_boss') . ': ' . get_local_pokemon_name($pokedex_id) . ' (#' . $pokedex_id . ')' . CR . CR; - $poke_raid_level = get_raid_level($pokedex_id); - $poke_cp = get_formatted_pokemon_cp($pokedex_id); - $poke_weather = get_pokemon_weather($pokedex_id); - $info .= getTranslation('pokedex_raid_level') . ': ' . getTranslation($poke_raid_level . 'stars') . CR; - $info .= (empty($poke_cp)) ? (getTranslation('pokedex_cp') . CR) : $poke_cp . CR; - $info .= getTranslation('pokedex_weather') . ': ' . get_weather_icons($poke_weather) . CR . CR; - - return $info; -} - -/** - * Get pokemon cp values. - * @param $pokedex_id - * @return array - */ -function get_pokemon_cp($pokedex_id) -{ - // Get gyms from database - $rs = my_query( - " - SELECT min_cp, max_cp, min_weather_cp, max_weather_cp - FROM pokemon - WHERE pokedex_id = {$pokedex_id} - " - ); - - $cp = $rs->fetch_assoc(); - - return $cp; -} - -/** - * Get formatted pokemon cp values. - * @param $pokedex_id - * @param $override_language - * @return string - */ -function get_formatted_pokemon_cp($pokedex_id, $override_language = false) -{ - // Init cp text. - $cp20 = ''; - $cp25 = ''; - - // Valid pokedex id? - if($pokedex_id !== "NULL" && $pokedex_id != 0) { - // Get gyms from database - $rs = my_query( - " - SELECT min_cp, max_cp, min_weather_cp, max_weather_cp - FROM pokemon - WHERE pokedex_id = {$pokedex_id} - " - ); - - while($row = $rs->fetch_assoc()) { - // CP - $cp20 .= ($row['min_cp'] > 0) ? $row['min_cp'] : ''; - $cp20 .= (!empty($cp20) && $cp20 > 0) ? ('/' . $row['max_cp']) : ($row['max_cp']); - - // Weather boosted CP - $cp25 .= ($row['min_weather_cp'] > 0) ? $row['min_weather_cp'] : ''; - $cp25 .= (!empty($cp25) && $cp25 > 0) ? ('/' . $row['max_weather_cp']) : ($row['max_weather_cp']); - } - } - - // Combine CP and weather boosted CP - $text = ($override_language == true) ? (getRaidTranslation('pokedex_cp')) : (getTranslation('pokedex_cp')); - $cp = (!empty($cp20)) ? ($text . ' ' . $cp20 . '') : ''; - $cp .= (!empty($cp25)) ? (' (' . $cp25 . ')') : ''; - - return $cp; -} - -/** - * Get pokemon weather. - * @param $pokedex_id - * @return string - */ -function get_pokemon_weather($pokedex_id) -{ - if($pokedex_id !== "NULL" && $pokedex_id != 0) { - // Get pokemon weather from database - $rs = my_query( - " - SELECT weather - FROM pokemon - WHERE pokedex_id = {$pokedex_id} - " - ); - - // Fetch the row. - $ww = $rs->fetch_assoc(); - - return $ww['weather']; - } else { - return 0; - } -} - /** * Get weather icons. * @param $weather_value @@ -957,401 +2545,178 @@ function get_weather_icons($weather_value) // Trim space after last icon $weather_icons = rtrim($weather_icons); - } else { - $weather_icons = ''; - } - - return $weather_icons; -} - -/** - * Get user. - * @param $user_id - * @return message - */ -function get_user($user_id) -{ - // Get user details. - $rs = my_query( - " - SELECT * - FROM users - WHERE user_id = {$user_id} - " - ); - - // Fetch the row. - $row = $rs->fetch_assoc(); - - // Build message string. - $msg = ''; - - // Add name. - $msg .= 'Name: ' . htmlspecialchars($row['name']) . '' . CR; - - // Unknown team. - if ($row['team'] === NULL) { - $msg .= 'Team: ' . $GLOBALS['teams']['unknown'] . CR; - - // Known team. - } else { - $msg .= 'Team: ' . $GLOBALS['teams'][$row['team']] . CR; - } - - // Add level. - if ($row['level'] != 0) { - $msg .= 'Level: ' . $row['level'] . CR; - } - - return $msg; -} - -/** - * Get timezone from user or config as fallback. - * @param $update - * @return timezone - */ -function get_timezone($update) -{ - // Get telegram ID to check access from $update - either message, callback_query or inline_query - $update_type = ''; - $update_type = !empty($update['message']['from']['id']) ? 'message' : $update_type; - $update_type = (empty($update_type) && !empty($update['callback_query']['from']['id'])) ? 'callback_query' : $update_type; - $update_type = (empty($update_type) && !empty($update['inline_query']['from']['id'])) ? 'inline_query' : $update_type; - $update_id = $update[$update_type]['from']['id']; - - // Log message type and ID - debug_log('Telegram message type: ' . $update_type); - debug_log('Getting timezone for ID: ' . $update_id); - - // Build query. - $rs = my_query( - " - SELECT timezone - FROM raids - WHERE id = ( - SELECT raid_id - FROM attendance - WHERE user_id = {$update_id} - ORDER BY id DESC LIMIT 1 - ) - " - ); - - // Get row. - $row = $rs->fetch_assoc(); - - // No data found. - if (!$row) { - $tz = TIMEZONE; - debug_log('No timezone found for ID: ' . $update_id, '!'); - debug_log('Returning default timezone: ' . $tz, '!'); - } else { - $tz = $row['timezone']; - debug_log('Found timezone for ID: ' . $update_id); - debug_log('Returning timezone: ' . $tz); - } - - return $tz; -} - -/** - * Moderator keys. - * @param $limit - * @param $action - * @return array - */ -function edit_moderator_keys($limit, $action) -{ - // Number of entries to display at once. - $entries = 10; - - // Number of entries to skip with skip-back and skip-next buttons - $skip = 50; - - // Module for back and next keys - $module = "mods"; - - // Init empty keys array. - $keys = array(); - - // Get moderators from database - if ($action == "list" || $action == "delete") { - $rs = my_query( - " - SELECT * - FROM users - WHERE moderator = 1 - ORDER BY name - LIMIT $limit, $entries - " - ); - - // Number of entries - $cnt = my_query( - " - SELECT COUNT(*) - FROM users - WHERE moderator = 1 - " - ); - } else if ($action == "add") { - $rs = my_query( - " - SELECT * - FROM users - WHERE (moderator = 0 OR moderator IS NULL) - ORDER BY name - LIMIT $limit, $entries - " - ); - - // Number of entries - $cnt = my_query( - " - SELECT COUNT(*) - FROM users - WHERE (moderator = 0 OR moderator IS NULL) - " - ); + } else { + $weather_icons = ''; } - // Number of database entries found. - $sum = $cnt->fetch_row(); - $count = $sum['0']; + return $weather_icons; +} - // List users / moderators - while ($mod = $rs->fetch_assoc()) { - $keys[] = array( - 'text' => $mod['name'], - 'callback_data' => '0:mods_' . $action . ':' . $mod['user_id'] - ); - } +/** + * Get user. + * @param $user_id + * @return message + */ +function get_user($user_id) +{ + // Get user details. + $rs = my_query( + " + SELECT * + FROM users + WHERE user_id = {$user_id} + " + ); - // Empty backs and next keys - $keys_back = array(); - $keys_next = array(); + // Fetch the row. + $row = $rs->fetch_assoc(); - // Add back key. - if ($limit > 0) { - $new_limit = $limit - $entries; - $empty_back_key = array(); - $back = universal_key($empty_back_key, $new_limit, $module, $action, getTranslation('back') . " (-" . $entries . ")"); - $keys_back[] = $back[0][0]; - } + // Build message string. + $msg = ''; - // Add skip back key. - if ($limit - $skip > 0) { - $new_limit = $limit - $skip - $entries; - $empty_back_key = array(); - $back = universal_key($empty_back_key, $new_limit, $module, $action, getTranslation('back') . " (-" . $skip . ")"); - $keys_back[] = $back[0][0]; - } + // Add name. + $msg .= 'Name: ' . htmlspecialchars($row['name']) . '' . CR; - // Add next key. - if (($limit + $entries) < $count) { - $new_limit = $limit + $entries; - $empty_next_key = array(); - $next = universal_key($empty_next_key, $new_limit, $module, $action, getTranslation('next') . " (+" . $entries . ")"); - $keys_next[] = $next[0][0]; - } + // Unknown team. + if ($row['team'] === NULL) { + $msg .= 'Team: ' . $GLOBALS['teams']['unknown'] . CR; - // Add skip next key. - if (($limit + $skip + $entries) < $count) { - $new_limit = $limit + $skip + $entries; - $empty_next_key = array(); - $next = universal_key($empty_next_key, $new_limit, $module, $action, getTranslation('next') . " (+" . $skip . ")"); - $keys_next[] = $next[0][0]; + // Known team. + } else { + $msg .= 'Team: ' . $GLOBALS['teams'][$row['team']] . CR; } - // Exit key - $empty_exit_key = array(); - $key_exit = universal_key($empty_exit_key, "0", "exit", "0", getTranslation('abort')); - - // Get the inline key array. - $keys = inline_key_array($keys, 1); - $keys_back = inline_key_array($keys_back, 2); - $keys_next = inline_key_array($keys_next, 2); - $keys = array_merge($keys_back, $keys); - $keys = array_merge($keys, $keys_next); - $keys = array_merge($keys, $key_exit); + // Add level. + if ($row['level'] != 0) { + $msg .= 'Level: ' . $row['level'] . CR; + } - return $keys; + return $msg; } /** - * Inline key array. - * @param $buttons - * @param $columns + * Get pokestop by telegram id. + * @param $id * @return array */ -function inline_key_array($buttons, $columns) +function get_pokestop_by_telegram_id($id) { - $result = array(); - $col = 0; - $row = 0; + // Get pokestop from database + $rs = my_query( + " + SELECT * + FROM pokestops + WHERE pokestop_name = '{$id}' + ORDER BY id DESC + LIMIT 1 + " + ); - foreach ($buttons as $v) { - $result[$row][$col] = $v; - $col++; + $stop = $rs->fetch_assoc(); - if ($col >= $columns) { - $row++; - $col = 0; + return $stop; +} + +/** + * Get pokestop details. + * @param $pokestop + * @return string + */ +function get_pokestop_details($pokestop) +{ + // Add pokestop name to message. + $msg = '' . getTranslation('pokestop_details') . ':' . CR . CR; + $msg .= 'ID = ' . $pokestop['id'] . '' . CR; + $msg .= getTranslation('pokestop') . ':' . SP . '' . $pokestop['pokestop_name'] . '' . CR; + // Add maps link to message. + if (!empty($pokestop['address'])) { + $msg .= '' . $pokestop['address'] . '' . CR; + } else { + // Get the address. + $addr = get_address($pokestop['lat'], $pokestop['lon']); + $address = format_address($addr); + + //Only store address if not empty + if(!empty($address)) { + //Use new address + $msg .= '' . $address . '' . CR; + } else { + //If no address is found show maps link + $msg .= 'http://maps.google.com/maps?q=' . $pokestop['lat'] . ',' . $pokestop['lon'] . '' . CR; } } - return $result; + + return $msg; } /** - * Pokedex edit pokemon keys. - * @param $limit - * @param $action + * Delete pokestop. + * @param $id * @return array */ -function edit_pokedex_keys($limit, $action, $all_pokemon = true) +function delete_pokestop($id) { - // Number of entries to display at once. - $entries = 10; - - // Number of entries to skip with skip-back and skip-next buttons - $skip = 50; - - // Module for back and next keys - $module = "pokedex"; - - // Init empty keys array. - $keys = array(); - - // Get only pokemon with CP and weather values from database - if($all_pokemon == false) { - $rs = my_query( - " - SELECT pokedex_id - FROM pokemon - WHERE min_cp > 0 - AND max_cp > 0 - AND min_weather_cp > 0 - AND max_weather_cp > 0 - AND weather > 0 - ORDER BY pokedex_id - LIMIT $limit, $entries - " - ); - - // Number of entries - $cnt = my_query( - " - SELECT COUNT(*) - FROM pokemon - WHERE min_cp > 0 - AND max_cp > 0 - AND min_weather_cp > 0 - AND max_weather_cp > 0 - AND weather > 0 - " - ); - // Get all pokemon from database - } else { - $rs = my_query( - " - SELECT pokedex_id - FROM pokemon - ORDER BY pokedex_id - LIMIT $limit, $entries - " - ); - - // Number of entries - $cnt = my_query( + // Delete pokestop from database + $rs = my_query( " - SELECT COUNT(*) - FROM pokemon + DELETE FROM pokestops + WHERE id = {$id} " ); - } - // Number of database entries found. - $sum = $cnt->fetch_row(); - $count = $sum['0']; - - // List users / moderators - while ($mon = $rs->fetch_assoc()) { - $pokemon_name = get_local_pokemon_name($mon['pokedex_id']); - $keys[] = array( - 'text' => $mon['pokedex_id'] . ' ' . $pokemon_name, - 'callback_data' => $mon['pokedex_id'] . ':pokedex_edit_pokemon:0' - ); - } - - // Empty backs and next keys - $keys_back = array(); - $keys_next = array(); - - // Add back key. - if ($limit > 0) { - $new_limit = $limit - $entries; - $empty_back_key = array(); - $back = universal_key($empty_back_key, $new_limit, $module, $action, getTranslation('back') . " (-" . $entries . ")"); - $keys_back[] = $back[0][0]; - } - - // Add skip back key. - if ($limit - $skip > 0) { - $new_limit = $limit - $skip - $entries; - $empty_back_key = array(); - $back = universal_key($empty_back_key, $new_limit, $module, $action, getTranslation('back') . " (-" . $skip . ")"); - $keys_back[] = $back[0][0]; - } - - // Add next key. - if (($limit + $entries) < $count) { - $new_limit = $limit + $entries; - $empty_next_key = array(); - $next = universal_key($empty_next_key, $new_limit, $module, $action, getTranslation('next') . " (+" . $entries . ")"); - $keys_next[] = $next[0][0]; - } - - // Add skip next key. - if (($limit + $skip + $entries) < $count) { - $new_limit = $limit + $skip + $entries; - $empty_next_key = array(); - $next = universal_key($empty_next_key, $new_limit, $module, $action, getTranslation('next') . " (+" . $skip . ")"); - $keys_next[] = $next[0][0]; - } - - // Exit key - $empty_exit_key = array(); - $key_exit = universal_key($empty_exit_key, "0", "exit", "0", getTranslation('abort')); - - // Get the inline key array. - $keys = inline_key_array($keys, 1); - $keys_back = inline_key_array($keys_back, 2); - $keys_next = inline_key_array($keys_next, 2); - $keys = array_merge($keys_back, $keys); - $keys = array_merge($keys, $keys_next); - $keys = array_merge($keys, $key_exit); - - return $keys; } /** * Quest type keys. * @param $pokestop_id + * @param $event * @return array */ -function quest_type_keys($pokestop_id) +function quest_type_keys($pokestop_id, $event = 0) { + // Hide/show events + if($event == 0) { + // Init empty keys array. + $keys_event = array(); + + // Get all quest events from database + $rs_event = my_query( + " + SELECT quest_event + FROM questlist + WHERE quest_event > 0 + GROUP BY quest_event + " + ); + + // Add key for each event + while ($ql_entry = $rs_event->fetch_assoc()) { + $text = getTranslation('quest_event_'. $ql_entry['quest_event']) . '...'; + // Add keys. + $keys_event[] = array( + 'text' => $text, + 'callback_data' => $pokestop_id . ':quest_edit_type:0-' . $ql_entry['quest_event'] . '-0' + ); + } + + // Get the inline key array. + if($keys_event) { + $keys_event = inline_key_array($keys_event, 1); + } + } + + // Init empty keys array. + $keys = array(); + // Get all quest types from database $rs = my_query( " - SELECT quest_type + SELECT quest_event, quest_type FROM questlist + WHERE quest_event = {$event} GROUP BY quest_type " ); - // Init empty keys array. - $keys = array(); // Add key for each quest quantity and action while ($quest = $rs->fetch_assoc()) { @@ -1359,21 +2724,36 @@ function quest_type_keys($pokestop_id) // Add keys. $keys[] = array( 'text' => $text, - 'callback_data' => $pokestop_id . ':quest_edit_type:' . $quest['quest_type'] + 'callback_data' => $pokestop_id . ':quest_edit_type:1-' . $quest['quest_event'] . '-' . $quest['quest_type'] ); } // Get the inline key array. $keys = inline_key_array($keys, 2); + // Merge keys. + if($keys_event) { + $keys = array_merge($keys_event, $keys); + } + // Add quick selection keys. - $quick_keys = quick_quest_keys($pokestop_id); - $keys = array_merge($keys, $quick_keys); + if($event == 0) { + $quick_keys = quick_quest_keys($pokestop_id); + $keys = array_merge($keys, $quick_keys); + } // Add navigation key. - $nav_keys = array(); - $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); - $keys[] = $nav_keys; + if($event > 0) { + $nav_keys = array(); + $nav_keys[] = universal_inner_key($keys, $pokestop_id, 'quest_create', '0', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + $nav_keys = inline_key_array($nav_keys, 2); + $keys = array_merge($keys, $nav_keys); + } else { + $nav_keys = array(); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + $keys[] = $nav_keys; + } debug_log($keys); @@ -1401,12 +2781,7 @@ function quick_quest_keys($pokestop_id) // Add key for each quest quantity and action while ($qq = $qs->fetch_assoc()) { $ql_entry = get_questlist_entry($qq['quest_id']); - - // Quest action: Singular or plural? - $quest_action = explode(":", getTranslation('quest_action_' . $ql_entry['quest_action'])); - $quest_action_singular = $quest_action[0]; - $quest_action_plural = $quest_action[1]; - $qty_action = $ql_entry['quest_quantity'] . SP . (($ql_entry['quest_quantity'] > 1) ? ($quest_action_plural) : ($quest_action_singular)); + $qty_action = get_quest_action($ql_entry); // Rewardlist entry. $rl_entry = get_rewardlist_entry($qq['reward_id']); @@ -1456,10 +2831,11 @@ function quick_quest_keys($pokestop_id) /** * Quest quantity and action keys. * @param $pokestop_id + * @param $quest_event * @param $quest_type * @return array */ -function quest_qty_action_keys($pokestop_id, $quest_type) +function quest_qty_action_keys($pokestop_id, $quest_event, $quest_type) { // Get all quest types from database $rs = my_query( @@ -1467,6 +2843,7 @@ function quest_qty_action_keys($pokestop_id, $quest_type) SELECT * FROM questlist WHERE quest_type = '$quest_type' + AND quest_event = {$quest_event} ORDER BY quest_quantity " ); @@ -1474,18 +2851,22 @@ function quest_qty_action_keys($pokestop_id, $quest_type) // Init empty keys array. $keys = array(); + // Event? + if($quest_event == 0) { + $cb_event_type = '0-' . $quest_event . '-' . $quest_type; + } else { + $cb_event_type = '1-' . $quest_event . '-' . $quest_type; + } + // Add key for each quest quantity and action while ($quest = $rs->fetch_assoc()) { - // Quest action: Singular or plural? - $quest_action = explode(":", getTranslation('quest_action_' . $quest['quest_action'])); - $quest_action_singular = $quest_action[0]; - $quest_action_plural = $quest_action[1]; - $qty_action = $quest['quest_quantity'] . SP . (($quest['quest_quantity'] > 1) ? ($quest_action_plural) : ($quest_action_singular)); + $qty_action = get_quest_action($quest); // Add keys. $keys[] = array( 'text' => $qty_action, - 'callback_data' => $pokestop_id . ':quest_edit_reward:' . $quest['id'] . ',' . $quest_type + //'callback_data' => $pokestop_id . ':quest_edit_reward:' . $quest['id'] . ',' . $quest_event . '-' . $quest_type + 'callback_data' => $pokestop_id . ':quest_edit_reward:' . $quest['id'] . ',' . $cb_event_type ); } @@ -1539,15 +2920,18 @@ function reward_type_keys($pokestop_id, $quest_id, $quest_type) $msg_poke = ''; // Get encounters $enc_pokemon = get_encounterlist_entry($quest_id); - $quest_pokemons = explode(',', $enc_pokemon['pokedex_ids']); - // Get local pokemon name - foreach($quest_pokemons as $pokedex_id) { - $msg_poke .= get_local_pokemon_name($pokedex_id); - $msg_poke .= ' / '; + // Make sure we have encounters. + if($enc_pokemon['pokedex_ids'] != '0' && $enc_pokemon['pokedex_ids'] !== NULL) { + $quest_pokemons = explode(',', $enc_pokemon['pokedex_ids']); + // Get local pokemon name + foreach($quest_pokemons as $pokedex_id) { + $msg_poke .= get_local_pokemon_name($pokedex_id); + $msg_poke .= ' / '; + } + // Trim last slash + $msg_poke = rtrim($msg_poke,' / '); + $msg_poke = (!empty($msg_poke) ? $msg_poke : ''); } - // Trim last slash - $msg_poke = rtrim($msg_poke,' / '); - $msg_poke = (!empty($msg_poke) ? $msg_poke : ''); // Key to save and share $save_share_keys = array(); @@ -1580,7 +2964,7 @@ function reward_type_keys($pokestop_id, $quest_id, $quest_type) $text = $rw_type[0]; // Add keys. $keys[] = array( - 'text' => $text, + 'text' => ucfirst($text), 'callback_data' => $pokestop_id . ',' . $quest_id . ':quest_edit_qty_reward:' . $quest_type . ',' . $reward['reward_type'] ); } @@ -1655,135 +3039,32 @@ function reward_qty_type_keys($pokestop_id, $quest_id, $quest_type, $reward_type } /** - * Pokemon keys. - * @param $raid_id - * @param $raid_level - * @return array - */ -function pokemon_keys($raid_id, $raid_level, $action) -{ - // Init empty keys array. - $keys = array(); - - // Get pokemon from database - $rs = my_query( - " - SELECT pokedex_id - FROM pokemon - WHERE raid_level = '$raid_level' - " - ); - - // Add key for each raid level - while ($pokemon = $rs->fetch_assoc()) { - $keys[] = array( - 'text' => get_local_pokemon_name($pokemon['pokedex_id']), - 'callback_data' => $raid_id . ':' . $action . ':' . $pokemon['pokedex_id'] - ); - } - - // Get the inline key array. - $keys = inline_key_array($keys, 3); - - return $keys; -} - -/** - * Weather keys. - * @param $pokedex_id - * @param $action - * @param $arg - * @return array - */ -function weather_keys($pokedex_id, $action, $arg) -{ - // Get the type, level and cp - $data = explode("-", $arg); - $weather_add = $data[0] . '-'; - $weather_value = $data[1]; - - // Save and reset values - $save_arg = 'save-' . $weather_value; - $reset_arg = $weather_add . '0'; - - // Init empty keys array. - $keys = array(); - - // Max amount of weathers a pokemon raid boss can have is 3 which means 999 - // Keys will be shown up to 99 and when user is adding one more weather we exceed 99, so we remove the keys then - // This means we do not exceed the max amout of 3 weathers a pokemon can have :) - // And no, 99 is not a typo if you read my comment above :P - if($weather_value <= 99) { - // Get last number from weather array - end($GLOBALS['weather']); - $last = key($GLOBALS['weather']); - - // Add buttons for each weather. - for ($i = 1; $i <= $last; $i = $i + 1) { - // Get length of arg and split arg - $weather_value_length = strlen((string)$weather_value); - $weather_value_string = str_split((string)$weather_value); - - // Continue if weather got already selected - if($weather_value_length == 1 && $weather_value == $i) continue; - if($weather_value_length == 2 && $weather_value_string[0] == $i) continue; - if($weather_value_length == 2 && $weather_value_string[1] == $i) continue; - - // Set new weather. - $new_weather = $weather_add . ($weather_value == 0 ? '' : $weather_value) . $i; - - // Set keys. - $keys[] = array( - 'text' => $GLOBALS['weather'][$i], - 'callback_data' => $pokedex_id . ':' . $action . ':' . $new_weather - ); - } - } - - // Get the inline key array. - $keys = inline_key_array($keys, 3); - - // Save and Reset key - $keys[] = array( - array( - 'text' => EMOJI_DISK, - 'callback_data' => $pokedex_id . ':' . $action . ':' . $save_arg - ), - array( - 'text' => getTranslation('reset'), - 'callback_data' => $pokedex_id . ':' . $action . ':' . $reset_arg - ) - ); - - return $keys; -} - -/** - * CP keys. - * @param $pokedex_id + * Quantity keys. + * @param $id * @param $action * @param $arg + * @param $type * @return array */ -function cp_keys($pokedex_id, $action, $arg) +function quantity_keys($id, $action, $arg, $type = 'reward') { - // Get the type, level and cp - $data = explode("-", $arg); - $cp_type_level = $data[0] . '-' . $data[1]; - $cp_add = $data[0] . '-' . $data[1] . '-' . $data[2] . '-'; - $old_cp = $data[3]; + // Get the action and value + $actionval = explode("-", $arg); + $add = $actionval[0] . '-'; + $old = $actionval[1]; // Save and reset values - $save_arg = $cp_type_level . '-save-' . $old_cp; - $reset_arg = $cp_add . '0'; + $save_arg = ($type == 'reward') ? ('save-' . $old) : ('add-' . $old); + $save_text = ($type == 'reward') ? EMOJI_DISK : getTranslation('next'); + $reset_arg = $add . '0'; // Init empty keys array. $keys = array(); - // Max CP is 9999 and no the value 999 is not a typo! - // Keys will be shown up to 999 and when user is adding one more number we exceed 999, so we remove the keys then - // This means we do not exceed a Max CP of 9999 :) - if($old_cp <= 999) { + // Max is 9999 and no the value 999 is not a typo! + // Keys will be shown up to 9999 and when user is adding one more number we exceed 9999, so we remove the keys then + // This means we do not exceed a Max value of 9999 :) + if($old <= 999) { // Add keys 0 to 9 /** @@ -1795,182 +3076,87 @@ function cp_keys($pokedex_id, $action, $arg) // 7 8 9 for ($i = 7; $i <= 9; $i = $i + 1) { - // Set new cp - $new_cp = $cp_add . ($old_cp == 0 ? '' : $old_cp) . $i; + // Set new + $new = $add . ($old == 0 ? '' : $old) . $i; // Set keys. $keys[] = array( 'text' => $i, - 'callback_data' => $pokedex_id . ':' . $action . ':' . $new_cp + 'callback_data' => $id . ':' . $action . ':' . $new ); } // 4 5 6 for ($i = 4; $i <= 6; $i = $i + 1) { - // Set new cp - $new_cp = $cp_add . ($old_cp == 0 ? '' : $old_cp) . $i; + // Set new + $new = $add . ($old == 0 ? '' : $old) . $i; // Set keys. $keys[] = array( 'text' => $i, - 'callback_data' => $pokedex_id . ':' . $action . ':' . $new_cp + 'callback_data' => $id . ':' . $action . ':' . $new ); } // 1 2 3 for ($i = 1; $i <= 3; $i = $i + 1) { - // Set new cp - $new_cp = $cp_add . ($old_cp == 0 ? '' : $old_cp) . $i; + // Set new + $new = $add . ($old == 0 ? '' : $old) . $i; // Set keys. $keys[] = array( 'text' => $i, - 'callback_data' => $pokedex_id . ':' . $action . ':' . $new_cp + 'callback_data' => $id . ':' . $action . ':' . $new ); } // 0 - if($old_cp != 0) { - // Set new cp - $new_cp = $cp_add . $old_cp . '0'; - } else { - $new_cp = $reset_arg; - } - - // Set keys. - $keys[] = array( - 'text' => '0', - 'callback_data' => $pokedex_id . ':' . $action . ':' . $new_cp - ); - } - - // Save - $keys[] = array( - 'text' => EMOJI_DISK, - 'callback_data' => $pokedex_id . ':' . $action . ':' . $save_arg - ); - - // Reset - $keys[] = array( - 'text' => getTranslation('reset'), - 'callback_data' => $pokedex_id . ':' . $action . ':' . $reset_arg - ); - - // Get the inline key array. - $keys = inline_key_array($keys, 3); - - return $keys; -} - -/** - * Universal key. - * @param $keys - * @param $id - * @param $action - * @param $arg - * @param $text - * @return array - */ -function universal_key($keys, $id, $action, $arg, $text = '0') -{ - $keys[] = [ - array( - 'text' => $text, - 'callback_data' => $id . ':' . $action . ':' . $arg - ) - ]; - - // Write to log. - //debug_log($keys); - - return $keys; -} - - -/** - * Universal key. - * @param $keys - * @param $id - * @param $action - * @param $arg - * @param $text - * @return array - */ -function universal_inner_key($keys, $id, $action, $arg, $text = '0') -{ - $keys = array( - 'text' => $text, - 'callback_data' => $id . ':' . $action . ':' . $arg - ); - - // Write to log. - //debug_log($keys); + if($old != 0) { + // Set new + $new = $add . $old . '0'; + } else { + $new = $reset_arg; + } + + // Set keys. + $keys[] = array( + 'text' => '0', + 'callback_data' => $id . ':' . $action . ':' . $new + ); + } - return $keys; -} + // Reward? Save button! + if($type == 'reward') { + // Save + $keys[] = array( + 'text' => $save_text, + 'callback_data' => $id . ':' . $action . ':' . $save_arg + ); + } -/** - * Share keys. - * @param $quest_id - * @param $user_id - * @return array - */ -function share_quest_keys($quest_id, $user_id) -{ - // Moderator or not? - debug_log("Checking if user is moderator: " . $user_id); - $rs = my_query( - " - SELECT moderator - FROM users - WHERE user_id = {$user_id} - " + // Reset + $keys[] = array( + 'text' => getTranslation('reset'), + 'callback_data' => $id . ':' . $action . ':' . $reset_arg ); - // Fetch user data. - $user = $rs->fetch_assoc(); + // Get the inline key array. + $keys = inline_key_array($keys, 3); - // Check moderator status. - $mod = $user['moderator']; - debug_log('User is ' . (($mod == 1) ? '' : 'not ') . 'a moderator: ' . $user_id); + // Not reward? Next button! + if($type != 'reward') { + // Add next navigation key. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, $id, $action, $save_arg . '-0', getTranslation('next')); - // Add share button if not restricted. - if ((SHARE_MODERATORS == true && $mod == 1) || SHARE_USERS == true) { - debug_log('Adding general share key to inline keys'); - // Set the keys. - $keys[] = [ - [ - 'text' => getTranslation('share'), - 'switch_inline_query' => basename(ROOT_PATH) . ':' . strval($quest_id) - ] - ]; - } - - // Add buttons for predefined sharing chats. - if (!empty(SHARE_CHATS)) { - // Add keys for each chat. - $chats = explode(',', SHARE_CHATS); - foreach($chats as $chat) { - // Get chat object - debug_log("Getting chat object for '" . $chat . "'"); - $chat_obj = get_chat($chat); - - // Check chat object for proper response. - if ($chat_obj['ok'] == true) { - debug_log('Proper chat object received, continuing to add key for this chat: ' . $chat_obj['result']['title']); - $keys[] = [ - [ - 'text' => getTranslation('share_with') . ' ' . $chat_obj['result']['title'], - 'callback_data' => $quest_id . ':quest_share:' . $chat - ] - ]; - } - } + // Get the inline key array. + $keys[] = $nav_keys; } return $keys; } + /** * Insert quest cleanup info to database. * @param $chat_id @@ -1984,6 +3170,7 @@ function insert_cleanup($chat_id, $message_id, $quest_id) debug_log('Chat_ID: ' . $chat_id); debug_log('Message_ID: ' . $message_id); + // Quests if ((is_numeric($chat_id)) && (is_numeric($message_id)) && (is_numeric($quest_id)) && ($quest_id > 0)) { global $db; @@ -1996,7 +3183,7 @@ function insert_cleanup($chat_id, $message_id, $quest_id) // Insert cleanup info to database if ($quest) { // Check if cleanup info is already in database or not - // Needed since raids can be shared to multiple channels / supergroups! + // Needed since quests can be shared to multiple channels / supergroups! $rs = my_query( " SELECT * @@ -2016,7 +3203,7 @@ function insert_cleanup($chat_id, $message_id, $quest_id) } } - // Insert into database when raid found but no cleanup info found + // Insert into database when quest found but no cleanup info found if ($quest && !$found) { // Build query for cleanup table to add cleanup info to database debug_log('Adding cleanup info to database:'); @@ -2029,6 +3216,54 @@ function insert_cleanup($chat_id, $message_id, $quest_id) " ); } + + // Invasions + } else if ((is_numeric($chat_id)) && (is_numeric($message_id)) && (is_numeric($quest_id)) && ($quest_id < 0)) { + global $db; + + // Get invasion. + $invasion_id = abs($quest_id); + $invasion = get_invasion($invasion_id); + + // Init found. + $found = false; + + // Insert cleanup info to database + if ($invasion) { + // Check if cleanup info is already in database or not + // Needed since invasions can be shared to multiple channels / supergroups! + $rs = my_query( + " + SELECT * + FROM qleanup + WHERE quest_id = '{$quest_id}' + " + ); + + // Chat_id and message_id equal to info from database + while ($cleanup = $rs->fetch_assoc()) { + // Leave while loop if cleanup info is already in database + if(($cleanup['chat_id'] == $chat_id) && ($cleanup['message_id'] == $message_id)) { + debug_log('Cleanup preparation info is already in database!'); + $found = true; + break; + } + } + } + + // Insert into database when invasion found but no cleanup info found + if ($invasion && !$found) { + // Build query for cleanup table to add cleanup info to database + debug_log('Adding cleanup info to database:'); + $rs = my_query( + " + INSERT INTO qleanup + SET quest_id = '{$quest_id}', + chat_id = '{$chat_id}', + message_id = '{$message_id}' + " + ); + } } else { debug_log('Invalid input for cleanup preparation!'); } @@ -2039,7 +3274,7 @@ function insert_cleanup($chat_id, $message_id, $quest_id) * @param $telegram * @param $database */ -function run_quests_cleanup ($telegram = 2, $database = 2) { +function run_cleanup ($telegram = 2, $database = 2) { /* Check input * 0 = Do nothing * 1 = Cleanup @@ -2082,11 +3317,23 @@ function run_quests_cleanup ($telegram = 2, $database = 2) { ); // Query for telegram and database cleanup } else { - // Get cleanup info. + // Get cleanup info for telegram cleanup. $rs = my_query( " SELECT * FROM qleanup + WHERE chat_id <> 0 + ORDER BY id DESC + LIMIT 0, 250 + ", true + ); + + // Get cleanup info for database cleanup. + $rs_db = my_query( + " + SELECT * + FROM qleanup + WHERE chat_id = 0 LIMIT 0, 250 ", true ); @@ -2100,11 +3347,20 @@ function run_quests_cleanup ($telegram = 2, $database = 2) { $cleanup_jobs[] = $rowJob; } + // Cleanup telegram and database? + if($telegram == 1 && $database == 1) { + // Add database cleanup jobs to array. + while ($rowDBJob = $rs_db->fetch_assoc()) { + $cleanup_jobs[] = $rowDBJob; + } + } + // Write to log. cleanup_log($cleanup_jobs); - // Init previous quest id. + // Init previous quest and invasion id. $prev_quest_id = "FIRST_RUN"; + $prev_invasion_id = "FIRST_RUN"; foreach ($cleanup_jobs as $row) { // Set current quest id. @@ -2114,75 +3370,32 @@ function run_quests_cleanup ($telegram = 2, $database = 2) { cleanup_log("Cleanup ID: " . $row['id']); cleanup_log("Chat ID: " . $row['chat_id']); cleanup_log("Message ID: " . $row['message_id']); - cleanup_log("Quest ID: " . $row['quest_id']); - - // Make sure quest exists - $rs = my_query( - " - SELECT id - FROM quests - WHERE id = {$current_quest_id} - ", true - ); - $qq = $rs->fetch_row(); - - // No quest found - set cleanup to 0 and continue with next quest - if (empty($qq['0'])) { - cleanup_log('No quest found with ID: ' . $current_quest_id, '!'); - cleanup_log('Updating cleanup information.'); - my_query( - " - UPDATE qleanup - SET chat_id = 0, - message_id = 0 - WHERE id = {$row['id']} - ", true - ); - - // Continue with next quest - continue; + if($current_quest_id[0] == '-') { + cleanup_log("Invasion ID: " . $row['quest_id']); + } else { + cleanup_log("Quest ID: " . $row['quest_id']); } - // Get quest data only when quest_id changed compared to previous run - if ($prev_quest_id != $current_quest_id) { - // Get the quest date by id. + // Quest or invasion? + // Invasion + if($current_quest_id[0] == '-') { + $current_invasion_id = abs($current_quest_id); + // Make sure invasion exists $rs = my_query( " - SELECT quest_date, - CURDATE() AS today, - UNIX_TIMESTAMP(quest_date) AS ts_questdate, - UNIX_TIMESTAMP(CURDATE()) AS ts_today - FROM quests - WHERE id = {$current_quest_id} + SELECT end_time + FROM invasions + WHERE id = {$current_invasion_id} ", true ); - // Fetch quest date. - $quest = $rs->fetch_assoc(); - - // Get quest date and todays date. - $questdate = $quest['quest_date']; - $today = $quest['today']; - $unix_questdate = $quest['ts_questdate']; - $unix_today = $quest['ts_today']; - - // Write unix timestamps and dates to log. - cleanup_log('Unix timestamps:'); - cleanup_log('Today: ' . $unix_today); - cleanup_log('Quest date: ' . $unix_questdate); - cleanup_log('Today: ' . $today); - cleanup_log('Quest date: ' . $questdate); - } + // Fetch invasion date. + $invasion = $rs->fetch_assoc(); - // Time for telegram cleanup? - if ($unix_today > $unix_questdate) { - // Delete quest telegram message if not already deleted - if ($telegram == 1 && $row['chat_id'] != 0 && $row['message_id'] != 0) { - // Delete telegram message. - cleanup_log('Deleting telegram message ' . $row['message_id'] . ' from chat ' . $row['chat_id'] . ' for quest ' . $row['quest_id']); - delete_message($row['chat_id'], $row['message_id']); - // Set database values of chat_id and message_id to 0 so we know telegram message was deleted already. - cleanup_log('Updating telegram cleanup information.'); + // No invasion found - set cleanup to 0 and continue with next invasion + if (!$invasion) { + cleanup_log('No invasion found with ID: ' . $current_invasion_id, '!'); + cleanup_log('Updating cleanup information.'); my_query( " UPDATE qleanup @@ -2191,236 +3404,411 @@ function run_quests_cleanup ($telegram = 2, $database = 2) { WHERE id = {$row['id']} ", true ); + + // Continue with next invasion + continue; + } + + // Get invasion data only when invasion_id changed compared to previous run + if ($prev_invasion_id != $current_invasion_id) { + // Now. + $now = utcnow('YmdHis'); + $log_now = utcnow(); + + // Set cleanup time for telegram. + $cleanup_time_tg = new DateTimeImmutable($invasion['end_time'], new DateTimeZone('UTC')); + $cleanup_time_tg = $cleanup_time_tg->add(new DateInterval("PT".CLEANUP_INVASION_TIME_TG."M")); + $clean_tg = $cleanup_time_tg->format('YmdHis'); + $log_clean_tg = $cleanup_time_tg->format('Y-m-d H:i:s'); + + // Set cleanup time for database. + $cleanup_time_db = new DateTimeImmutable($invasion['end_time'], new DateTimeZone('UTC')); + $cleanup_time_db = $cleanup_time_db->add(new DateInterval("PT".CLEANUP_INVASION_TIME_DB."M")); + $clean_db = $cleanup_time_db->format('YmdHis'); + $log_clean_db = $cleanup_time_db->format('Y-m-d H:i:s'); + + // Write times to log. + cleanup_log($log_now, 'Current UTC time:'); + cleanup_log($invasion['end_time'], 'Invasion UTC end time:'); + cleanup_log($log_clean_tg, 'Telegram UTC cleanup time:'); + cleanup_log($log_clean_db, 'Database UTC cleanup time:'); + } + + // Time for telegram cleanup? + if ($clean_tg < $now) { + // Delete telegram message if not already deleted + if ($telegram == 1 && $row['chat_id'] != 0 && $row['message_id'] != 0) { + // Delete telegram message. + cleanup_log('Deleting telegram message ' . $row['message_id'] . ' from chat ' . $row['chat_id'] . ' for invasion ' . $row['quest_id']); + delete_message($row['chat_id'], $row['message_id']); + // Set database values of chat_id and message_id to 0 so we know telegram message was deleted already. + cleanup_log('Updating telegram cleanup information.'); + my_query( + " + UPDATE qleanup + SET chat_id = 0, + message_id = 0 + WHERE id = {$row['id']} + ", true + ); + } else { + if ($telegram == 1) { + cleanup_log('Telegram message is already deleted!'); + } else { + cleanup_log('Telegram cleanup was not triggered! Skipping...'); + } + } } else { - if ($telegram == 1) { - cleanup_log('Telegram message is already deleted!'); + cleanup_log('Skipping cleanup of telegram for this invasion! Cleanup time has not yet come...'); + } + + // Time for database cleanup? + if ($clean_db < $now) { + // Delete invasion from invasions table. + // Make sure to delete only once - invasion may be in multiple channels/supergroups, but only 1 time in database + if (($database == 1) && $row['quest_id'] != 0 && ($prev_invasion_id != $current_invasion_id)) { + // Delete invasion from invasions table. + cleanup_log('Deleting invasion ' . $current_invasion_id); + my_query( + " + DELETE FROM invasions + WHERE id = {$current_invasion_id} + ", true + ); + + // Set database value of quest_id to 0 so we know info was deleted already + // Use quest_id in where clause since the same quest_id can in cleanup more than once + cleanup_log('Updating database cleanup information.'); + my_query( + " + UPDATE qleanup + SET quest_id = 0, + cleaned = {$row['quest_id']} + WHERE quest_id = {$row['quest_id']} + ", true + ); } else { - cleanup_log('Telegram cleanup was not triggered! Skipping...'); + if ($database == 1) { + cleanup_log('Invasion is already deleted!'); + } else { + cleanup_log('Invasion cleanup was not triggered! Skipping...'); + } } + + // Delete invasion from cleanup table once every value is set to 0 and cleaned got updated from 0 to the quest_id + // In addition trigger deletion only when previous and current quest_id are different to avoid unnecessary sql queries + if ($row['quest_id'] == 0 && $row['chat_id'] == 0 && $row['message_id'] == 0 && $row['cleaned'] != 0 && ($prev_invasion_id != $current_invasion_id)) { + // Get all cleanup jobs which will be deleted now. + cleanup_log('Removing cleanup info from database:'); + $rs_cl = my_query( + " + SELECT * + FROM qleanup + WHERE cleaned = {$row['cleaned']} + ", true + ); + + // Log each cleanup ID which will be deleted. + while($rs_cleanups = $rs_cl->fetch_assoc()) { + cleanup_log('Cleanup ID: ' . $rs_cleanups['id'] . ', Former Invasion ID: ' . $rs_cleanups['cleaned']); + } + + // Finally delete from cleanup table. + my_query( + " + DELETE FROM qleanup + WHERE cleaned = {$row['cleaned']} + ", true + ); + } else { + if ($prev_invasion_id != $current_invasion_id) { + cleanup_log('Time for complete removal of invasion from database has not yet come.'); + } else { + cleanup_log('Complete removal of invasion from database was already done!'); + } + } + } else { + cleanup_log('Skipping cleanup of database for this invasion! Cleanup time has not yet come...'); } - } else { - cleanup_log('Skipping cleanup of telegram for this quest! Cleanup time has not yet come...'); - } - // Time for database cleanup? - if ($unix_today > $unix_questdate) { - // Delete quest from quests table. - // Make sure to delete only once - quest may be in multiple channels/supergroups, but only 1 time in database - if (($database == 1) && $row['quest_id'] != 0 && ($prev_quest_id != $current_quest_id)) { - // Delete quest from quest table. - cleanup_log('Deleting quest ' . $current_quest_id); - my_query( + // Quest + } else { + // Make sure quest exists + $rs = my_query( " - DELETE FROM quests - WHERE id = {$row['id']} + SELECT quest_date + FROM quests + WHERE id = {$current_quest_id} ", true - ); + ); + + // Fetch quest date. + $quest = $rs->fetch_assoc(); - // Set database value of quest_id to 0 so we know info was deleted already - // Use quest_id in where clause since the same quest_id can in cleanup more than once - cleanup_log('Updating database cleanup information.'); + // No quest found - set cleanup to 0 and continue with next quest + if (!$quest) { + cleanup_log('No quest found with ID: ' . $current_quest_id, '!'); + cleanup_log('Updating cleanup information.'); my_query( " UPDATE qleanup - SET quest_id = 0, - cleaned = {$row['quest_id']} - WHERE quest_id = {$row['quest_id']} + SET chat_id = 0, + message_id = 0 + WHERE id = {$row['id']} ", true ); - } else { - if ($database == 1) { - cleanup_log('Quest is already deleted!'); + + // Continue with next quest + continue; + } + + // Get quest data only when quest_id changed compared to previous run + if ($prev_quest_id != $current_quest_id) { + // Today. + $today = dt2time('now', 'Ymd'); + $log_today = dt2time('now', 'Y-m-d'); + + // Get quest date. + $questdate = dt2time($quest['quest_date'], 'Ymd'); + $log_questdate = dt2date($quest['quest_date']); + + // Write times to log. + cleanup_log($log_today, 'Current date:'); + cleanup_log($log_questdate, 'Quest date:'); + } + + // Time for telegram cleanup? + if ($today > $questdate) { + // Delete quest telegram message if not already deleted + if ($telegram == 1 && $row['chat_id'] != 0 && $row['message_id'] != 0) { + // Delete telegram message. + cleanup_log('Deleting telegram message ' . $row['message_id'] . ' from chat ' . $row['chat_id'] . ' for quest ' . $row['quest_id']); + delete_message($row['chat_id'], $row['message_id']); + // Set database values of chat_id and message_id to 0 so we know telegram message was deleted already. + cleanup_log('Updating telegram cleanup information.'); + my_query( + " + UPDATE qleanup + SET chat_id = 0, + message_id = 0 + WHERE id = {$row['id']} + ", true + ); } else { - cleanup_log('Quest cleanup was not triggered! Skipping...'); + if ($telegram == 1) { + cleanup_log('Telegram message is already deleted!'); + } else { + cleanup_log('Telegram cleanup was not triggered! Skipping...'); + } } + } else { + cleanup_log('Skipping cleanup of telegram for this quest! Cleanup time has not yet come...'); } - // Delete quest from cleanup table once every value is set to 0 and cleaned got updated from 0 to the quest_id - // In addition trigger deletion only when previous and current quest_id are different to avoid unnecessary sql queries - if ($row['quest_id'] == 0 && $row['chat_id'] == 0 && $row['message_id'] == 0 && $row['cleaned'] != 0 && ($prev_quest_id != $current_quest_id)) { - // Get all cleanup jobs which will be deleted now. - cleanup_log('Removing cleanup info from database:'); - $rs_cl = my_query( - " - SELECT * - FROM qleanup - WHERE cleaned = {$row['cleaned']} - ", true - ); - - // Log each cleanup ID which will be deleted. - while($rs_cleanups = $rs_cl->fetch_assoc()) { - cleanup_log('Cleanup ID: ' . $rs_cleanups['id'] . ', Former Quest ID: ' . $rs_cleanups['cleaned']); + // Time for database cleanup? + if ($today > $questdate) { + // Delete quest from quests table. + // Make sure to delete only once - quest may be in multiple channels/supergroups, but only 1 time in database + if (($database == 1) && $row['quest_id'] != 0 && ($prev_quest_id != $current_quest_id)) { + // Delete quest from quest table. + cleanup_log('Deleting quest ' . $current_quest_id); + my_query( + " + DELETE FROM quests + WHERE id = {$row['quest_id']} + ", true + ); + + // Set database value of quest_id to 0 so we know info was deleted already + // Use quest_id in where clause since the same quest_id can in cleanup more than once + cleanup_log('Updating database cleanup information.'); + my_query( + " + UPDATE qleanup + SET quest_id = 0, + cleaned = {$row['quest_id']} + WHERE quest_id = {$row['quest_id']} + ", true + ); + } else { + if ($database == 1) { + cleanup_log('Quest is already deleted!'); + } else { + cleanup_log('Quest cleanup was not triggered! Skipping...'); + } } - // Finally delete from cleanup table. - my_query( - " - DELETE FROM qleanup - WHERE cleaned = {$row['cleaned']} - ", true - ); - } else { - if ($prev_quest_id != $current_quest_id) { - cleanup_log('Time for complete removal of quest from database has not yet come.'); + // Delete quest from cleanup table once every value is set to 0 and cleaned got updated from 0 to the quest_id + // In addition trigger deletion only when previous and current quest_id are different to avoid unnecessary sql queries + if ($row['quest_id'] == 0 && $row['chat_id'] == 0 && $row['message_id'] == 0 && $row['cleaned'] != 0 && ($prev_quest_id != $current_quest_id)) { + // Get all cleanup jobs which will be deleted now. + cleanup_log('Removing cleanup info from database:'); + $rs_cl = my_query( + " + SELECT * + FROM qleanup + WHERE cleaned = {$row['cleaned']} + ", true + ); + + // Log each cleanup ID which will be deleted. + while($rs_cleanups = $rs_cl->fetch_assoc()) { + cleanup_log('Cleanup ID: ' . $rs_cleanups['id'] . ', Former Quest ID: ' . $rs_cleanups['cleaned']); + } + + // Finally delete from cleanup table. + my_query( + " + DELETE FROM qleanup + WHERE cleaned = {$row['cleaned']} + ", true + ); } else { - cleanup_log('Complete removal of quest from database was already done!'); + if ($prev_quest_id != $current_quest_id) { + cleanup_log('Time for complete removal of quest from database has not yet come.'); + } else { + cleanup_log('Complete removal of quest from database was already done!'); + } } + } else { + cleanup_log('Skipping cleanup of database for this quest! Cleanup time has not yet come...'); } - } else { - cleanup_log('Skipping cleanup of database for this quest! Cleanup time has not yet come...'); } // Store current quest id as previous id for next loop $prev_quest_id = $current_quest_id; } + // Write to log. cleanup_log('Finished with cleanup process!'); } } /** - * Get user language. - * @param $language_code - * @return string + * Inline search list. + * @param $update */ -function get_user_language($language_code) +function inline_list($update) { - $languages = $GLOBALS['languages']; + // Init quest id. + $in_id = 0; - // Get languages from normal translation. - if(array_key_exists($language_code, $languages)) { - $userlanguage = $languages[$language_code]; - } else { - $userlanguage = 'EN'; + // Botname:quest_id or Botname:-invasion_id received? + if (substr_count($update['inline_query']['query'], ':') == 1) { + // Botname: received, is there a quest_id / -invasion_id after : or not? + if(strlen(explode(':', $update['inline_query']['query'])[1]) != 0) { + // Invasion / Quest ID. + $in_id = explode(':', $update['inline_query']['query'])[1]; + } } - debug_log('User language: ' . $userlanguage); - - return $userlanguage; + // Quest or Invasion? + if(substr($in_id, 0, 1) === "-") { + // Invasion + debug_log('Inline request for invasion received. Invasion ID: ' . $in_id); + invasion_list($update, intval(abs($in_id))); + } else { + // Quest + debug_log('Inline request for quest received. Quest ID: ' . $in_id); + quest_list($update, intval($in_id)); + } } /** - * Update user. + * Quest list. * @param $update - * @return bool|mysqli_result + * @param $iqq */ -function update_user($update) +function quest_list($update, $iqq) { - global $db; - - $name = ''; - $nick = ''; - $sep = ''; - - if (isset($update['message']['from'])) { - $msg = $update['message']['from']; - } - - if (isset($update['callback_query']['from'])) { - $msg = $update['callback_query']['from']; - } + // Init empty rows array and query type. + $rows = []; - if (isset($update['inline_query']['from'])) { - $msg = $update['inline_query']['from']; - } + // Inline list quests. + if ($iqq != 0) { - if (!empty($msg['id'])) { - $id = $msg['id']; + // Quest by ID. + $request = my_query( + " + SELECT *, + id AS iqq_quest_id + FROM quests + WHERE id = {$iqq} + AND quest_date > UTC_DATE() + AND quest_date < UTC_DATE() + INTERVAL 1 DAY + " + ); + while ($answer = $request->fetch_assoc()) { + $rows[] = $answer; + } } else { - debug_log('No id', '!'); - debug_log($update, '!'); - return false; - } - - if ($msg['first_name']) { - $name = $msg['first_name']; - $sep = ' '; - } - - if (isset($msg['last_name'])) { - $name .= $sep . $msg['last_name']; - } + // Get quest data by user. + $request = my_query( + " + SELECT *, + quests.id AS iqq_quest_id + FROM quests + WHERE user_id = {$update['inline_query']['from']['id']} + AND quest_date > UTC_DATE() + AND quest_date < UTC_DATE() + INTERVAL 1 DAY + ORDER BY id DESC LIMIT 3 + " + ); - if (isset($msg['username'])) { - $nick = $msg['username']; + while ($answer_quests = $request->fetch_assoc()) { + $rows[] = $answer_quests; + } } - // Create or update the user. - $request = my_query( - " - INSERT INTO users - SET user_id = {$id}, - nick = '{$db->real_escape_string($nick)}', - name = '{$db->real_escape_string($name)}' - ON DUPLICATE KEY - UPDATE nick = '{$db->real_escape_string($nick)}', - name = '{$db->real_escape_string($name)}' - " - ); + // Init array. + $contents = array(); - return $request; -} + // For each rows. + foreach ($rows as $key => $row) { + // Get the quest. + $quest = get_quest($row['iqq_quest_id']); -/** - * Convert unix timestamp to time string by timezone settings. - * @param $unix - * @param $tz - * @param string $format - * @return bool|string - */ -function unix2tz($unix, $tz, $format = 'H:i') -{ - // Unix timestamp is required. - if (!empty($unix)) { - // Create dateTime object. - $dt = new DateTime('@' . $unix); + // Set the text. + $contents[$key]['text'] = get_formatted_quest($quest, true, true, false, true); - // Set the timezone. - $dt->setTimeZone(new DateTimeZone($tz)); + // Set the title. + $contents[$key]['title'] = $quest['pokestop_name']; - // Return formatted time. - return $dt->format($format); + // Set the inline keyboard. + $contents[$key]['keyboard'] = []; - } else { - return false; + // Set the description. + $contents[$key]['desc'] = get_formatted_quest($quest, false, false, true, true); } + + debug_log($contents); + answerInlineQuery($update['inline_query']['id'], $contents); } + /** - * Quest list. + * Invasion list. * @param $update + * @param $ivq */ -function quest_list($update) +function invasion_list($update, $ivq) { // Init empty rows array and query type. $rows = []; - // Init quest id. - $iqq = 0; - - // Botname:quest_id received? - if (substr_count($update['inline_query']['query'], ':') == 1) { - // Botname: received, is there a quest_id after : or not? - if(strlen(explode(':', $update['inline_query']['query'])[1]) != 0) { - // Quest ID. - $iqq = intval(explode(':', $update['inline_query']['query'])[1]); - } - } - - // Inline list quests. - if ($iqq != 0) { + // Inline list invasions. + if ($ivq != 0) { // Quest by ID. $request = my_query( " SELECT *, - id AS iqq_quest_id - FROM quests - WHERE id = {$iqq} - AND quest_date = CURDATE() + id AS ivq_invasion_id + FROM invasions + WHERE id = {$ivq} + AND end_time > UTC_TIMESTAMP() " ); @@ -2432,18 +3820,110 @@ function quest_list($update) $request = my_query( " SELECT *, - quests.id AS iqq_quest_id - FROM quests + invasions.id AS ivq_invasion_id + FROM invasions WHERE user_id = {$update['inline_query']['from']['id']} - ORDER BY id DESC LIMIT 2 + AND end_time > UTC_TIMESTAMP() + ORDER BY id DESC LIMIT 3 " ); - while ($answer_quests = $request->fetch_assoc()) { - $rows[] = $answer_quests; + while ($answer_invasions = $request->fetch_assoc()) { + $rows[] = $answer_invasions; } } - debug_log($rows); - answerInlineQuery($update['inline_query']['id'], $rows); + // Init array. + $contents = array(); + + // For each rows. + foreach ($rows as $key => $row) { + // Get the quest. + $invasion = get_invasion($row['ivq_invasion_id']); + + // Set the text. + $contents[$key]['text'] = get_formatted_invasion($invasion, true, true, false, true); + + // Set the title. + $contents[$key]['title'] = $invasion['pokestop_name']; + + // Set the inline keyboard. + $contents[$key]['keyboard'] = []; + + // Set the description. + $contents[$key]['desc'] = get_formatted_invasion($invasion, false, false, true, true, true); + } + + debug_log($contents); + answerInlineQuery($update['inline_query']['id'], $contents); +} + +/** + * Process response from telegram api. + * @param $json + * @param $json_response + * @return mixed + */ +function curl_json_response($json_response, $json) +{ + // Write to log. + debug_log($json_response, '<-'); + + // Decode json response. + $response = json_decode($json_response, true); + + // Validate response. + if ($response['ok'] != true || isset($response['update_id'])) { + // Write error to log. + debug_log('ERROR: ' . $json . "\n\n" . $json_response . "\n\n"); + } else { + // Result seems ok, get message_id and chat_id if supergroup or channel message + if (isset($response['result']['chat']['type']) && ($response['result']['chat']['type'] == "channel" || $response['result']['chat']['type'] == "supergroup")) { + // Init cleanup_id + $cleanup_id = 0; + + // Set chat and message_id + $chat_id = $response['result']['chat']['id']; + $message_id = $response['result']['message_id']; + + // Get raid/quest id from $json + $json_message = json_decode($json, true); + + // Write to log that message was shared with channel or supergroup + debug_log('Message was shared with ' . $response['result']['chat']['type'] . ' ' . $response['result']['chat']['title']); + debug_log('Checking input for cleanup info now...'); + + // Check if it's a venue and get quest id + if (!empty($response['result']['venue']['address'])) { + // Get raid_id or quest_id from address. + $cleanup_id = substr(strrchr($response['result']['venue']['address'], substr(strtoupper(BOT_ID), 0, 1) . '-ID = '), 7); + + // Check if it's a text and get quest id + } else if (!empty($response['result']['text'])) { + $cleanup_id = substr(strrchr($response['result']['text'], substr(strtoupper(BOT_ID), 0, 1) . '-ID = '), 7); + } + + // Trigger Cleanup when quest id was found + if($cleanup_id != 0) { + debug_log('Found ID for cleanup preparation from callback_data or venue!'); + debug_log('Cleanup ID: ' . $cleanup_id); + debug_log('Chat_ID: ' . $chat_id); + debug_log('Message_ID: ' . $message_id); + + // Trigger cleanup preparation process when necessary id's are not empty and numeric + if (!empty($chat_id) && !empty($message_id) && !empty($cleanup_id)) { + debug_log('Calling cleanup preparation now!'); + insert_cleanup($chat_id, $message_id, $cleanup_id); + } else { + debug_log('Missing input! Cannot call cleanup preparation!'); + } + } else { + debug_log('No cleanup info found! Skipping cleanup preparation!'); + } + } + } + + // Return response. + return $response; } + diff --git a/mods/crypto.php b/mods/crypto.php new file mode 100644 index 0000000..798878f --- /dev/null +++ b/mods/crypto.php @@ -0,0 +1,66 @@ +' . getTranslation('invasion_saved') . '' . CR . CR; +$invasion = get_invasion($id); +$msg .= get_formatted_invasion($invasion, false, false, true); + +// Build callback message string. +$callback_response = 'OK'; + +// Telegram JSON array. +$tg_json = array(); + +// Answer callback. +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Edit message. +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); + +// Get invasion messages to be updated from cleanup. +$rs = my_query( + " + SELECT * + FROM qleanup + WHERE quest_id = '-{$id}' + " +); + +// Get updated invasion message. +$updated_msg = get_formatted_invasion($invasion, true, true, false, true);; +$updated_keys = []; + +// Update the shared raid polls. +while ($invasionmsg = $rs->fetch_assoc()) { + $tg_json[] = editMessageText($invasionmsg['message_id'], $updated_msg, $updated_keys, $invasionmsg['chat_id'], ['disable_web_page_preview' => 'true'], true); +} + +// Telegram multicurl request. +curl_json_multi_request($tg_json); + +// Exit. +exit(); diff --git a/mods/exit.php b/mods/exit.php index 1d0462f..971e07d 100644 --- a/mods/exit.php +++ b/mods/exit.php @@ -12,10 +12,16 @@ // Build message string. $msg = ($data['arg'] == 1) ? (getTranslation('done') . '!') : (getTranslation('action_aborted')); +// Telegram JSON array. +$tg_json = array(); + // Edit the message. -edit_message($update, $msg, $keys); +$tg_json[] = edit_message($update, $msg, $keys, false, true); // Answer callback. -answerCallbackQuery($update['callback_query']['id'], $msg); +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $msg, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); exit(); diff --git a/mods/geo.php b/mods/geo.php new file mode 100644 index 0000000..5ebee43 --- /dev/null +++ b/mods/geo.php @@ -0,0 +1,64 @@ +' . getTranslation('quest') . SP . getTranslation('or') . SP . getTranslation('invasion') . ' — ' . getTranslation('select_action'); +} else { + // Set message. + $msg = getTranslation('invalid_input'); + sendMessage($update['message']['chat']['id'], $msg); + exit(); +} + +// Init empty keys array. +$keys = []; + +// Create keys array. +$keys = [ + [ + [ + 'text' => getTranslation('quest'), + 'callback_data' => '0:quest_geo:' . $coords + ], + [ + 'text' => getTranslation('invasion'), + 'callback_data' => '0:invasion_geo:' . $coords + ] + ] +]; + +// Add navigation keys. +$nav_keys = []; +$nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + +// Get the inline key array. +$keys[] = $nav_keys; + +// Send message. +send_message($update['message']['chat']['id'], $msg, $keys, ['reply_markup' => ['selective' => true, 'one_time_keyboard' => true]]); + +exit(); diff --git a/mods/importal.php b/mods/importal.php new file mode 100644 index 0000000..dd72375 --- /dev/null +++ b/mods/importal.php @@ -0,0 +1,108 @@ +fetch_row(); + + // Pokestop already in database or new + if (empty($row['0'])) { + // insert pokestop in table. + debug_log('Pokestop not found in database pokestop list! Inserting pokestop "' . $pokestop_name . '" now.'); + $query = ' + INSERT INTO pokestops (pokestop_name, lat, lon, address) + VALUES (:pokestop_name, :lat, :lon, :address) + '; + $msg = getTranslation('pokestop_added'); + + } else { + // Update pokestops table to reflect pokestop changes. + debug_log('Pokestop found in database pokestop list! Updating pokestop "' . $pokestop_name . '" now.'); + $query = ' + UPDATE pokestops + SET lat = :lat, + lon = :lon, + address = :address + WHERE pokestop_name = :pokestop_name + '; + $msg = getTranslation('pokestop_updated'); + $pokestop_id = get_pokestop_by_telegram_id($pokestop_name); + $pokestop_id = $pokestop_id['id']; + } + + // Insert / Update. + $statement = $dbh->prepare($query); + $statement->bindValue(':pokestop_name', $pokestop_name, PDO::PARAM_STR); + $statement->bindValue(':lat', $lat, PDO::PARAM_STR); + $statement->bindValue(':lon', $lon, PDO::PARAM_STR); + $statement->bindValue(':address', $address, PDO::PARAM_STR); + $statement->execute(); + } catch (PDOException $exception) { + error_log($exception->getMessage()); + $dbh = null; + exit(); + } + + // Get last insert id. + if (empty($row['0'])) { + $pokestop_id = $dbh->lastInsertId(); + } + + // Pokestop details. + if($pokestop_id > 0) { + $pokestop = get_pokestop($pokestop_id); + $msg .= CR . CR . get_pokestop_details($pokestop); + } + + // Set keys. + $keys = [ + [ + [ + 'text' => getTranslation('delete'), + 'callback_data' => $pokestop_id . ':stop_delete:0' + ], + [ + 'text' => getTranslation('done'), + 'callback_data' => '0:exit:1' + ] + ] + ]; +} else { + $msg = getTranslation('bot_access_denied'); + $keys = []; +} + +// Send the message. +send_message($update['message']['chat']['id'], $msg, $keys, ['disable_web_page_preview' => 'true']); + +?> diff --git a/mods/invasion_create.php b/mods/invasion_create.php new file mode 100644 index 0000000..9cb28ce --- /dev/null +++ b/mods/invasion_create.php @@ -0,0 +1,98 @@ +' . $stop['pokestop_name'] . '' . (!empty($stop['address']) ? (CR . $stop['address']) : ''); + $msg .= CR . CR . '' . getTranslation('invasion_select_time') . ''; + + // Invasion event to short in 5 minute steps as duration + if(INVASION_DURATION_EVENT > INVASION_DURATION_LONG) { + $slotmax = INVASION_DURATION_EVENT; + $slotsize = 5; + + // Create the keys. + for ($i = $slotmax; $i >= INVASION_DURATION_SHORT; $i = $i - $slotsize) { + $keys[] = array( + // Just show the time, no text - not everyone has a phone or tablet with a large screen... + 'text' => floor($i / 60) . ':' . str_pad($i % 60, 2, '0', STR_PAD_LEFT), + 'callback_data' => $pokestop_id . ':invasion_save:' . $i + ); + } + + $keys = inline_key_array($keys, 5); + $keys = universal_key($keys, '0', 'exit', '0', getTranslation('abort')); + //$keys = array_merge($keys,$keys_exit); + + // Duration short and long as selection + } else { + // Create the keys. + $keys = [ + [ + [ + 'text' => INVASION_DURATION_SHORT . 'min', + 'callback_data' => $pokestop_id . ':invasion_save:' . INVASION_DURATION_SHORT + ], + [ + 'text' => INVASION_DURATION_LONG . 'min', + 'callback_data' => $pokestop_id . ':invasion_save:' . INVASION_DURATION_LONG + ] + ], + [ + [ + 'text' => getTranslation('abort'), + 'callback_data' => '0:exit:0' + ] + ] + ]; + } + +} else { + // Invasion already in the database for this pokestop. + $msg = EMOJI_WARN . ' ' . getTranslation('invasion_already_submitted') . ' ' . EMOJI_WARN . CR . CR; + $invasion = get_invasion($invasion_in_db['id']); + $invasion_id = $invasion_in_db['id']; + $keys_delete = universal_key($keys, $invasion_id, 'invasion_delete', '0', getTranslation('delete')); + $keys_exit = universal_key($keys, '0', 'exit', '0', getTranslation('abort')); + $msg .= get_formatted_invasion($invasion); + + // Empty keys. + $keys = array_merge($keys_delete,$keys_exit); +} + +// Telegram JSON array. +$tg_json = array(); + +// Build callback message string. +$callback_response = 'OK'; + +// Answer callback. +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Edit the message. +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); + +exit(); diff --git a/mods/invasion_delete.php b/mods/invasion_delete.php new file mode 100644 index 0000000..75bf180 --- /dev/null +++ b/mods/invasion_delete.php @@ -0,0 +1,74 @@ + getTranslation('yes'), + 'callback_data' => $invasion_id . ':invasion_delete:' . '2' + ], + [ + 'text' => getTranslation('no'), + 'callback_data' => $invasion_id . ':invasion_delete:' . '1' + ] + ] + ]; + + // Set message. + $msg = EMOJI_WARN . ' ' . getTranslation('delete_this_invasion') . ' ' . EMOJI_WARN . CR . CR; + $invasion = get_invasion($invasion_id); + $msg .= get_formatted_invasion($invasion, false, false, true); +} else if ($action == 1) { + debug_log('Invasion deletion for invasion ID ' . $invasion_id . ' was canceled!'); + // Set message. + $msg = '' . getTranslation('action_aborted') . ''; + + // Set keys. + $keys = []; +} else if ($action == 2) { + debug_log('Confirmation to delete invasion ' . $invasion_id . ' was received!'); + // Set message. + $msg = getTranslation('invasion_successfully_deleted'); + + // Set keys. + $keys = []; + + // Delete invasion. + delete_invasion($invasion_id); +} + +// Telegram JSON array. +$tg_json = array(); + +// Edit message. +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); + +// Build callback message string. +$callback_response = 'OK'; + +// Answer callback. +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); + +exit(); diff --git a/mods/invasion_edit.php b/mods/invasion_edit.php new file mode 100644 index 0000000..661049f --- /dev/null +++ b/mods/invasion_edit.php @@ -0,0 +1,51 @@ +' . getTranslation('invasion') . ':' . CR . CR; +$invasion = get_invasion($invasion_id); +$msg .= get_formatted_invasion($invasion); + +// Telegram JSON array. +$tg_json = array(); + +// Edit message. +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); + +// Build callback message string. +$callback_response = 'OK'; + +// Answer callback. +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); + +exit(); diff --git a/mods/invasion_geo.php b/mods/invasion_geo.php new file mode 100644 index 0000000..d1ea3f3 --- /dev/null +++ b/mods/invasion_geo.php @@ -0,0 +1,80 @@ +' . getTranslation('invasion_by_pokestop') . ''; + + // Add back navigation key. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; +} else { + // Set message. + $msg = '' . getTranslation('pokestops_not_found') . ''; + + // Set empty keys. + $keys = []; +} + +// Answer callback or send message based on input prior invasion creation +if(empty($update['message']['location']['latitude']) && empty($update['message']['location']['longitude'])) { + // Telegram JSON array. + $tg_json = array(); + + // Edit the message. + $tg_json[] = edit_message($update, $msg, $keys, false, true); + + // Build callback message string. + $callback_response = 'OK'; + + // Answer callback. + $tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + + // Telegram multicurl request. + curl_json_multi_request($tg_json); + +} else { + // Send message. + send_message($update['message']['chat']['id'], $msg, $keys); +} + +exit(); diff --git a/mods/invasion_save.php b/mods/invasion_save.php new file mode 100644 index 0000000..37be65f --- /dev/null +++ b/mods/invasion_save.php @@ -0,0 +1,83 @@ +' . getTranslation('invasion_saved') . '' . CR . CR; + $invasion = get_invasion($id); + $msg .= get_formatted_invasion($invasion, false, false, true); + $msg .= CR . CR . getTranslation('invasion_crypto_instructions'); + + // Init keys. + $keys = array(); + $keys_share = array(); + $keys_delete = array(); + + // Add keys to delete and share. + $keys_delete = universal_key($keys, $id, 'invasion_delete', '0', getTranslation('delete')); + $keys_share = share_keys($neg_id, 'invasion_share', $update, SHARE_INVASIONS); + $keys = array_merge($keys_delete, $keys_share); +} else { + // Invasion already in the database for this pokestop. + $msg = EMOJI_WARN . ' ' . getTranslation('invasion_already_submitted') . ' ' . EMOJI_WARN . CR . CR; + $invasion = get_invasion($invasion_in_db['id']); + $msg .= get_formatted_invasion($invasion); + + // Empty keys. + $keys = []; +} +// Telegram JSON array. +$tg_json = array(); + +// Edit message. +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); + +// Build callback message string. +$callback_response = 'OK'; + +// Answer callback. +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); + +exit(); diff --git a/mods/invasion_share.php b/mods/invasion_share.php new file mode 100644 index 0000000..59f37c8 --- /dev/null +++ b/mods/invasion_share.php @@ -0,0 +1,57 @@ + NEEDED FOR CLEANUP PREPARATION! + $loc = send_venue($chat, $invasion['lat'], $invasion['lon'], $msg_header, $msg_text); + + // Write to log. + debug_log('location:'); + debug_log($loc); +} + +// Telegram JSON array. +$tg_json = array(); + +// Send the message. +$tg_json[] = send_message($chat, $text, $keys, ['reply_to_message_id' => $chat, 'disable_web_page_preview' => 'true'], true); + +// Set callback keys and message +$callback_msg = getTranslation('successfully_shared'); +$callback_msg .= CR . CR . getTranslation('invasion_crypto_instructions'); +$callback_keys = []; + +// Edit message. +$tg_json[] = edit_message($update, $callback_msg, $callback_keys, false, true); + +// Answer callback. +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_msg, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); + +exit(); diff --git a/mods/mods.php b/mods/mods.php deleted file mode 100644 index 24cbd90..0000000 --- a/mods/mods.php +++ /dev/null @@ -1,54 +0,0 @@ -' . getTranslation('mods_saved_mod') . '' . CR . CR; - $msg .= get_user($user_id); - - // Build callback message string. - $callback_response = getTranslation('mods_saved_mod'); - - // Answer callback. - answerCallbackQuery($update['callback_query']['id'], $callback_response); - - // Create the keys. - $keys = []; - - // Edit message. - edit_message($update, $msg, $keys, false); -} - -exit(); diff --git a/mods/mods_delete.php b/mods/mods_delete.php deleted file mode 100644 index 0e889cc..0000000 --- a/mods/mods_delete.php +++ /dev/null @@ -1,42 +0,0 @@ -' . getTranslation('mods_delete_mod') . '' . CR; - $msg .= get_user($user_id); - - // Create the keys. - $keys = []; - - // Build callback message string. - $callback_response = getTranslation('mods_delete_mod'); - - // Answer callback. - answerCallbackQuery($update['callback_query']['id'], $callback_response); - - // Edit message. - edit_message($update, $msg, $keys, false); - -} - -// Exit. -exit(); diff --git a/mods/mods_list.php b/mods/mods_list.php deleted file mode 100644 index 31cabee..0000000 --- a/mods/mods_list.php +++ /dev/null @@ -1,35 +0,0 @@ - 'true']); +// Telegram JSON array. +$tg_json = array(); // Build callback message string. $callback_response = 'OK'; // Answer callback. -answerCallbackQuery($update['callback_query']['id'], $callback_response); +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Edit the message. +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); exit(); diff --git a/mods/quest_delete.php b/mods/quest_delete.php index 58cb195..120d463 100644 --- a/mods/quest_delete.php +++ b/mods/quest_delete.php @@ -6,6 +6,9 @@ //debug_log($update); //debug_log($data); +// Access check. +quest_access_check($update, $data, 'delete'); + // Quest id. $quest_id = $data['id']; @@ -53,13 +56,19 @@ delete_quest($quest_id); } +// Telegram JSON array. +$tg_json = array(); + // Edit message. -edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true']); +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); // Build callback message string. $callback_response = 'OK'; // Answer callback. -answerCallbackQuery($update['callback_query']['id'], $callback_response); +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); exit(); diff --git a/mods/quest_edit.php b/mods/quest_edit.php index 6d04937..fd5ffb1 100644 --- a/mods/quest_edit.php +++ b/mods/quest_edit.php @@ -6,12 +6,12 @@ //debug_log($update); //debug_log($data); +// Check access. +bot_access_check($update, 'list'); + // Quest id. $quest_id = $data['id']; -// Set the user id. -$userid = $update['callback_query']['from']['id']; - // Init keys. $keys = array(); $keys_share = array(); @@ -19,7 +19,7 @@ // Add keys to delete and share. $keys_delete = universal_key($keys, $quest_id, 'quest_delete', '0', getTranslation('delete')); -$keys_share = share_quest_keys($quest_id, $userid); +$keys_share = share_keys($quest_id, 'quest_share', $update); $keys = array_merge($keys_delete, $keys_share); // Add abort navigation key. @@ -32,13 +32,19 @@ $quest = get_quest($quest_id); $msg .= get_formatted_quest($quest); +// Telegram JSON array. +$tg_json = array(); + // Edit message. -edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true']); +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); // Build callback message string. $callback_response = 'OK'; // Answer callback. -answerCallbackQuery($update['callback_query']['id'], $callback_response); +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); exit(); diff --git a/mods/quest_edit_qty_reward.php b/mods/quest_edit_qty_reward.php index 75c234d..aaed232 100644 --- a/mods/quest_edit_qty_reward.php +++ b/mods/quest_edit_qty_reward.php @@ -6,6 +6,9 @@ //debug_log($update); //debug_log($data); +// Check access. +bot_access_check($update, 'create'); + // Pokestop and quest id. $stop_quest = explode(",", $data['id']); $pokestop_id = $stop_quest[0]; @@ -16,15 +19,18 @@ $quest_type = $qr_types[0]; $reward_type = $qr_types[1]; +// Event data. +$event = explode('-', $quest_type); +$q_flag = $event[0]; +$q_event = $event[1]; +$q_type = $event[2]; + // Get pokestop and questlist data. $stop = get_pokestop($pokestop_id, false); $ql_entry = get_questlist_entry($quest_id); -// Quest action: Singular or plural? -$quest_action = explode(":", getTranslation('quest_action_' . $ql_entry['quest_action'])); -$quest_action_singular = $quest_action[0]; -$quest_action_plural = $quest_action[1]; -$qty_action = $ql_entry['quest_quantity'] . SP . (($ql_entry['quest_quantity'] > 1) ? ($quest_action_plural) : ($quest_action_singular)); +// Quest action +$qty_action = get_quest_action($ql_entry); // Reward - Always singular. $reward_type_text = explode(":", getTranslation('reward_type_' . $reward_type)); @@ -33,20 +39,31 @@ // Build message string. $msg = ''; $msg .= getTranslation('pokestop') . ': ' . $stop['pokestop_name'] . '' . (!empty($stop['address']) ? (CR . $stop['address']) : ''); -$msg .= CR . getTranslation('quest') . ': ' . getTranslation('quest_type_' . $quest_type) . SP . $qty_action . ''; -$msg .= CR . getTranslation('reward') . ': ' . $reward_type_singular . ''; +// Event? +if($q_event > 0) { + $msg .= CR . '' . getTranslation('quest_event_' . $q_event) . ':' . SP . getTranslation('quest_type_' . $q_type) . SP . $qty_action . ''; +} else { + $msg .= CR . getTranslation('quest') . ': ' . getTranslation('quest_type_' . $q_type) . SP . $qty_action . ''; +} +$msg .= CR . getTranslation('reward') . ': ' . ucfirst($reward_type_singular) . ''; $msg .= CR . CR . '' . getTranslation('reward_select_qty_reward') . ''; // Create the keys. $keys = reward_qty_type_keys($pokestop_id, $quest_id, $quest_type, $reward_type); +// Telegram JSON array. +$tg_json = array(); + // Edit message. -edit_message($update, $msg, $keys, false); +$tg_json[] = edit_message($update, $msg, $keys, false, true); // Build callback message string. $callback_response = 'OK'; // Answer callback. -answerCallbackQuery($update['callback_query']['id'], $callback_response); +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); exit(); diff --git a/mods/quest_edit_reward.php b/mods/quest_edit_reward.php index da5b593..60fbf45 100644 --- a/mods/quest_edit_reward.php +++ b/mods/quest_edit_reward.php @@ -6,6 +6,9 @@ //debug_log($update); //debug_log($data); +// Check access. +bot_access_check($update, 'create'); + // Pokestop id. $pokestop_id = $data['id']; @@ -14,32 +17,46 @@ $quest_id = $quest_id_type[0]; $quest_type = $quest_id_type[1]; +// Event data. +$event = explode('-', $quest_type); +$q_flag = $event[0]; +$q_event = $event[1]; +$q_type = $event[2]; + // Get pokestop and questlist data. $stop = get_pokestop($pokestop_id, false); $ql_entry = get_questlist_entry($quest_id); -// Quest action: Singular or plural? -$quest_action = explode(":", getTranslation('quest_action_' . $ql_entry['quest_action'])); -$quest_action_singular = $quest_action[0]; -$quest_action_plural = $quest_action[1]; -$qty_action = $ql_entry['quest_quantity'] . SP . (($ql_entry['quest_quantity'] > 1) ? ($quest_action_plural) : ($quest_action_singular)); +// Quest action +$qty_action = get_quest_action($ql_entry); // Build message string. $msg = ''; $msg .= getTranslation('pokestop') . ': ' . $stop['pokestop_name'] . '' . (!empty($stop['address']) ? (CR . $stop['address']) : ''); -$msg .= CR . getTranslation('quest') . ': ' . getTranslation('quest_type_' . $quest_type) . SP . $qty_action . ''; +// Event? +if($q_event > 0) { + $msg .= CR . '' . getTranslation('quest_event_' . $q_event) . ':' . SP . getTranslation('quest_type_' . $q_type) . SP . $qty_action . ''; +} else { + $msg .= CR . getTranslation('quest') . ': ' . getTranslation('quest_type_' . $q_type) . SP . $qty_action . ''; +} $msg .= CR . CR . '' . getTranslation('reward_select_type') . ''; // Create the keys. $keys = reward_type_keys($pokestop_id, $quest_id, $quest_type); +// Telegram JSON array. +$tg_json = array(); + // Edit message. -edit_message($update, $msg, $keys, false); +$tg_json[] = edit_message($update, $msg, $keys, false, true); // Build callback message string. $callback_response = 'OK'; // Answer callback. -answerCallbackQuery($update['callback_query']['id'], $callback_response); +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); exit(); diff --git a/mods/quest_edit_type.php b/mods/quest_edit_type.php index c7f429a..d1f7ac1 100644 --- a/mods/quest_edit_type.php +++ b/mods/quest_edit_type.php @@ -1,34 +1,78 @@ ' . $stop['pokestop_name'] . '' . (!empty($stop['address']) ? (CR . $stop['address']) : ''); + $msg .= CR . getTranslation('quest') . ': ' . getTranslation('quest_type_' . $quest_type) . '...'; + $msg .= CR . CR . '' . getTranslation('quest_select_type') . ''; + + // Create the keys. + $keys = quest_type_keys($pokestop_id); + +// Get type keys for event +} else if($quest_flag == 0 && $quest_event > 0) { + // Build message string. + $msg = ''; + $stop = get_pokestop($pokestop_id, false); + $msg .= getTranslation('pokestop') . ': ' . $stop['pokestop_name'] . '' . (!empty($stop['address']) ? (CR . $stop['address']) : ''); + $msg .= CR . '' . getTranslation('quest_event_' . $quest_event) . ':' . SP . getTranslation('quest_type_' . $quest_type) . '...'; + $msg .= CR . CR . '' . getTranslation('quest_select_type') . ''; -// Build message string. -$msg = ''; -$stop = get_pokestop($pokestop_id, false); -$msg .= getTranslation('pokestop') . ': ' . $stop['pokestop_name'] . '' . (!empty($stop['address']) ? (CR . $stop['address']) : ''); -$msg .= CR . getTranslation('quest') . ': ' . getTranslation('quest_type_' . $quest_type) . '...'; -$msg .= CR . CR . '' . getTranslation('quest_select_qty_action') . ''; + // Create the keys. + $keys = quest_type_keys($pokestop_id, $quest_event); -// Create the keys. -$keys = quest_qty_action_keys($pokestop_id, $quest_type); +// Get qty action keys +} else if($quest_flag == 1) { + // Build message string. + $msg = ''; + $stop = get_pokestop($pokestop_id, false); + $msg .= getTranslation('pokestop') . ': ' . $stop['pokestop_name'] . '' . (!empty($stop['address']) ? (CR . $stop['address']) : ''); + // Event? + if($quest_event > 0) { + $msg .= CR . '' . getTranslation('quest_event_' . $quest_event) . ':' . SP . getTranslation('quest_type_' . $quest_type) . '...'; + } else { + $msg .= CR . getTranslation('quest') . ': ' . getTranslation('quest_type_' . $quest_type) . '...'; + } + $msg .= CR . CR . '' . getTranslation('quest_select_qty_action') . ''; + + // Create the keys. + $keys = quest_qty_action_keys($pokestop_id, $quest_event, $quest_type); +} + +// Telegram JSON array. +$tg_json = array(); // Edit message. -edit_message($update, $msg, $keys, false); +$tg_json[] = edit_message($update, $msg, $keys, false, true); // Build callback message string. $callback_response = 'OK'; // Answer callback. -answerCallbackQuery($update['callback_query']['id'], $callback_response); +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); exit(); diff --git a/mods/quest_geo.php b/mods/quest_geo.php index 8c7b143..7888137 100644 --- a/mods/quest_geo.php +++ b/mods/quest_geo.php @@ -6,6 +6,9 @@ //debug_log($update); //debug_log($data); +// Access check. +bot_access_check($update, 'create'); + // Latitude and longitude $lat = ''; $lon = ''; @@ -37,6 +40,13 @@ if ($keys) { // Set message. $msg = '' . getTranslation('quest_by_pokestop') . ''; + + // Add back navigation key. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; } else { // Set message. $msg = '' . getTranslation('pokestops_not_found') . ''; @@ -47,14 +57,21 @@ // Answer callback or send message based on input prior raid creation if(empty($update['message']['location']['latitude']) && empty($update['message']['location']['longitude'])) { + // Telegram JSON array. + $tg_json = array(); + // Edit the message. - edit_message($update, $msg, $keys); + $tg_json[] = edit_message($update, $msg, $keys, false, true); // Build callback message string. $callback_response = 'OK'; // Answer callback. - answerCallbackQuery($update['callback_query']['id'], $callback_response); + $tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + + // Telegram multicurl request. + curl_json_multi_request($tg_json); + } else { // Send message. send_message($update['message']['chat']['id'], $msg, $keys); diff --git a/mods/quest_save.php b/mods/quest_save.php index 400431e..46e926b 100644 --- a/mods/quest_save.php +++ b/mods/quest_save.php @@ -6,8 +6,8 @@ //debug_log($update); //debug_log($data); -// Set the user id. -$userid = $update['callback_query']['from']['id']; +// Check access. +bot_access_check($update, 'create'); // Pokestop and quest id. $stop_quest = explode(",", $data['id']); @@ -29,7 +29,7 @@ " INSERT INTO quests SET user_id = {$update['callback_query']['from']['id']}, - quest_date = CURDATE(), + quest_date = UTC_TIMESTAMP(), pokestop_id = {$pokestop_id}, quest_id = {$quest_id}, reward_id = {$reward_id} @@ -53,25 +53,30 @@ // Add keys to delete and share. $keys_delete = universal_key($keys, $id, 'quest_delete', '0', getTranslation('delete')); - $keys_share = share_quest_keys($id, $userid); + $keys_share = share_keys($id, 'quest_share', $update); $keys = array_merge($keys_delete, $keys_share); } else { // Quest already in the database for this pokestop. $msg = EMOJI_WARN . ' ' . getTranslation('quest_already_submitted') . ' ' . EMOJI_WARN . CR . CR; - $quest = get_quest($answer['id']); + $quest = get_quest($quest_in_db['id']); $msg .= get_formatted_quest($quest); // Empty keys. $keys = []; } +// Telegram JSON array. +$tg_json = array(); // Edit message. -edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true']); +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); // Build callback message string. $callback_response = 'OK'; // Answer callback. -answerCallbackQuery($update['callback_query']['id'], $callback_response); +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); exit(); diff --git a/mods/quest_save_share.php b/mods/quest_save_share.php index e611a0c..fb6838f 100644 --- a/mods/quest_save_share.php +++ b/mods/quest_save_share.php @@ -6,6 +6,9 @@ //debug_log($update); //debug_log($data); +// Check access. +bot_access_check($update, 'create'); + // Set the user id. $userid = $update['callback_query']['from']['id']; @@ -29,7 +32,7 @@ " INSERT INTO quests SET user_id = {$update['callback_query']['from']['id']}, - quest_date = CURDATE(), + quest_date = UTC_TIMESTAMP(), pokestop_id = {$pokestop_id}, quest_id = {$quest_id}, reward_id = {$reward_id} @@ -86,17 +89,23 @@ } else { // Quest already in the database for this pokestop. $callback_msg = EMOJI_WARN . ' ' . getTranslation('quest_already_submitted') . ' ' . EMOJI_WARN . CR . CR; - $quest = get_quest($answer['id']); + $quest = get_quest($quest_in_db['id']); $callback_msg .= get_formatted_quest($quest); } // Set callback keys $callback_keys = []; +// Telegram JSON array. +$tg_json = array(); + // Edit message. -edit_message($update, $callback_msg, $callback_keys, ['disable_web_page_preview' => 'true']); +$tg_json[] = edit_message($update, $callback_msg, $callback_keys, ['disable_web_page_preview' => 'true'], true); // Answer callback. -answerCallbackQuery($update['callback_query']['id'], getTranslation('successfully_shared')); +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], getTranslation('successfully_shared'), true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); exit(); diff --git a/mods/quest_share.php b/mods/quest_share.php old mode 100755 new mode 100644 index 40f8ba5..ad6af60 --- a/mods/quest_share.php +++ b/mods/quest_share.php @@ -6,8 +6,8 @@ //debug_log($update); //debug_log($data); -// Check quest access. -quest_access_check($update, $data); +// Access check. +quest_access_check($update, $data, 'share'); // Get quest id. $id = $data['id']; @@ -34,17 +34,23 @@ debug_log($loc); } +// Telegram JSON array. +$tg_json = array(); + // Send the message. -send_message($chat, $text, $keys, ['reply_to_message_id' => $chat, 'disable_web_page_preview' => 'true']); +$tg_json[] = send_message($chat, $text, $keys, ['reply_to_message_id' => $chat, 'disable_web_page_preview' => 'true'], true); // Set callback keys and message $callback_msg = getTranslation('successfully_shared'); $callback_keys = []; // Edit message. -edit_message($update, $callback_msg, $callback_keys, false); +$tg_json[] = edit_message($update, $callback_msg, $callback_keys, false, true); // Answer callback. -answerCallbackQuery($update['callback_query']['id'], $callback_msg); +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_msg, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); exit(); diff --git a/mods/stop_delete.php b/mods/stop_delete.php new file mode 100644 index 0000000..952e6e6 --- /dev/null +++ b/mods/stop_delete.php @@ -0,0 +1,76 @@ +' . getTranslation('delete_this_pokestop') . '' . SP . EMOJI_WARN; + $msg .= CR . get_pokestop_details($pokestop); + + // Create the keys. + $keys = [ + [ + [ + 'text' => getTranslation('yes'), + 'callback_data' => $id . ':stop_delete:1' + ] + ], + [ + [ + 'text' => getTranslation('no'), + 'callback_data' => '0:exit:0' + ] + ] + ]; + +// Delete the pokestop. +} else if ($arg == 1) { + debug_log('Deleting pokestop with ID ' . $id); + // Get pokestop. + $pokestop = get_pokestop($id); + + // Set message + $msg = '' . getTranslation('pokestop_deleted') . '' . CR; + $msg .= get_pokestop_details($pokestop); + + // Set keys + $keys = []; + + // Delete pokestop. + delete_pokestop($id); + +} + +// Build callback message string. +$callback_response = 'OK'; + +// Telegram JSON array. +$tg_json = array(); + +// Answer callback. +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Edit the message. +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); + +// Exit. +exit(); diff --git a/mods/stop_details.php b/mods/stop_details.php new file mode 100644 index 0000000..7f65e29 --- /dev/null +++ b/mods/stop_details.php @@ -0,0 +1,50 @@ + 0) { + $pokestop = get_pokestop($id); + + // Set message + $msg = CR . get_pokestop_details($pokestop); + + // Create the keys. + $keys = []; + +// Pokestop not found. +} else { + // Set message. + $msg = '' . getTranslation('pokestops_not_found') . ''; + + // Set empty keys. + $keys = []; +} + +// Build callback message string. +$callback_response = 'OK'; + +// Telegram JSON array. +$tg_json = array(); + +// Answer callback. +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Edit the message. +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); + +// Exit. +exit(); diff --git a/mods/willow.php b/mods/willow.php new file mode 100644 index 0000000..94b55d4 --- /dev/null +++ b/mods/willow.php @@ -0,0 +1,67 @@ + getTranslation('add'), + 'callback_data' => '0:willow_' . $arg . '_add:0' + ] + ], + [ + [ + 'text' => getTranslation('delete'), + 'callback_data' => '0:willow_' . $arg . '_delete:0' + ] + ] +]; + +// Encounter? +if($arg == 'encounter') { + $edit_keys = []; + $edit_keys[] = universal_inner_key($keys, '0', 'willow_' . $arg . '_add', '1', getTranslation('edit')); + $keys[] = $edit_keys; +} + +// Add navigation keys. +$nav_keys = []; +$nav_keys[] = universal_inner_key($keys, '0', 'willow_start', '0', getTranslation('back')); +$nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + +// Get the inline key array. +$keys[] = $nav_keys; + +// Set message. +$msg = '' . getTranslation($arg) . ' — ' . getTranslation('select_action'); + +// Telegram JSON array. +$tg_json = array(); + +// Edit message. +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); + +// Build callback message string. +$callback_response = 'OK'; + +// Answer callback. +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); + +exit(); diff --git a/mods/willow_encounter_add.php b/mods/willow_encounter_add.php new file mode 100644 index 0000000..43e4f56 --- /dev/null +++ b/mods/willow_encounter_add.php @@ -0,0 +1,255 @@ +' . getTranslation('encounter') . ' — ' . getTranslation('select_id_to_add') . ''; + + // Get keys. + $keys = get_all_questlist_keys('willow_encounter_add', 'add-0#0,0,0,0,0', true); + + // Add abort navigation key. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'willow', 'encounter', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; + +// Edit encounter. +} else if ($id == 0 && $action == 'edit') { + // Get all encounters from json. + $msg = get_all_encounterlist_entries(); + $msg .= CR . '' . getTranslation('encounter') . ' — ' . getTranslation('select_id_to_edit') . ''; + $keys = get_all_encounterlist_keys('willow_encounter_add', 'edit-0#0,0,0,0,0'); + + // Add abort navigation key. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'willow', 'encounter', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; + +// Set pokedex IDs +} else if ($id > 0 && (substr_count($arg, '-') == 1) && ($action == 'add' || $action == 'edit')) { + // Init empty keys. + $keys = []; + + // Set message. + $msg = ' ' . getTranslation($action . '_this_encounter') . ' ' . CR . CR; + + // Get start value + $actval_split = explode('#', $dex_ids); + $start = $actval_split[0]; + + // Get first, second and third pokemon + $sel_pokemons = explode(',', $actval_split[1]); + $first = $sel_pokemons[0]; + $second = $sel_pokemons[1]; + $third = $sel_pokemons[2]; + $fourth = $sel_pokemons[3]; + $fifth = $sel_pokemons[4]; + + // New args. + $new_arg = $action . '-' . $start . '#' . $first . ',' . $second . ',' . $third . ',' . $fourth . ',' . $fifth; + $new_prev_25 = $action . '-' . ($start - 25) . '#' . $first . ',' . $second . ',' . $third . ',' . $fourth . ',' . $fifth; + $new_prev_50 = $action . '-' . ($start - 50) . '#' . $first . ',' . $second . ',' . $third . ',' . $fourth . ',' . $fifth; + $new_next_25 = $action . '-' . ($start + 25) . '#' . $first . ',' . $second . ',' . $third . ',' . $fourth . ',' . $fifth; + $new_next_50 = $action . '-' . ($start + 50) . '#' . $first . ',' . $second . ',' . $third . ',' . $fourth . ',' . $fifth; + + // Save + if($action == 'add') { + $new_save = 'save-0#' . $first . ',' . $second . ',' . $third . ',' . $fourth . ',' . $fifth; + } else if($action == 'edit') { + $new_save = 'update-0#' . $first . ',' . $second . ',' . $third . ',' . $fourth . ',' . $fifth; + } + + // Reset and currently selected pokemons. + $msg_poke = '...'; + if($first > 0 && $second == 0) { + $new_reset = $action . '-' . $start . '#0,0,0,0,0'; + $msg_poke = getTranslation('pokemon_id_' . $first); + } else if($first > 0 && $second > 0 && $third == 0) { + $new_reset = $action . '-' . $start . '#' . $first . ',0,0,0,0'; + $msg_poke = getTranslation('pokemon_id_' . $first) . SP . getTranslation('or') . SP . getTranslation('pokemon_id_' . $second); + } else if($first > 0 && $second > 0 && $third > 0 && $fourth == 0) { + $new_reset = $action . '-' . $start . '#' . $first . ',' . $second . ',0,0,0'; + $msg_poke = getTranslation('pokemon_id_' . $first) . ', ' . getTranslation('pokemon_id_' . $second) . SP . getTranslation('or') . SP . getTranslation('pokemon_id_' . $third); + } else if($first > 0 && $second > 0 && $third > 0 && $fourth > 0 && $fifth == 0) { + $new_reset = $action . '-' . $start . '#' . $first . ',' . $second . ',' . $third . ',0,0'; + $msg_poke = getTranslation('pokemon_id_' . $first) . ', ' . getTranslation('pokemon_id_' . $second) . ', ' . getTranslation('pokemon_id_' . $third) . SP . getTranslation('or') . SP . getTranslation('pokemon_id_' . $fourth); + } else if($first > 0 && $second > 0 && $third > 0 && $fourth > 0 && $fifth > 0) { + $new_reset = $action . '-' . $start . '#' . $first . ',' . $second . ',' . $third . ',' . $fourth . ',0'; + $msg_poke = getTranslation('pokemon_id_' . $first) . ', ' . getTranslation('pokemon_id_' . $second) . ', ' . getTranslation('pokemon_id_' . $third) . ', ' . getTranslation('pokemon_id_' . $fourth) . SP . getTranslation('or') . SP . getTranslation('pokemon_id_' . $fifth); + } + + // Get pokemon. + $limit = count_all_json_pokemon(); + + // Get pokemon keys. + if($fifth == 0) { + $keys = get_all_json_pokemon_keys($id, 'willow_encounter_add', $new_arg, $start, $first, $second, $third, $fourth, $fifth); + } + + // Add navigation keys. + $n_25_keys = []; + $n_50_keys = []; + + // Previous 25 key. + if($start - 25 >= 0 && $fifth == 0) { + $n_25_keys[] = universal_inner_key($keys, $id, 'willow_encounter_add', $new_prev_25, getTranslation('back') . ' (-25)'); + } + + // Next 25 key. + if($limit > $start + 25 && $fifth == 0) { + $n_25_keys[] = universal_inner_key($keys, $id, 'willow_encounter_add', $new_next_25, getTranslation('next') . ' (+25)'); + } + + // Previous 50 key. + if($start - 50 >= 0 && $fifth == 0) { + $n_50_keys[] = universal_inner_key($keys, $id, 'willow_encounter_add', $new_prev_50, getTranslation('back') . ' (-50)'); + } + + // Next 50 key. + if($limit > $start + 50 && $fifth == 0) { + $n_50_keys[] = universal_inner_key($keys, $id, 'willow_encounter_add', $new_next_50, getTranslation('next') . ' (+50)'); + } + + // Get the inline key array. + $keys[] = $n_25_keys; + $keys[] = $n_50_keys; + + // Add save and reset key. + if($first > 0) { + $s_keys = []; + $s_keys[] = universal_inner_key($keys, $id, 'willow_encounter_add', $new_reset, getTranslation('reset')); + $s_keys[] = universal_inner_key($keys, $id, 'willow_encounter_add', $new_save, EMOJI_DISK); + $keys[] = $s_keys; + } + + // Set message. + $msg .= get_all_json_pokemon($start, $first, $second, $third, $fourth, $fifth); + + // Get quest. + $quest_enc = ''; + if($action == 'add') { + $msg .= getTranslation('quest') . ':' . CR; + $quest_enc = get_formatted_questlist_entry($id); + $msg .= $quest_enc . CR . CR; + } else if($action == 'edit') { + $msg .= getTranslation('quest') . ':' . CR; + $quest_enc = get_formatted_encounterlist_entry($id); + $msg .= $quest_enc . CR; + } + + // Build message. + $msg .= ''; + $msg .= getTranslation('pokemon') . ' — '; + $msg .= ($fifth == 0) ? (getTranslation('select_id_to_' . $action)) : (getTranslation($action . '_this_encounter')); + $msg .= ''; + + // Add navigation keys. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'willow_encounter_add', $action . '-0#0,0,0,0,0', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; + +// Save encounter. +} else if ($id > 0 && $action == 'save') { + // Write to log. + debug_log('Confirmation received to save the encounter'); + + // Save encounter. + add_encounterlist_entry($id, $dex_ids); + + // Get inserted database id. + $id = my_insert_id(); + + // Set message. + $msg = getTranslation('encounter_successfully_saved') . CR . CR; + + // Show saved encounter. + $msg .= getTranslation('quest') . ':' . CR; + $quest_enc = get_formatted_encounterlist_entry($id); + $msg .= $quest_enc . CR; + + // Set empty keys. + $keys = []; + +// Update encounter. +} else if ($id > 0 && $action == 'update') { + // Write to log. + debug_log('Confirmation received to update the encounter'); + + // Update encounter. + update_encounterlist_entry($id, $dex_ids); + + // Set message. + $msg = getTranslation('encounter_successfully_saved') . CR . CR; + + // Show saved encounter. + $msg .= getTranslation('quest') . ':' . CR; + $quest_enc = get_formatted_encounterlist_entry($id); + $msg .= $quest_enc . CR; + + // Set empty keys. + $keys = []; + +} + +// Telegram JSON array. +$tg_json = array(); + +// Edit message. +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); + +// Build callback message string. +$callback_response = 'OK'; + +// Answer callback. +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); + +exit(); diff --git a/mods/willow_encounter_delete.php b/mods/willow_encounter_delete.php new file mode 100644 index 0000000..c8320d1 --- /dev/null +++ b/mods/willow_encounter_delete.php @@ -0,0 +1,99 @@ +' . getTranslation('encounter') . ' — ' . getTranslation('select_id_to_delete') . ''; + + // Get keys. + $keys = get_all_encounterlist_keys('willow_encounter_delete', '1'); + + // Add abort navigation key. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'willow', 'encounter', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; + +} else if ($arg == 1) { + // Write to log. + debug_log('Asking for confirmation to delete the encounter with ID: ' . $enclist_id); + + // Create keys array. + $keys = [ + [ + [ + 'text' => getTranslation('yes'), + 'callback_data' => $enclist_id . ':willow_encounter_delete:' . '3' + ] + ], + [ + [ + 'text' => getTranslation('no'), + 'callback_data' => $enclist_id . ':willow_encounter_delete:' . '2' + ] + ] + ]; + + // Add navigation keys. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'willow_encounter_delete', '0', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; + + // Set message. + $msg = EMOJI_WARN . ' ' . getTranslation('delete_this_encounter') . ' ' . EMOJI_WARN . CR . CR; + $msg .= get_formatted_encounterlist_entry($enclist_id); +} else if ($arg == 2) { + debug_log('Encounter deletion for encounter ID ' . $enclist_id . ' was canceled!'); + // Set message. + $msg = '' . getTranslation('encounter_deletion_was_canceled') . ''; + + // Set keys. + $keys = []; +} else if ($arg == 3) { + debug_log('Confirmation to delete encounter ' . $enclist_id . ' was received!'); + // Set message. + $msg = getTranslation('encounter_successfully_deleted'); + + // Set keys. + $keys = []; + + // Delete quest from questlist. + delete_encounterlist_entry($enclist_id); +} + +// Telegram JSON array. +$tg_json = array(); + +// Edit message. +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); + +// Build callback message string. +$callback_response = 'OK'; + +// Answer callback. +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); + +exit(); diff --git a/mods/willow_quest_add.php b/mods/willow_quest_add.php new file mode 100644 index 0000000..03b70e6 --- /dev/null +++ b/mods/willow_quest_add.php @@ -0,0 +1,427 @@ += 2) { + $action_source = $argval[2]; + } + + // Get quest action value + if (substr_count($arg, '-') >= 3) { + $action_value = $argval[3]; + } +} else { + $action = $arg; + $qty = 0; +} + +// Event? +if(is_numeric($event) && $event == 0 && $id == 0 && $action == 0 && $qty == 0) { + // Get all quest events from json. + $msg = get_all_json_quest_event(); + $msg .= CR . '' . getTranslation('quest') . ' — ' . getTranslation('select_event') . ''; + $keys = get_all_json_quest_event_keys('willow_quest_add', 0); + + // Add abort navigation key. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'willow', 'quest', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; + +// Quest type. +} else if ($id == 0 && $action == 0 && $qty == 0) { + // Get all quest types from json. + $msg = get_all_json_quest_type(); + // Event? + if(is_numeric($event)) { + $msg .= CR . '' . getTranslation('event') . ': ' . getTranslation('quest_event_' . $event) . '' . CR; + } + $msg .= CR . '' . getTranslation('quest') . ' — ' . getTranslation('quest_select_type') . ''; + $keys = get_all_json_quest_type_keys('willow_quest_add', 'add-0', $event); + + // Add abort navigation key. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'willow_quest_add', '0', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; + +// Quantity +} else if ($id > 0 && $action == 'add' && (substr_count($arg, '-') == 1)) { + // Set message. + $msg = ' ' . getTranslation('add_this_quest') . ' ' . CR . CR; + + // Get quantity + $quest_type = getTranslation('quest_type_' . $id); + $msg .= getTranslation('quest') . ': ' . CR; + // Event? + if(is_numeric($event) && $event > 0) { + $msg .= getTranslation('quest_event_' . $event) . ':' . SP; + } + $msg .= $quest_type . SP . $qty . SP . ' ...'; + $msg .= CR . CR . '' . getTranslation('quest_select_qty') . ''; + + // Keys to specify qty + $keys = quantity_keys($cb_id, 'willow_quest_add', 'add-' . $qty, 'quest'); + + // Add abort navigation key. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'willow_quest_add', '0', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; + +// Action from language file, pokedex IDs or pokemon types +} else if ($id > 0 && $action == 'add' && (substr_count($arg, '-') == 2)) { + // Set message. + $msg = ' ' . getTranslation('add_this_quest') . ' ' . CR . CR; + + // Get quantity + $quest_type = getTranslation('quest_type_' . $id); + $msg .= getTranslation('quest') . ': ' . CR; + // Event? + if(is_numeric($event) && $event > 0) { + $msg .= getTranslation('quest_event_' . $event) . ':' . SP; + } + $msg .= $quest_type . SP . $qty . SP . ' ...' . CR . CR; + $msg .= '' . getTranslation('quest_select_type') . ''; + + // Init empty keys array. + $keys = []; + + // Create keys array. + $keys = [ + [ + [ + 'text' => getTranslation('pokemon'), + 'callback_data' => $cb_id . ':willow_quest_add:' . $action . '-' . $qty . '-' . 'dex-0#0,0,0' + ] + ], + [ + [ + 'text' => getTranslation('pokemon_types'), + 'callback_data' => $cb_id . ':willow_quest_add:' . $action . '-' . $qty . '-' . 'type-0#0,0,0' + ] + ], + [ + [ + 'text' => getTranslation('other'), + 'callback_data' => $cb_id . ':willow_quest_add:' . $action . '-' . $qty . '-' . 'file-0' + ] + ], + ]; + + // Add navigation keys. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, $cb_id, 'willow_quest_add', 'add-0', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; + +// Set quest action, pokedex IDs or pokemon types +} else if ($id > 0 && $action == 'add' && (substr_count($arg, '-') == 3)) { + // Init empty keys. + $keys = []; + + // Set message. + $msg = ' ' . getTranslation('add_this_quest') . ' ' . CR . CR; + + // Get quantity + $quest_type = getTranslation('quest_type_' . $id); + + // Pokedex IDs + if($action_source == 'dex') { + // Get start value + $actval_split = explode('#', $action_value); + $start = $actval_split[0]; + + // Get first, second and third pokemon + $sel_pokemons = explode(',', $actval_split[1]); + $first = $sel_pokemons[0]; + $second = $sel_pokemons[1]; + $third = $sel_pokemons[2]; + + // New args. + $new_arg = $action . '-' . $qty . '-dex-' . $start . '#' . $first . ',' . $second . ',' . $third; + $new_prev_25 = $action . '-' . $qty . '-dex-' . ($start - 25) . '#' . $first . ',' . $second . ',' . $third; + $new_prev_50 = $action . '-' . $qty . '-dex-' . ($start - 50) . '#' . $first . ',' . $second . ',' . $third; + $new_next_25 = $action . '-' . $qty . '-dex-' . ($start + 25) . '#' . $first . ',' . $second . ',' . $third; + $new_next_50 = $action . '-' . $qty . '-dex-' . ($start + 50) . '#' . $first . ',' . $second . ',' . $third; + $new_save = 'save-' . $qty . '-dex-0#' . $first . ',' . $second . ',' . $third; + + // Reset and currently selected pokemons. + $msg_poke = '...'; + if($first > 0 && $second == 0) { + $new_reset = $action . '-' . $qty . '-dex-' . $start . '#0,0,0'; + $msg_poke = getTranslation('pokemon_id_' . $first); + } else if($first > 0 && $second > 0 && $third == 0) { + $new_reset = $action . '-' . $qty . '-dex-' . $start . '#' . $first . ',0,0'; + $msg_poke = getTranslation('pokemon_id_' . $first) . SP . getTranslation('or') . SP . getTranslation('pokemon_id_' . $second); + } else if($first > 0 && $second > 0 && $third > 0) { + $new_reset = $action . '-' . $qty . '-dex-' . $start . '#' . $first . ',' . $second . ',0'; + $msg_poke = getTranslation('pokemon_id_' . $first) . ', ' . getTranslation('pokemon_id_' . $second) . SP . getTranslation('or') . SP . getTranslation('pokemon_id_' . $third); + } + + // Set end value. + $limit = count_all_json_pokemon(); + //$end = ($limit > $start + 50) ? ($start + 50) : $limit; + + // Get pokemon keys. + if($third == 0) { + $keys = get_all_json_pokemon_keys($cb_id, 'willow_quest_add', $new_arg, $start, $first, $second, $third); + } + + // Add navigation keys. + $n_25_keys = []; + $n_50_keys = []; + + // Previous 25 key. + if($start - 25 >= 0 && $third == 0) { + $n_25_keys[] = universal_inner_key($keys, $cb_id, 'willow_quest_add', $new_prev_25, getTranslation('back') . ' (-25)'); + } + + // Next 25 key. + if($limit > $start + 25 && $third == 0) { + $n_25_keys[] = universal_inner_key($keys, $cb_id, 'willow_quest_add', $new_next_25, getTranslation('next') . ' (+25)'); + } + + // Previous 50 key. + if($start - 50 >= 0 && $third == 0) { + $n_50_keys[] = universal_inner_key($keys, $cb_id, 'willow_quest_add', $new_prev_50, getTranslation('back') . ' (-50)'); + } + + // Next 50 key. + if($limit > $start + 50 && $third == 0) { + $n_50_keys[] = universal_inner_key($keys, $cb_id, 'willow_quest_add', $new_next_50, getTranslation('next') . ' (+50)'); + } + + // Get the inline key array. + $keys[] = $n_25_keys; + $keys[] = $n_50_keys; + + // Add save and reset key. + if($first > 0) { + $s_keys = []; + $s_keys[] = universal_inner_key($keys, $cb_id, 'willow_quest_add', $new_reset, getTranslation('reset')); + $s_keys[] = universal_inner_key($keys, $cb_id, 'willow_quest_add', $new_save, EMOJI_DISK); + $keys[] = $s_keys; + } + + // Set message. + $msg .= get_all_json_pokemon($start, $first, $second, $third); + + // Get quantity + $quest_type = getTranslation('quest_type_' . $id); + $msg .= getTranslation('quest') . ': ' . CR; + // Event? + if(is_numeric($event) && $event > 0) { + $msg .= getTranslation('quest_event_' . $event) . ':' . SP; + } + $msg .= $quest_type . SP . $qty . SP . $msg_poke . '' . CR . CR; + $msg .= ''; + $msg .= ($third == 0) ? (getTranslation('pokemon') . ' — ' . getTranslation('select_id_to_add')) : (getTranslation('add_this_quest')); + $msg .= ''; + + // Pokemon Types + } else if($action_source == 'type') { + // Get start value + $actval_split = explode('#', $action_value); + $start = $actval_split[0]; + + // Get first, second and third pokemon type + $sel_poketypes = explode(',', $actval_split[1]); + $first = $sel_poketypes[0]; + $second = $sel_poketypes[1]; + $third = $sel_poketypes[2]; + + // New save. + $new_save = 'save-' . $qty . '-type-0#' . $first . ',' . $second . ',' . $third; + + // Reset and currently selected pokemons. + $msg_poke_type = '...'; + if($first > 0 && $second == 0) { + $new_reset = $action . '-' . $qty . '-type-' . $start . '#0,0,0'; + $msg_poke_type = getTranslation('pokemon_type_' . $first); + } else if($first > 0 && $second > 0 && $third == 0) { + $new_reset = $action . '-' . $qty . '-type-' . $start . '#' . $first . ',0,0'; + $msg_poke_type = getTranslation('pokemon_type_' . $first) . SP . getTranslation('or') . SP . getTranslation('pokemon_type_' . $second); + } else if($first > 0 && $second > 0 && $third > 0) { + $new_reset = $action . '-' . $qty . '-type-' . $start . '#' . $first . ',' . $second . ',0'; + $msg_poke_type = getTranslation('pokemon_type_' . $first) . ', ' . getTranslation('pokemon_type_' . $second) . SP . getTranslation('or') . SP . getTranslation('pokemon_type_' . $third); + } + + // Get pokemon keys. + if($third == 0) { + $keys = get_all_json_pokemon_type_keys($cb_id, 'willow_quest_add', $arg, $first, $second, $third); + } + + // Add save and reset key. + if($first > 0) { + $s_keys = []; + $s_keys[] = universal_inner_key($keys, $cb_id, 'willow_quest_add', $new_reset, getTranslation('reset')); + $s_keys[] = universal_inner_key($keys, $cb_id, 'willow_quest_add', $new_save, EMOJI_DISK); + $keys[] = $s_keys; + } + + // Set message. + $msg .= get_all_json_pokemon_type($first, $second, $third); + + // Get quantity + $quest_type = getTranslation('quest_type_' . $id); + $poke_types = str_replace('POKEMON_TYPE', $msg_poke_type, getTranslation('pokemon_of_type')); + $msg .= getTranslation('quest') . ': ' . CR; + // Event? + if(is_numeric($event) && $event > 0) { + $msg .= getTranslation('quest_event_' . $event) . ':' . SP; + } + $msg .= $quest_type . SP . $qty . SP . $poke_types . '' . CR . CR; + $msg .= ''; + $msg .= ($third == 0) ? (getTranslation('pokemon_types') . ' — ' . getTranslation('add') . ':') : (getTranslation('add_this_quest')); + $msg .= ''; + + // Actions from language files + } else if($action_source == 'file') { + // Ready to save quest? + if($action_value > 0) { + // Write to log. + debug_log('Asking for confirmation to save the quest'); + + // Get quest action. + $quest_action = explode(":", getTranslation('quest_action_' . $action_value)); + $quest_action_singular = $quest_action[0]; + $quest_action_plural = $quest_action[1]; + $action_qty_text = (($qty > 1) ? ($quest_action_plural) : ($quest_action_singular)); + + // Final quest. + $msg .= getTranslation('quest') . ': ' . CR; + // Event? + if(is_numeric($event) && $event > 0) { + $msg .= getTranslation('quest_event_' . $event) . ':' . SP; + } + $msg .= $quest_type . SP . $qty . SP . $action_qty_text . '' . CR . CR; + + // Create keys array. + $keys = [ + [ + [ + 'text' => getTranslation('yes'), + 'callback_data' => $cb_id . ':willow_quest_add:' . 'save-' . $qty . '-' . $action_source . '-' . $action_value + ] + ], + [ + [ + 'text' => getTranslation('no'), + 'callback_data' => '0:exit:0' + ] + ] + ]; + } else { + // Get keys and message via json. + $keys = get_all_json_quest_action_keys($event, $id, 'willow_quest_add', $arg); + $msg .= get_all_json_quest_action($id) . CR; + + // Build message. + $msg .= getTranslation('quest') . ': ' . CR; + // Event? + if(is_numeric($event) && $event > 0) { + $msg .= getTranslation('quest_event_' . $event) . ':' . SP; + } + $msg .= $quest_type . SP . $qty . SP . ' ...' . CR . CR; + $msg .= '' . getTranslation('quest_select_type') . ''; + } + } + + // Add navigation keys. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, $cb_id, 'willow_quest_add', $action . '-' . $qty . '-0', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; + +// Save quest. +} else if ($id > 0 && $action == 'save') { + // Write to log. + debug_log('Confirmation received to save the quest'); + + // No Event? + if($event == 'no') { + $event = 0; + } + + // Save quest. + add_questlist_quest($event, $id, $qty, $action_source, $action_value); + + // Get inserted database id. + $ql_id = my_insert_id(); + + // Set message. + $msg = getTranslation('quest_successfully_saved') . CR . CR; + + // Show saved encounter. + $msg .= getTranslation('quest') . ':' . CR; + $quest_entry = get_formatted_questlist_entry($ql_id); + $msg .= $quest_entry . CR; + + // Set empty keys. + $keys = []; + +} + +// Telegram JSON array. +$tg_json = array(); + +// Edit message. +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); + +// Build callback message string. +$callback_response = 'OK'; + +// Answer callback. +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); + +exit(); diff --git a/mods/willow_quest_delete.php b/mods/willow_quest_delete.php new file mode 100644 index 0000000..f23a282 --- /dev/null +++ b/mods/willow_quest_delete.php @@ -0,0 +1,108 @@ +' . getTranslation('quest') . ' — ' . getTranslation('select_id_to_delete') . ''; + + // Get keys. + $keys = get_all_questlist_keys('willow_quest_delete', '1'); + + // Add abort navigation key. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'willow', 'quest', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; + +} else if ($arg == 1) { + // Write to log. + debug_log('Asking for confirmation to delete the quest with ID: ' . $questlist_id); + + // Create keys array. + $keys = [ + [ + [ + 'text' => getTranslation('yes'), + 'callback_data' => $questlist_id . ':willow_quest_delete:' . '3' + ] + ], + [ + [ + 'text' => getTranslation('no'), + 'callback_data' => $questlist_id . ':willow_quest_delete:' . '2' + ] + ] + ]; + + // Add navigation keys. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'willow_quest_delete', '0', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; + + // Set message. + $msg = EMOJI_WARN . ' ' . getTranslation('delete_this_quest') . ' ' . EMOJI_WARN . CR . CR; + $msg .= get_formatted_questlist_entry($questlist_id); +} else if ($arg == 2) { + debug_log('Quest deletion for quest ID ' . $questlist_id . ' was canceled!'); + // Set message. + $msg = '' . getTranslation('quest_deletion_was_canceled') . ''; + + // Set keys. + $keys = []; +} else if ($arg == 3) { + debug_log('Confirmation to delete quest ' . $questlist_id . ' was received!'); + // Set message. + $msg = getTranslation('quest_successfully_deleted'); + + // Set keys. + $keys = []; + + // Get quest id from questlist. + $ql_entry = get_questlist_entry($questlist_id); + + // Delete quest from questlist. + delete_questlist_quest($questlist_id); + + // Delete quest from encounterlist. + delete_encounterlist_entry($ql_entry['id'], 'quest_id'); + + // Delete quest from quicklist. + delete_quicklist_entry($ql_entry['id'], 'quest_id'); +} + +// Telegram JSON array. +$tg_json = array(); + +// Edit message. +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); + +// Build callback message string. +$callback_response = 'OK'; + +// Answer callback. +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); + +exit(); diff --git a/mods/willow_quicklist_add.php b/mods/willow_quicklist_add.php new file mode 100644 index 0000000..e4d2c03 --- /dev/null +++ b/mods/willow_quicklist_add.php @@ -0,0 +1,136 @@ +' . getTranslation('quest') . ' — ' . getTranslation('select_id_to_add') . ''; + + // Get keys. + $keys = get_all_questlist_keys('willow_quicklist_add', '1'); + + // Add abort navigation key. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'willow', 'quicklist', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; + +// Add reward +} else if ($arg == 1) { + // Build message. + $msg = get_all_rewardlist_entries(false, false, $questlist_id); + $msg .= CR . '' . getTranslation('reward') . ' — ' . getTranslation('select_id_to_add') . ''; + + // Get keys. + $keys = get_all_rewardlist_keys('willow_quicklist_add', '2,' . $questlist_id, false, false); + + // Add abort navigation key. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, $questlist_id, 'willow_quicklist_add', '0', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; +} else if ($arg == 2) { + // Write to log. + debug_log('Asking for confirmation to add the quest with ID: ' . $questlist_id . ' to the quicklist'); + + // Create keys array. + $keys = [ + [ + [ + 'text' => getTranslation('yes'), + 'callback_data' => $rewardlist_id . ':willow_quicklist_add:' . '4,' . $questlist_id + ] + ], + [ + [ + 'text' => getTranslation('no'), + 'callback_data' => $rewardlist_id . ':willow_quicklist_add:' . '3,' . $questlist_id + ] + ] + ]; + + // Add navigation keys. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, $rewardlist_id, 'willow_quicklist_add', '1,' . $questlist_id, getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; + + // Get questlist entry + $ql = get_questlist_entry($questlist_id); + + // Set message. + $msg = ' ' . getTranslation('add_this_quest_to_quicklist') . ' ' . CR . CR; + $msg .= '' . getTranslation('quest') . '' . SP . get_formatted_questlist_entry($ql['id']) . CR; + $msg .= '' . getTranslation('reward') . '' . SP . get_formatted_rewardlist_entry($rewardlist_id, $questlist_id); +} else if ($arg == 3) { + debug_log('Adding quest with ID ' . $questlist_id . ' and reward with ID ' . $rewardlist_id . ' to the quicklist was canceled!'); + // Set message. + $msg = '' . getTranslation('quicklist_entry_addition_was_canceled') . ''; + + // Set keys. + $keys = []; +} else if ($arg == 4) { + debug_log('Confirmation to add quest ' . $questlist_id . ' and reward with ID ' . $rewardlist_id . ' to the quicklist was received!'); + + // Set keys. + $keys = []; + + // Add entry from quicklist. + add_quicklist_entry($questlist_id, $rewardlist_id); + + // Get inserted database id. + $id = my_insert_id(); + + // Set message. + $msg = getTranslation('quicklist_entry_successfully_added') . CR . CR; + $msg .= '' . getTranslation('quest') . '' . SP . get_formatted_questlist_entry($questlist_id) . CR; + $msg .= '' . getTranslation('reward') . '' . SP . get_formatted_rewardlist_entry($rewardlist_id); +} + +// Telegram JSON array. +$tg_json = array(); + +// Edit message. +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); + +// Build callback message string. +$callback_response = 'OK'; + +// Answer callback. +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); + +exit(); diff --git a/mods/willow_quicklist_delete.php b/mods/willow_quicklist_delete.php new file mode 100644 index 0000000..1cd33ad --- /dev/null +++ b/mods/willow_quicklist_delete.php @@ -0,0 +1,102 @@ +' . getTranslation('quicklist') . ' — ' . getTranslation('select_id_to_delete') . ''; + + // Get keys. + $keys = get_all_quicklist_keys('willow_quicklist_delete', '1', 'id'); + + // Add abort navigation key. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'willow', 'quicklist', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; + +} else if ($arg == 1) { + // Write to log. + debug_log('Asking for confirmation to delete the quicklist entry with ID: ' . $quicklist_id); + + // Create keys array. + $keys = [ + [ + [ + 'text' => getTranslation('yes'), + 'callback_data' => $quicklist_id . ':willow_quicklist_delete:' . '3' + ] + ], + [ + [ + 'text' => getTranslation('no'), + 'callback_data' => $quicklist_id . ':willow_quicklist_delete:' . '2' + ] + ] + ]; + + // Add navigation keys. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'willow_quicklist_delete', '0', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; + + // Get quicklist entry + $qql = get_quicklist_entry($quicklist_id); + + // Set message. + $msg = EMOJI_WARN . ' ' . getTranslation('delete_this_quicklist_entry') . ' ' . EMOJI_WARN . CR . CR; + $msg .= get_formatted_questlist_entry($qql['quest_id']); +} else if ($arg == 2) { + debug_log('Deletion for quicklist entry ID ' . $quicklist_id . ' was canceled!'); + // Set message. + $msg = '' . getTranslation('quicklist_entry_deletion_was_canceled') . ''; + + // Set keys. + $keys = []; +} else if ($arg == 3) { + debug_log('Confirmation to delete quicklist entry ' . $quicklist_id . ' was received!'); + // Set message. + $msg = getTranslation('quicklist_entry_successfully_deleted'); + + // Set keys. + $keys = []; + + // Delete entry from quicklist. + delete_quicklist_entry($quicklist_id); +} + +// Telegram JSON array. +$tg_json = array(); + +// Edit message. +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); + +// Build callback message string. +$callback_response = 'OK'; + +// Answer callback. +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); + +exit(); diff --git a/mods/willow_reward_add.php b/mods/willow_reward_add.php new file mode 100644 index 0000000..aa51de5 --- /dev/null +++ b/mods/willow_reward_add.php @@ -0,0 +1,105 @@ +' . getTranslation('reward') . ' — ' . getTranslation('reward_select_type') . ''; + $keys = get_all_json_reward_keys('willow_reward_add', 'add-0'); + + // Add abort navigation key. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'willow', 'reward', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; +} else if ($id > 0 && $action == 'add') { + // Add currently available rewards. + $msg = '' . getTranslation('available_rewards') . ' ' . CR; + $available = get_all_rewardlist_entries(false, false, 0, 'reward_type', '=', $id); + if($available) { + $msg .= $available . CR; + } else { + $msg .= getTranslation('none') . CR . CR; + } + + // Set message. + $msg .= '' . getTranslation('add_this_reward') . ' ' . CR . CR; + + // Get quantity from value + $rw_type = explode(":", getTranslation('reward_type_' . $id)); + $rw_type_singular = $rw_type[0]; + $rw_type_plural = $rw_type[1]; + $msg .= getTranslation('reward') . ': ' . $value . SP . ($value == 1 ? $rw_type_singular : $rw_type_plural) . ''; + + // Keys to specify qty + $keys = quantity_keys($id, 'willow_reward_add', 'add-' . $value); + + // Add abort navigation key. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'willow_reward_add', 'add-0', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; +} else if ($id > 0 && $action == 'save') { + // Write to log. + debug_log('Confirmation received to save the reward with ID: ' . $id . ' and quantity: ' . $value); + + // Add reward to rewardlist. + add_rewardlist_reward($id, $value); + + // Get inserted database id. + $id = my_insert_id(); + + // Set message. + $msg = getTranslation('reward_successfully_saved') . CR . CR; + $reward_entry = get_formatted_rewardlist_entry($id); + $msg .= getTranslation('reward') . ':' . CR . $reward_entry; + + // Set keys. + $keys = []; +} + +// Telegram JSON array. +$tg_json = array(); + +// Edit message. +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); + +// Build callback message string. +$callback_response = 'OK'; + +// Answer callback. +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); + +exit(); diff --git a/mods/willow_reward_delete.php b/mods/willow_reward_delete.php new file mode 100644 index 0000000..e97857e --- /dev/null +++ b/mods/willow_reward_delete.php @@ -0,0 +1,105 @@ +' . getTranslation('reward') . ' — ' . getTranslation('select_id_to_delete') . ''; + + // Get keys. + $keys = get_all_rewardlist_keys('willow_reward_delete', '1', true, false); + + // Add abort navigation key. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'willow', 'reward', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; + +} else if ($arg == 1) { + // Prohibit to delete reward ID 1 (Pokemon encounter) + if($rewardlist_id == 1) { + $keys = []; + $msg = EMOJI_WARN . ' ' . getTranslation('bot_access_denied') . ' ' . EMOJI_WARN . CR . CR; + } else { + // Write to log. + debug_log('Asking for confirmation to delete the reward with ID: ' . $rewardlist_id); + + // Create keys array. + $keys = [ + [ + [ + 'text' => getTranslation('yes'), + 'callback_data' => $rewardlist_id . ':willow_reward_delete:' . '3' + ] + ], + [ + [ + 'text' => getTranslation('no'), + 'callback_data' => $rewardlist_id . ':willow_reward_delete:' . '2' + ] + ] + ]; + + // Add navigation keys. + $nav_keys = []; + $nav_keys[] = universal_inner_key($keys, '0', 'willow_quest_delete', '0', getTranslation('back')); + $nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + + // Get the inline key array. + $keys[] = $nav_keys; + + // Set message. + $msg = EMOJI_WARN . ' ' . getTranslation('delete_this_reward') . ' ' . EMOJI_WARN . CR . CR; + $msg .= get_formatted_rewardlist_entry($rewardlist_id); + } +} else if ($arg == 2) { + debug_log('Reward deletion for reward ID ' . $rewardlist_id . ' was canceled!'); + // Set message. + $msg = '' . getTranslation('reward_deletion_was_canceled') . ''; + + // Set keys. + $keys = []; +} else if ($arg == 3) { + debug_log('Confirmation to delete reward ' . $rewardlist_id . ' was received!'); + // Set message. + $msg = getTranslation('reward_successfully_deleted'); + + // Set keys. + $keys = []; + + // Delete reward from rewardlist. + delete_rewardlist_reward($rewardlist_id); +} + +// Telegram JSON array. +$tg_json = array(); + +// Edit message. +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); + +// Build callback message string. +$callback_response = 'OK'; + +// Answer callback. +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); + +exit(); diff --git a/mods/willow_start.php b/mods/willow_start.php new file mode 100644 index 0000000..7c6e6e5 --- /dev/null +++ b/mods/willow_start.php @@ -0,0 +1,68 @@ + getTranslation('quest'), + 'callback_data' => '0:willow:quest' + ] + ], + [ + [ + 'text' => getTranslation('reward'), + 'callback_data' => '0:willow:reward' + ] + ], + [ + [ + 'text' => getTranslation('encounter'), + 'callback_data' => '0:willow:encounter' + ] + ], + [ + [ + 'text' => getTranslation('quicklist'), + 'callback_data' => '0:willow:quicklist' + ] + ] +]; + +// Add abort navigation key. +$nav_keys = []; +$nav_keys[] = universal_inner_key($keys, '0', 'exit', '0', getTranslation('abort')); + +// Get the inline key array. +$keys[] = $nav_keys; + +// Set message. +$msg = '' . getTranslation('edit_quests_encounters_rewards_quicklist') . ''; + +// Telegram JSON array. +$tg_json = array(); + +// Edit message. +$tg_json[] = edit_message($update, $msg, $keys, ['disable_web_page_preview' => 'true'], true); + +// Build callback message string. +$callback_response = 'OK'; + +// Answer callback. +$tg_json[] = answerCallbackQuery($update['callback_query']['id'], $callback_response, true); + +// Telegram multicurl request. +curl_json_multi_request($tg_json); + +exit(); diff --git a/sql/pokemon-quest-bot.sql b/sql/pokemon-quest-bot.sql index 5b77367..9c9d826 100644 --- a/sql/pokemon-quest-bot.sql +++ b/sql/pokemon-quest-bot.sql @@ -13,7 +13,7 @@ /*!40101 SET character_set_client = utf8 */; CREATE TABLE `qleanup` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `quest_id` int(10) unsigned NOT NULL, + `quest_id` int(10) NOT NULL, `chat_id` bigint(20) NOT NULL, `message_id` bigint(20) unsigned NOT NULL, `cleaned` int(10) unsigned DEFAULT '0', @@ -31,12 +31,16 @@ CREATE TABLE `encounterlist` ( /*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `overview` ( +CREATE TABLE `invasions` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `chat_id` bigint(20) NOT NULL, - `message_id` bigint(20) unsigned NOT NULL, + `user_id` bigint(20) DEFAULT NULL, + `pokestop_id` int(10) unsigned NOT NULL, + `first_seen` datetime DEFAULT NULL, + `start_time` datetime DEFAULT NULL, + `end_time` datetime DEFAULT NULL, + `comment` varchar(48) CHARACTER SET utf8mb4 DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -53,9 +57,12 @@ CREATE TABLE `pokestops` ( /*!40101 SET character_set_client = utf8 */; CREATE TABLE `questlist` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `quest_event` int(10) unsigned NOT NULL, `quest_type` int(10) unsigned NOT NULL, `quest_quantity` int(10) unsigned NOT NULL, `quest_action` int(10) unsigned NOT NULL, + `quest_pokedex_ids` varchar(20) DEFAULT '0', + `quest_poketypes` varchar(20) DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; diff --git a/sql/quests-rewards-encounters.sql b/sql/quests-rewards-encounters.sql index 324af1b..d4a86d3 100644 --- a/sql/quests-rewards-encounters.sql +++ b/sql/quests-rewards-encounters.sql @@ -2,145 +2,104 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!40101 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +DROP TABLE IF EXISTS `quick_questlist`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `quick_questlist` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `quest_id` int(10) unsigned NOT NULL, + `reward_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; +/*!40101 SET character_set_client = @saved_cs_client */; + +LOCK TABLES `quick_questlist` WRITE; +/*!40000 ALTER TABLE `quick_questlist` DISABLE KEYS */; +/*!40000 ALTER TABLE `quick_questlist` ENABLE KEYS */; +UNLOCK TABLES; DROP TABLE IF EXISTS `questlist`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `questlist` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `quest_event` int(10) unsigned NOT NULL, `quest_type` int(10) unsigned NOT NULL, `quest_quantity` int(10) unsigned NOT NULL, `quest_action` int(10) unsigned NOT NULL, + `quest_pokedex_ids` varchar(20) DEFAULT '0', + `quest_poketypes` varchar(20) DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=138 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; /*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `questlist` WRITE; /*!40000 ALTER TABLE `questlist` DISABLE KEYS */; -INSERT INTO `questlist` VALUES (1, '1', '1', '1001'); -INSERT INTO `questlist` VALUES (2, '1', '3', '1001'); -INSERT INTO `questlist` VALUES (3, '1', '5', '1001'); -INSERT INTO `questlist` VALUES (4, '4', '1', '6001'); -INSERT INTO `questlist` VALUES (5, '10', '5', '10001'); -INSERT INTO `questlist` VALUES (6, '9', '1', '6003'); -INSERT INTO `questlist` VALUES (7, '2', '10', '2001'); -INSERT INTO `questlist` VALUES (8, '11', '10', '11001'); -INSERT INTO `questlist` VALUES (9, '11', '3', '6001'); -INSERT INTO `questlist` VALUES (10, '12', '1', '6001'); -INSERT INTO `questlist` VALUES (11, '3', '5', '3001'); -INSERT INTO `questlist` VALUES (12, '6', '3', '6034'); -INSERT INTO `questlist` VALUES (13, '6', '10', '6001'); -INSERT INTO `questlist` VALUES (14, '6', '5', '6002'); -INSERT INTO `questlist` VALUES (15, '6', '1', '6012'); -INSERT INTO `questlist` VALUES (16, '9', '5', '9002'); -INSERT INTO `questlist` VALUES (17, '6', '10', '6002'); -INSERT INTO `questlist` VALUES (18, '6', '10', '6022'); -INSERT INTO `questlist` VALUES (19, '6', '1', '6105'); -INSERT INTO `questlist` VALUES (20, '9', '5', '9006'); -INSERT INTO `questlist` VALUES (21, '9', '10', '9003'); -INSERT INTO `questlist` VALUES (22, '6', '7', '6034'); -INSERT INTO `questlist` VALUES (23, '6', '10', '6020'); -INSERT INTO `questlist` VALUES (24, '6', '3', '6036'); -INSERT INTO `questlist` VALUES (25, '6', '5', '6027'); -INSERT INTO `questlist` VALUES (26, '6', '5', '6035'); -INSERT INTO `questlist` VALUES (27, '6', '5', '6016'); -INSERT INTO `questlist` VALUES (28, '5', '3', '5010'); -INSERT INTO `questlist` VALUES (29, '5', '5', '5001'); -INSERT INTO `questlist` VALUES (30, '5', '3', '5011'); -INSERT INTO `questlist` VALUES (31, '5', '3', '5021'); -INSERT INTO `questlist` VALUES (32, '5', '2', '5004'); -INSERT INTO `questlist` VALUES (33, '5', '5', '5031'); -INSERT INTO `questlist` VALUES (34, '5', '3', '5002'); -INSERT INTO `questlist` VALUES (35, '5', '1', '5020'); -INSERT INTO `questlist` VALUES (36, '5', '3', '5012'); -INSERT INTO `questlist` VALUES (37, '5', '3', '5013'); -INSERT INTO `questlist` VALUES (38, '5', '5', '5013'); -INSERT INTO `questlist` VALUES (39, '7', '1', '7001'); -INSERT INTO `questlist` VALUES (40, '7', '5', '7001'); -INSERT INTO `questlist` VALUES (41, '8', '1', '8001'); -INSERT INTO `questlist` VALUES (42, '8', '1', '8002'); -INSERT INTO `questlist` VALUES (43, '9', '7', '9001'); -INSERT INTO `questlist` VALUES (44, '8', '3', '8001'); -INSERT INTO `questlist` VALUES (45, '9', '1', '9001'); -INSERT INTO `questlist` VALUES (46, '8', '3', '8002'); -INSERT INTO `questlist` VALUES (47, '8', '2', '8004'); -INSERT INTO `questlist` VALUES (48, '7', '1', '8002'); -INSERT INTO `questlist` VALUES (49, '8', '5', '8001'); -INSERT INTO `questlist` VALUES (50, '8', '5', '8002'); -INSERT INTO `questlist` VALUES (51, '8', '3', '8003'); +INSERT INTO `questlist` VALUES (1, '6', '3', '6034'); +INSERT INTO `questlist` VALUES (2, '6', '10', '6021'); +INSERT INTO `questlist` VALUES (3, '6', '10', '6020'); +INSERT INTO `questlist` VALUES (4, '6', '5', '6016'); +INSERT INTO `questlist` VALUES (5, '9', '10', '9003'); +INSERT INTO `questlist` VALUES (6, '9', '5', '9004'); +INSERT INTO `questlist` VALUES (7, '6', '10', '6001'); +INSERT INTO `questlist` VALUES (8, '6', '5', '6002'); +INSERT INTO `questlist` VALUES (9, '6', '1', '6012'); +INSERT INTO `questlist` VALUES (10, '9', '5', '9002'); +INSERT INTO `questlist` VALUES (11, '6', '10', '6002'); +INSERT INTO `questlist` VALUES (12, '6', '10', '6022'); +INSERT INTO `questlist` VALUES (13, '6', '1', '6105'); +INSERT INTO `questlist` VALUES (14, '4', '1', '6003'); +INSERT INTO `questlist` VALUES (15, '4', '1', '6001'); +INSERT INTO `questlist` VALUES (16, '10', '5', '10001'); +INSERT INTO `questlist` VALUES (17, '2', '10', '2002'); +INSERT INTO `questlist` VALUES (18, '11', '3', '6001'); +INSERT INTO `questlist` VALUES (19, '12', '1', '6001'); +INSERT INTO `questlist` VALUES (20, '3', '5', '3001'); +INSERT INTO `questlist` VALUES (21, '11', '2', '11001'); +INSERT INTO `questlist` VALUES (22, '1', '1', '1001'); +INSERT INTO `questlist` VALUES (23, '1', '3', '1001'); +INSERT INTO `questlist` VALUES (24, '1', '5', '1001'); +INSERT INTO `questlist` VALUES (25, '8', '5', '8001'); +INSERT INTO `questlist` VALUES (26, '7', '1', '7001'); +INSERT INTO `questlist` VALUES (27, '7', '5', '7001'); +INSERT INTO `questlist` VALUES (28, '8', '1', '8001'); +INSERT INTO `questlist` VALUES (29, '8', '1', '8002'); +INSERT INTO `questlist` VALUES (30, '9', '7', '9001'); +INSERT INTO `questlist` VALUES (31, '8', '3', '8001'); +INSERT INTO `questlist` VALUES (32, '7', '1', '8002'); +INSERT INTO `questlist` VALUES (33, '9', '1', '9001'); +INSERT INTO `questlist` VALUES (34, '8', '1', '8003'); +INSERT INTO `questlist` VALUES (35, '8', '3', '8002'); +INSERT INTO `questlist` VALUES (36, '5', '5', '5013'); +INSERT INTO `questlist` VALUES (37, '5', '5', '5001'); +INSERT INTO `questlist` VALUES (38, '5', '3', '5010'); +INSERT INTO `questlist` VALUES (39, '5', '3', '5011'); +INSERT INTO `questlist` VALUES (40, '5', '3', '5021'); +INSERT INTO `questlist` VALUES (41, '5', '2', '5004'); +INSERT INTO `questlist` VALUES (42, '5', '5', '5031'); +INSERT INTO `questlist` VALUES (43, '5', '3', '5002'); +INSERT INTO `questlist` VALUES (44, '5', '1', '5020'); +INSERT INTO `questlist` VALUES (45, '5', '3', '5010'); +INSERT INTO `questlist` VALUES (46, '5', '3', '5011'); +INSERT INTO `questlist` VALUES (47, '6', '7', '6035'); +INSERT INTO `questlist` VALUES (48, '8', '5', '8002'); +INSERT INTO `questlist` VALUES (49, '6', '10', '6121'); +INSERT INTO `questlist` VALUES (50, '1', '2', '1001'); +INSERT INTO `questlist` VALUES (51, '4', '3', '6122'); +INSERT INTO `questlist` VALUES (52, '6', '5', '6036'); +INSERT INTO `questlist` VALUES (53, '6', '3', '6200'); +INSERT INTO `questlist` VALUES (54, '4', '2', '6014'); +INSERT INTO `questlist` VALUES (55, '4', '5', '6014'); +INSERT INTO `questlist` VALUES (56, '6', '10', '6014'); -/*!40000 ALTER TABLE `questlist` ENABLE KEYS */; -UNLOCK TABLES; -DROP TABLE IF EXISTS `rewardlist`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `rewardlist` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `reward_type` int(10) unsigned NOT NULL, - `reward_quantity` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; -LOCK TABLES `rewardlist` WRITE; -/*!40000 ALTER TABLE `rewardlist` DISABLE KEYS */; -INSERT INTO `rewardlist` VALUES (1, 1, 1); -INSERT INTO `rewardlist` VALUES (2, 2, 4); -INSERT INTO `rewardlist` VALUES (3, 2, 5); -INSERT INTO `rewardlist` VALUES (4, 2, 6); -INSERT INTO `rewardlist` VALUES (5, 2, 10); -INSERT INTO `rewardlist` VALUES (6, 3, 200); -INSERT INTO `rewardlist` VALUES (7, 3, 400); -INSERT INTO `rewardlist` VALUES (8, 3, 500); -INSERT INTO `rewardlist` VALUES (9, 3, 750); -INSERT INTO `rewardlist` VALUES (10, 3, 1000); -INSERT INTO `rewardlist` VALUES (11, 3, 1500); -INSERT INTO `rewardlist` VALUES (12, 3, 2000); -INSERT INTO `rewardlist` VALUES (13, 3, 3000); -INSERT INTO `rewardlist` VALUES (14, 4, 1); -INSERT INTO `rewardlist` VALUES (15, 4, 3); -INSERT INTO `rewardlist` VALUES (16, 5, 1); -INSERT INTO `rewardlist` VALUES (17, 6, 1); -INSERT INTO `rewardlist` VALUES (18, 7, 1); -INSERT INTO `rewardlist` VALUES (19, 7, 2); -INSERT INTO `rewardlist` VALUES (20, 7, 3); -INSERT INTO `rewardlist` VALUES (21, 7, 5); -INSERT INTO `rewardlist` VALUES (22, 7, 6); -INSERT INTO `rewardlist` VALUES (23, 7, 9); -INSERT INTO `rewardlist` VALUES (24, 7, 10); -INSERT INTO `rewardlist` VALUES (25, 8, 2); -INSERT INTO `rewardlist` VALUES (26, 9, 1); -INSERT INTO `rewardlist` VALUES (27, 9, 5); -INSERT INTO `rewardlist` VALUES (28, 10, 1); -INSERT INTO `rewardlist` VALUES (29, 10, 3); -INSERT INTO `rewardlist` VALUES (30, 10, 4); -INSERT INTO `rewardlist` VALUES (31, 10, 5); -INSERT INTO `rewardlist` VALUES (32, 10, 6); -INSERT INTO `rewardlist` VALUES (33, 10, 10); -INSERT INTO `rewardlist` VALUES (34, 11, 1); -INSERT INTO `rewardlist` VALUES (35, 11, 3); -INSERT INTO `rewardlist` VALUES (36, 12, 1); -INSERT INTO `rewardlist` VALUES (37, 12, 2); -INSERT INTO `rewardlist` VALUES (38, 12, 3); -INSERT INTO `rewardlist` VALUES (39, 12, 4); -INSERT INTO `rewardlist` VALUES (40, 12, 5); -INSERT INTO `rewardlist` VALUES (41, 12, 6); -INSERT INTO `rewardlist` VALUES (42, 12, 10); -INSERT INTO `rewardlist` VALUES (43, 13, 1); -INSERT INTO `rewardlist` VALUES (44, 13, 3); -INSERT INTO `rewardlist` VALUES (45, 14, 1); -INSERT INTO `rewardlist` VALUES (46, 15, 1); -INSERT INTO `rewardlist` VALUES (47, 16, 1); -INSERT INTO `rewardlist` VALUES (48, 17, 1); -INSERT INTO `rewardlist` VALUES (49, 18, 1); -INSERT INTO `rewardlist` VALUES (50, 19, 1); -/*!40000 ALTER TABLE `rewardlist` ENABLE KEYS */; +/*!40000 ALTER TABLE `questlist` ENABLE KEYS */; UNLOCK TABLES; DROP TABLE IF EXISTS `encounterlist`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -150,66 +109,70 @@ CREATE TABLE `encounterlist` ( `quest_id` int(10) unsigned NOT NULL, `pokedex_ids` varchar(20) DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=137 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; /*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `encounterlist` WRITE; /*!40000 ALTER TABLE `encounterlist` DISABLE KEYS */; /* Complete new build up the list*/; -INSERT INTO `encounterlist` VALUES (1, '1', '102,325'); -INSERT INTO `encounterlist` VALUES (2, '2', '126'); -INSERT INTO `encounterlist` VALUES (3, '3', '113'); -INSERT INTO `encounterlist` VALUES (4, '4', '133,16'); -INSERT INTO `encounterlist` VALUES (5, '5', '1,4,7'); -INSERT INTO `encounterlist` VALUES (6, '6', '227'); -INSERT INTO `encounterlist` VALUES (7, '8', '103'); -INSERT INTO `encounterlist` VALUES (8, '9', '353'); -INSERT INTO `encounterlist` VALUES (9, '10', '287'); -INSERT INTO `encounterlist` VALUES (10, '13', '129,216'); -INSERT INTO `encounterlist` VALUES (11, '14', '60,37'); -INSERT INTO `encounterlist` VALUES (12, '15', '147'); -INSERT INTO `encounterlist` VALUES (13, '16', '70'); -INSERT INTO `encounterlist` VALUES (14, '20', '317'); -INSERT INTO `encounterlist` VALUES (15, '21', '294'); -INSERT INTO `encounterlist` VALUES (16, '22', '58'); -INSERT INTO `encounterlist` VALUES (17, '23', '50'); -INSERT INTO `encounterlist` VALUES (18, '24', '311,312'); -INSERT INTO `encounterlist` VALUES (19, '25', '86'); -INSERT INTO `encounterlist` VALUES (20, '26', '261'); -INSERT INTO `encounterlist` VALUES (21, '27', '286'); -INSERT INTO `encounterlist` VALUES (22, '28', '92,345,347'); -INSERT INTO `encounterlist` VALUES (23, '29', '74,100'); -INSERT INTO `encounterlist` VALUES (24, '30', '95'); -INSERT INTO `encounterlist` VALUES (25, '31', '246'); -INSERT INTO `encounterlist` VALUES (26, '38', '327'); -INSERT INTO `encounterlist` VALUES (27, '39', '56,296'); -INSERT INTO `encounterlist` VALUES (28, '40', '66'); -INSERT INTO `encounterlist` VALUES (29, '41', '1,4,7'); -INSERT INTO `encounterlist` VALUES (30, '43', '125'); -INSERT INTO `encounterlist` VALUES (31, '44', '124'); -INSERT INTO `encounterlist` VALUES (32, '47', '302'); -INSERT INTO `encounterlist` VALUES (33, '48', '307'); -INSERT INTO `encounterlist` VALUES (34, '49', '88'); -INSERT INTO `encounterlist` VALUES (35, '50', '142'); -INSERT INTO `encounterlist` VALUES (36, '51', '138,140'); +INSERT INTO `encounterlist` VALUES (2, '2', '140'); +INSERT INTO `encounterlist` VALUES (3, '3', '27'); +INSERT INTO `encounterlist` VALUES (4, '4', '81'); +INSERT INTO `encounterlist` VALUES (5, '5', '129'); +INSERT INTO `encounterlist` VALUES (6, '6', '104'); +INSERT INTO `encounterlist` VALUES (7, '7', '129,228'); +INSERT INTO `encounterlist` VALUES (8, '8', '37,60'); +INSERT INTO `encounterlist` VALUES (9, '9', '147'); +INSERT INTO `encounterlist` VALUES (10, '10', '58'); +INSERT INTO `encounterlist` VALUES (14, '14', '142'); +INSERT INTO `encounterlist` VALUES (15, '15', '133,191'); +INSERT INTO `encounterlist` VALUES (16, '16', '1,4,7'); +INSERT INTO `encounterlist` VALUES (18, '18', '37'); +INSERT INTO `encounterlist` VALUES (19, '19', '310'); +INSERT INTO `encounterlist` VALUES (20, '20', '73'); +INSERT INTO `encounterlist` VALUES (21, '21', '92'); +INSERT INTO `encounterlist` VALUES (22, '22', '102,209'); +INSERT INTO `encounterlist` VALUES (23, '23', '126'); +INSERT INTO `encounterlist` VALUES (24, '24', '113'); +INSERT INTO `encounterlist` VALUES (25, '25', '131'); +INSERT INTO `encounterlist` VALUES (26, '26', '56,66'); +INSERT INTO `encounterlist` VALUES (27, '27', '66'); +INSERT INTO `encounterlist` VALUES (28, '28', '1,4,7'); +INSERT INTO `encounterlist` VALUES (30, '30', '125'); +INSERT INTO `encounterlist` VALUES (31, '31', '124'); +INSERT INTO `encounterlist` VALUES (32, '32', '97'); +INSERT INTO `encounterlist` VALUES (34, '34', '138,140'); +INSERT INTO `encounterlist` VALUES (36, '36', '327'); +INSERT INTO `encounterlist` VALUES (37, '37', '100,399'); +INSERT INTO `encounterlist` VALUES (38, '38', '92,347,345'); +INSERT INTO `encounterlist` VALUES (39, '39', '95'); +INSERT INTO `encounterlist` VALUES (40, '40', '246'); +INSERT INTO `encounterlist` VALUES (47, '47', '347'); +INSERT INTO `encounterlist` VALUES (48, '48', '142'); +INSERT INTO `encounterlist` VALUES (52, '52', '121'); +INSERT INTO `encounterlist` VALUES (53, '53', '387'); +INSERT INTO `encounterlist` VALUES (54, '54', '114'); +INSERT INTO `encounterlist` VALUES (55, '55', '3'); /*!40000 ALTER TABLE `encounterlist` ENABLE KEYS */; UNLOCK TABLES; -DROP TABLE IF EXISTS `quick_questlist`; +DROP TABLE IF EXISTS `rewardlist`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `quick_questlist` ( +CREATE TABLE `rewardlist` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `quest_id` int(10) unsigned NOT NULL, - `reward_id` int(10) unsigned NOT NULL, + `reward_type` int(10) unsigned NOT NULL, + `reward_quantity` int(10) unsigned NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; /*!40101 SET character_set_client = @saved_cs_client */; LOCK TABLES `quick_questlist` WRITE; /*!40000 ALTER TABLE `quick_questlist` DISABLE KEYS */; -INSERT INTO `quick_questlist` VALUES (1,38,1); - +INSERT INTO `quick_questlist` VALUES (1,53,1); +INSERT INTO `quick_questlist` VALUES (2,54,1); +INSERT INTO `quick_questlist` VALUES (3,55,1); +INSERT INTO `quick_questlist` VALUES (4,56,10); /*!40000 ALTER TABLE `quick_questlist` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; diff --git a/webhook.html b/webhook.html new file mode 120000 index 0000000..16cc45e --- /dev/null +++ b/webhook.html @@ -0,0 +1 @@ +core/tools/webhook.html \ No newline at end of file