Skip to content

Commit

Permalink
remove original pic
Browse files Browse the repository at this point in the history
  • Loading branch information
arbadacarbaYK authored May 24, 2024
1 parent d0082ff commit 078a720
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pixelateTG.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ def button_callback(update: Update, context: CallbackContext) -> None:
query.message.delete() # Remove the message
return

processed_path = None

if query.data.startswith('pixelate'):
processed_path = process_image(photo_path, user_id, query.id, context.bot)
elif query.data.startswith('liotta'):
Expand All @@ -310,11 +312,10 @@ def button_callback(update: Update, context: CallbackContext) -> None:
processed_path = chad_overlay(photo_path, user_id, context.bot)
elif query.data.startswith('clowns_overlay'):
processed_path = clowns_overlay(photo_path, user_id, context.bot)
else:
return

context.bot.send_photo(chat_id=query.message.chat_id, photo=open(processed_path, 'rb'))

if processed_path:
context.bot.send_photo(chat_id=query.message.chat_id, photo=open(processed_path, 'rb'))
query.message.delete() # Remove the original message after successful processing for einzie


def main() -> None:
Expand Down

0 comments on commit 078a720

Please sign in to comment.