Giter Club home page Giter Club logo

pokepark / pokemonraidbot Goto Github PK

View Code? Open in Web Editor NEW
48.0 7.0 38.0 7.73 MB

Telegram bot for organizing Raids in Pokémon Go. Developers & admins are welcome to join https://t.me/PokeParkSupport

Home Page: https://t.me/PokeParkSupport

License: GNU Affero General Public License v3.0

PHP 97.65% Python 0.63% Dockerfile 0.13% Shell 0.38% HCL 0.61% HTML 0.59%
raid-polls raid-message raid-egg raids-bosses telegram-bot raid-level raid-overview raid-picture raid-creation bot-folder

pokemonraidbot's Introduction

PokemonRaidBot

Documentation Status

Telegram webhook bot for organizing raids in Pokemon Go. Developers & Admins are welcome to join https://t.me/PokeParkSupport

Documentation

This README only contains very limited information. For detailed configuration and installation help see the full documentation.

Example screenshots

Default text poll:

Example raid poll

With raid picture:

Example raid poll

Basic installation

There is no central bot and every community runs their own. While this means installation is quite involved, it also provides you maximum flexibility and features.

We recommend Docker for novice admins since it's the most controlled environment but it also still has many pitfalls associated. The full documentation has more installation options including fully manual into any LAMP webhosting solution.

pokemonraidbot's People

Contributors

bonny1992 avatar chefkeks avatar dnsblah avatar florianbecker avatar gervasiocaj avatar jinnatar avatar klablabla avatar korentzari avatar lordy2 avatar meridorx avatar muckelba avatar mygamecodescom avatar nepixl avatar ninjasoturi avatar pjf16 avatar pogoflow avatar studplus avatar szezilla avatar timvandenoever avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pokemonraidbot's Issues

easier /pokemon

When we send /pokemon to the bot. I would be nice to only see active hatched raids.

Exclude GymIDs from Duplicate Check

I want still to be able to post "Raid Meeting" as a virtual pokemon on a specific gym. with the new duplicate check it is unable to post further raids on the gym where the "Raid Meeting" also starts.

It would be nice if there will be a setting where you can define one or more gyms which will be excluded from the duplicate check.

Cleanup fails for multigroup setups

Originally reported by @LordyGibtsSchon

For one group cleanup data is recorded correctly:

[2020-07-19 10:50:00.0570][3363] [logic.php:1720] *   0 =>
[2020-07-19 10:50:00.0570][3363] [logic.php:1720] *   array (
[2020-07-19 10:50:00.0570][3363] [logic.php:1720] *     'id' => '1126',
[2020-07-19 10:50:00.0570][3363] [logic.php:1720] *     'raid_id' => '2451',
[2020-07-19 10:50:00.0570][3363] [logic.php:1720] *     'chat_id' => '-1001422333',
[2020-07-19 10:50:00.0570][3363] [logic.php:1720] *     'message_id' => '10207',
[2020-07-19 10:50:00.0570][3363] [logic.php:1720] *     'cleaned' => '0',
[2020-07-19 10:50:00.0570][3363] [logic.php:1720] *   ),

But for another:

[2020-07-06 09:40:00.0535][3367] [logic.php:1717] *   163 =>
[2020-07-06 09:40:00.0535][3367] [logic.php:1717] *   array (
[2020-07-06 09:40:00.0535][3367] [logic.php:1717] *     'id' => '527',
[2020-07-06 09:40:00.0535][3367] [logic.php:1717] *     'raid_id' => '998',
[2020-07-06 09:40:00.0535][3367] [logic.php:1717] *     'chat_id' => '0',
[2020-07-06 09:40:00.0535][3367] [logic.php:1717] *     'message_id' => '0',
[2020-07-06 09:40:00.0535][3367] [logic.php:1717] *     'cleaned' => '0',
[2020-07-06 09:40:00.0535][3367] [logic.php:1717] *   ),

No chat_id & message_id, no way to clean it up.

Empty gym list for gym names with Chinese letters

Hi guys, I think my community found a small bug in the RaidBot code.

