Skip to content

Commit

Permalink
Rearranged code
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninjasoturi committed Aug 23, 2021
1 parent 3844454 commit b0eb18d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions logic/update_raid_poll.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ function update_raid_poll($raid_id, $raid = false, $update = false, $tg_json = f
$raid['pokemon'] = 'ended';
}
require_once(LOGIC_PATH . '/raid_picture.php');
$picture_url = raid_picture_url($raid);
}

foreach($chat_and_message as $chat_id_msg_id) {
$chat = $chat_id_msg_id['chat_id'];
$message = $chat_id_msg_id['message_id'];
$type = $chat_id_msg_id['type'];
if($type == 'poll_photo') {
$picture_url = raid_picture_url($raid);
// If the poll message gets too long, we'll replace it with regular text based poll
if($post_text == true) {
// Delete raid picture and caption.
Expand Down Expand Up @@ -110,11 +110,6 @@ function update_raid_poll($raid_id, $raid = false, $update = false, $tg_json = f
$tg_json[] = editMessageText($message, $text['full'], $keys, $chat, ['disable_web_page_preview' => 'true'], true);
}
}else if ($type == 'photo' && !$skip_picture_update) {
$time_now = utcnow();
if($time_now > $raid['end_time'] ) {
$raid['pokemon'] = 'ended';
}
require_once(LOGIC_PATH . '/raid_picture.php');
$picture_url = raid_picture_url($raid, 1);
$tg_json[] = editMessageMedia($message, '', '', $chat, [], true, $picture_url);
}
Expand Down

0 comments on commit b0eb18d

Please sign in to comment.