Skip to content

Commit

Permalink
Update ToEnWikipediaBot.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jnton authored Apr 14, 2024
1 parent d92b99d commit 7ea6436
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ToEnWikipediaBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,13 @@ async def async_lambda_handler(event, context):
update_data = json.loads(event['body'])
update = Update.de_json(update_data, application.bot)
await application.process_update(update)
return {'statusCode': 200, 'body': 'Success'}
return {'statusCode': 200, 'body': json.dumps({'message': 'Success'})}
except Exception as e:
logger.error(f"An error occurred while processing the update: {str(e)}")
return {'statusCode': 500, 'body': 'Internal server error'}
logging.error(f"An error occurred while processing the update: {e}")
return {'statusCode': 500, 'body': json.dumps({'message': 'Internal server error'})}
else:
logger.error("No update payload found.")
return {'statusCode': 400, 'body': 'No update payload'}
logging.error("No update payload found.")
return {'statusCode': 400, 'body': json.dumps({'message': 'No update payload'})}

def lambda_handler(event, context):
print("Received event:", event) # Log the incoming event data
Expand Down

0 comments on commit 7ea6436

Please sign in to comment.