We have an Arena with the beautiful name '金門大學正門'. Unfortunately it is not selectable anymore. While the first letter shows up in the letter selection message, when pressed however, the actual arena does not show up as a selection.

I assume the issue lies in the function raid_edit_gym_keys in logic.php. In line 1057 the SQL query is built with the $first_length variable which itself is derived from the length of the $first letter of the gym name. (line 1032). In our case the Chinese letter '金' yields a $first_length of 3, which in turn breaks the SQL query ... WHERE UPPER(LEFT(gym_name, 3)) ....

My workaround for now is to override the strlen($first) statement. If I set $first_length to 1, everything works fine.

Special characters are not displayed properly via raidpicture.php

In our local gym-pool there is one gym with the wonderful name "金門大學正門". We shortly switched to the beautiful Raid-Picture mode wich everybody likes and is really working nicely, except when it comes to displaying raids on said gym. All Chinese characters are replaced with question marks (see attached picture)

raidpicture

Alert when egg is hatching to pokemon.

We can now receive alerts when users are changing input.
Would be nice when the egg is hatched and updated in the raid bot that the user also receive an alert.
What is in the egg.

Missing autorefresh of same raid-posts between several groups

Hello,

at the moment there´s no autorefresh for same raid-posts in several groups. While the raid-overview gets continuously synchronized between the groups by a cronjob, the last editing of a single raid-post does not synchronize with the same post in another group. Both posts run with the same raid ID. Can a cronjob be set up for the autorefresh?

missingautorefreshred

Save gym locations and pick from nearby gyms

Please add the option to save a gym location and allow us to select from a list of nearby gyms when posting location. This will eliminate almost any need for / commands.

Also make sure group admins are the only ones that can register new gyms.

Pokebattler Import

  • Add a command like /import with raid level, eg. /import 3 to automatically import raid bosses. Telegram scheduled messages :D
  • Allow import of level X raid bosses

Pokedex pokebattler import disables L5 eggs but raids from webhook don't take this into account

The Pokedex pokebattler import disables L5 eggs if there's only one L5 raidboss, which makes sense.
However, webhooks will still push in L5 eggs which are then classified as unknown, and certain rules apply unevenly. For example if voting is disabled, it still shows up for unknown since we don't know the level. Oops.

Solution:
The raid from webhook functionality needs to also detect the scenario where only one L5 boss exists and re-route the raid into that L5 boss.

Alternative solution:
If the webhook is enabled in the config, don't disable the L5 eggs. Easier to implement but inconsistent results.

Add commands like /raidlevel5

Add commands like /raidlevel5 to allow quick updating of the raid bosses. Useful especially to enable/disable raid bosses at a specific time - think of scheduled telegram messages!

Share Chats only for Moderators

At the moment when the Share Chat Feature is enabled also Users can Share Raids to a defined chat although the Bot is restricted to Moderators.

if
define ('SHARE_MODERATORS', true);
and
define('SHARE_USERS', false);

then the SHARE_MODERATORS should also be active for the SHARE_CHAT Feature not only for the Share.... Feature.

Chosing Pokemon as a Raidboss

Same Structure as in Gyms with A-Z Rooster like:
A-Z Rooster -> click on A
List of A Pokemon -> click on e.g. Abra
Abra options:
No Raidboss
Tier 1 Boss
Tier 2 Boss
Tier 3 Boss
Tier 4 Boss
Tier 5 Boss
Ex Raid Boss

Geofence for webhook

There is no geofence currently. If a raid from outside the geofence is detected. It will add it to the gym database.
There should also be a check before adding to the database for unknow gym name.

Notes for gyms

Somehting that has come up often is a notes field linked to the gym.

Like "enter from first avenue" or "park on Hazelwood side of Charles"

Notes that experienced raiders know but new players miss leading to new players missing raids because of parking where Google says to go instead of where everyone reaches the gym without being in a busy road.

Change Pokemon via /list troughout to all raid levels

When you create a raid egg e.g. Level 4, you can update the pokemon to the specific one after egg is hatched.

could you implement a function that you can update to every raid level with every pokemon. Use Case is if someone created a level 4 Raid although it is a level 5 Raid you have to delete the whole raid and create it anew.

