forked from pokepark/PokemonRaidBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NEW: /listall /list now displays up to 12 raids, if more raids are in the system it automatically switches to /listall which can be called independently too. TODO: Update readme Update /help
- Loading branch information
Showing
12 changed files
with
384 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.1.035.1 | ||
2.1.035.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
// Write to log. | ||
debug_log('LIST'); | ||
|
||
// For debug. | ||
//debug_log($update); | ||
//debug_log($data); | ||
|
||
// Check access. | ||
bot_access_check($update, 'list'); | ||
|
||
// Set message. | ||
$msg = '<b>' . getTranslation('list_all_active_raids') . '</b>' . CR; | ||
$msg .= '<b>' . getTranslation('select_gym_first_letter') . '</b>' . CR; | ||
|
||
// Set keys. | ||
$keys = raid_edit_gyms_first_letter_keys('list_by_gym'); | ||
|
||
// Send message. | ||
send_message($update['message']['chat']['id'], $msg, $keys, ['reply_markup' => ['selective' => true, 'one_time_keyboard' => true], 'disable_web_page_preview' => 'true']); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
/** | ||
* Get raid data by gym_id | ||
* @param $gym_id | ||
* @return array | ||
*/ | ||
function get_raid_by_gym($gym_id) | ||
{ | ||
// Get the raid data by gym_id. | ||
$rs = my_query( | ||
" | ||
SELECT raids.*, | ||
gyms.lat, gyms.lon, gyms.address, gyms.gym_name, gyms.ex_gym, gyms.gym_note, | ||
users.name, | ||
TIME_FORMAT(TIMEDIFF(end_time, UTC_TIMESTAMP()) + INTERVAL 1 MINUTE, '%k:%i') AS t_left, | ||
TIMESTAMPDIFF(MINUTE,raids.start_time,raids.end_time) as t_duration | ||
FROM raids | ||
LEFT JOIN gyms | ||
ON raids.gym_id = gyms.id | ||
LEFT JOIN users | ||
ON raids.user_id = users.user_id | ||
WHERE end_time>UTC_TIMESTAMP() | ||
AND gyms.id = {$gym_id} | ||
" | ||
); | ||
|
||
// Get the row. | ||
$raid = $rs->fetch(); | ||
|
||
// Inject raid level | ||
$raid['level'] = get_raid_level($raid['pokemon'], $raid['pokemon_form']); | ||
|
||
debug_log($raid); | ||
|
||
return $raid; | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.