with this function you can "update" the raid from a level 4 to a level 5 raid.

Importing Gym Picture

When Importing a Gym via Importfunction of Portalmapbot the entry in DB created a local folder with the gympicture, instead of the Link to the ingress/google storage where the picture is stored.

could this be made configurable that user can choose if he want to link a local picture or using the picture of ingress/google storage?!

Thx

Ability to have bot send silent messages.

As I proposed in telegram it would be very beneficial for some raid groups to be able to configure silent messages for the bot especially with the use of automatic raid posting through webhook.

Body Template System

Create a system to use templates

Templates:
More relevant data first template
Current standard look
Minimal template

Instructions for new raiders

New users welcome message: We could check if the user is already in the database and if it’s a new user, voting for the first time, we could send him info (which should be customizable) etc. along with maybe EU-GDPR agreement, which the bot misses too currently. Along with a \dsgvo or \eugdpr or ???? command to view and delete his data from the users table.

Select multiple raid bosses

If there are more than one raid boss and you are able to choose a raid boss, enable selection of more raid bosses

Sharing to Channel linked to a Supergroup works weird, buttons missing and not updating

Repro:

  1. Create / use existing Telegram Channel, find id
  2. Link the channel to a Supergroup as it's "discussion group"
  3. Add the channel id to e.g. SHARE_CHATS_LEVEL_5
  4. Create a raid, share it to the channel via the button share method

Expected results:

  • Raid is shared to channel which auto-forwards it to the supergroup.
  • Buttons to vote for first suggested start time are visible both in the channel and the discussion group.
  • After the initial vote, all buttons appear in both.
  • Button data is collected from both.
  • Updated data is reflected after button clicks from either the channel or the discussion group.

Actual results:

  • Raid is shared to channel which auto-forwards it to the supergroup.
  • Buttons to vote for first suggested start time are visible only in the channel, the discussion group only has the info section.
  • If the initial time vote is done on the channel, all buttons appear in both.
  • Button data is collected from both.
  • Updated data is only reflected after button clicks from the channel, discussion group presses only show in the data after an action on the channel.

Sharing EX longer than 48h.

We share the EX raid more then 48hours prior to the raid. The bot is not allowed to delete the raid.
When we exceed the 1024 char it is reposting the EX raid, but he is not deleting the old one.
Problem is that it keep reposting the raid. Deleting the EX raid with picture will solve this manuelly.

I think it is best to post EX raids longer than 48 prior to the raid without an raid picture.

Undefined index: apikey

Hi,
i have set up your setting with my Google API Key and Telegram Bot Token.
when i send "/start" to the Bot I get just the IP "149.154.167.207" back.
I found this on my logfile:

PHP Notice: Undefined index: apikey in /var/www/html/raid.serko.rocks/web/public/core/class/apikey.php on line 17

Do you have clue why this happens?

Raid picture not updating with webhook

The webhook post the egg. We can share the raid.
When the egg hatched it's not updating the picture from egg to pokemon.
Sharing after hatch it will show the pokemon.

Only a problem with the webhook from MAD.

Feature Request: Create Polls triggered by user

Our Town is scanning and creating polls for raids automatically, but that causes a bit spam and gets a bit messy. A solution would be to only have the raid-overview and add a link or button to create the poll when needed. So only interesting polls exist in the channel/chat.

The raids would be still in the database, but not posted. I'm not sure how complicated it is at the moment to implement that, but i would love to see that kind of option 😄

Error importing gym with single quote "'" in name

I was trying to import a gym via "@PortalMapBot Winkel's Eisbar".
The name went un-escaped into an SQL-statement which lead to an error:

[2020-01-24 13:30:38.8265][18] [importal.php:44] ? SELECT id, COUNT(*)
[2020-01-24 13:30:38.8265][18] [importal.php:44] ? FROM gyms
[2020-01-24 13:30:38.8265][18] [importal.php:44] ? WHERE gym_name = 'Winkel's Eisbar'
[2020-01-24 13:30:38.8265][18] [importal.php:44] ?
[2020-01-24 13:30:38.8273][18] [importal.php:44] ! You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 's Eisbar'' at line 3

Mark Ex-Raid Gyms in Gym-List

Implementation of e.g. a Star Emoji in front of all gyms which were ex_gym 1 in gym table. Star Emoji should appear in Rooster where you can chose the gym.

Pro: Find Ex-Gyms faster.
Cons: None

Add RAID_FIRST_START option

From our chat:
Question:

"the range from raid start to first vote button i cant find a setting for"

Answer:

There is no setting for that yet.
It depends on you settings.
We have 15 minute slots here, so:
a) if a raid egg opens :01 the first option will be :15
b) if a raid egg opens :00 the first option will be :00 too

Therefore users here asked if I can add an option if the egg opens at e.g. :01 to raid at :05 since there are still 10 minutes between :05 and :15. But due to the lack of time I'm currently not yet working on it - but that would be the plan to allow the first time (rounded to 5) if it makes sense.
So for example if the egg opens :06 it doesn't really make sense for me with 15 minute slots to offer :10 and :15 then as voting times.

This could basically work in the same way the "RAID_LAST_START" works, just for the first start option.

Plan for the feature:
We shall add a RAID_FIRST_START option where you can specify the minimum amount of time in minutes to add an extra voting option like :05 for case a) if that amount of time is given between the raid-start (rounded up to the next 5 minute slot) and the first voting option.

History command

Would sometimes be nice to find out who signed up for a raid etc.without having to look into the database.

Exclude reported EX-Raids from duplicate check

Summary

There is no way to post a new raid (e.g. one starting in about an hour) if there has already been reported an EX-Raid starting in a few days.

Possible fixes

Duplicate check should warn and users should not be able to create a new raid during the same time frame a raid has already been reported. Maybe this is only necessary if there's an Ex-Raid. So Ex-Raids should be excluded from duplicate checks.

Adjust /exreport

/exreport was created to get an overview how many ppl were needed to get a gym triggered for the first time. Nowadays many gyms were triggered so my thoughts were to adjust the report to show how many individual accounts have raided on a ex-gym within a trigger week. Studys of Silph Road have shown that 20 individual accounts are needed to let a gym distribute ex-raid passes.

/exreport should show
Gym Name | Number of Raids | Number of individual accounts | for the last 7 days (depends on when /exreport command is using)

Raids with Level X should be excluded, as we only want to see the Level 1-5 Raids which were done on the gym, as the Ex-Raid taken on this gym don't count for the next trigger period.

Pros: Adjusting the /exreport command will get a quick overview which gyms have already 20+ individual accounts raided on.

Cons: the +1s weren't clearly identified if those accounts were already at those gyms or not.

Raid any time: Change attend time entry

When sql_mode is set to "…NO_ZERO_IN_DATE,NO_ZERO_DATE…" the current entry "0000-00-00 00:00:00" is not accepted by the database as a valid date.

When sql_mode cannot be administered by the user, this is a potential problem, because clicking the "raid any time" button doesn't have any effect.

Using "1970-01-01 00:00:00" in vote_time.php would solve the problem of inserting a correct date/time. Other files would have to pick up that change as well, to move from "0000-00-00 00:00:00" to "1970-01-01 00:00:00".

get_raid_level fails when no other forms have yet been used ingame

Background info: Map-A-Droid/MAD#989
TL;DR; While the form_id will exist for a long time before a mon has more than one form it may not actually be used ingame until another form is published and they need to be deduped.

We however assume that the form_id will be "correct" when receiving raids over webhook so when MAD sees a Heatran raid it will happily send a form of 0 but we expect 1862.

The solution is on a zero form translate it to the normal form since that should be a safe bet. When/if another form is actually published we shouldn't receive a zero anymore and then it will keep on working correctly both for the old and the new form.

Inline raid poll sharing is always with text style, no picture

95336b4: Fix inline raid poll sharing

Did i misunderstood it, that it is still not possible to share raids WITH picture via Share... button, only to the chan which is maintaiend in config.json?

Currently the inline sharing does not respect RAID_PICTURE - this should be fixed.

Min/Max Values

update all available pokemon in pokemon.sql with their min/max values and min/max boosted values

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.