Google Cloud Functions + Telegram Bot – What am I doing wrong ? /u/yaroyoss Python Education

Hello, I’m new here so please excuse my noobie questions, but do help if you can !

I have deployed a Google Cloud Function that is triggered via HTTPS that allows unauthenticated invocations running Python 3.12 and the entry point is ‘main’ – the function deploys correctly and the webhook is set properly. My goal is very simple – I just want the Telegram Bot to respond back to me with any string I send to it via DMs. Here is the code I am deploying on Google Cloud Functions – https://paste.pythondiscord.com/72MA

The requirements.txt file contains:

python-telegram-bot==20.3

requests==2.31.0

Flask==2.3.3

There are no errors, however when I enter the /start command, nothing happens apart from the code that gets executed that is manually entered with my bots chat_id within the main() function being – send_message(6271402111, “Test message from Google Cloud Function.”) – found on line 78

Any further text input only executes the same code on line 78 within the main() function as shown in this screenshot – https://imgur.com/a/P0nMqRu

I’m having a hard time understanding why the python code refuses to co-operate. I’ve tried running this issue multiple times past GTP4o and GPTo1 but I’m still stuck here.

I will continue to search for the answer myself, but I’m really hoping someone experience can have a glance at this and possibly spot what to them may be an obvious mistake.

Thank you for your time.

submitted by /u/yaroyoss
[link] [comments]

​r/learnpython Hello, I’m new here so please excuse my noobie questions, but do help if you can ! I have deployed a Google Cloud Function that is triggered via HTTPS that allows unauthenticated invocations running Python 3.12 and the entry point is ‘main’ – the function deploys correctly and the webhook is set properly. My goal is very simple – I just want the Telegram Bot to respond back to me with any string I send to it via DMs. Here is the code I am deploying on Google Cloud Functions – https://paste.pythondiscord.com/72MA The requirements.txt file contains: python-telegram-bot==20.3 requests==2.31.0 Flask==2.3.3 There are no errors, however when I enter the /start command, nothing happens apart from the code that gets executed that is manually entered with my bots chat_id within the main() function being – send_message(6271402111, “Test message from Google Cloud Function.”) – found on line 78 Any further text input only executes the same code on line 78 within the main() function as shown in this screenshot – https://imgur.com/a/P0nMqRu I’m having a hard time understanding why the python code refuses to co-operate. I’ve tried running this issue multiple times past GTP4o and GPTo1 but I’m still stuck here. I will continue to search for the answer myself, but I’m really hoping someone experience can have a glance at this and possibly spot what to them may be an obvious mistake. Thank you for your time. submitted by /u/yaroyoss [link] [comments] 

Hello, I’m new here so please excuse my noobie questions, but do help if you can !

I have deployed a Google Cloud Function that is triggered via HTTPS that allows unauthenticated invocations running Python 3.12 and the entry point is ‘main’ – the function deploys correctly and the webhook is set properly. My goal is very simple – I just want the Telegram Bot to respond back to me with any string I send to it via DMs. Here is the code I am deploying on Google Cloud Functions – https://paste.pythondiscord.com/72MA

The requirements.txt file contains:

python-telegram-bot==20.3

requests==2.31.0

Flask==2.3.3

There are no errors, however when I enter the /start command, nothing happens apart from the code that gets executed that is manually entered with my bots chat_id within the main() function being – send_message(6271402111, “Test message from Google Cloud Function.”) – found on line 78

Any further text input only executes the same code on line 78 within the main() function as shown in this screenshot – https://imgur.com/a/P0nMqRu

I’m having a hard time understanding why the python code refuses to co-operate. I’ve tried running this issue multiple times past GTP4o and GPTo1 but I’m still stuck here.

I will continue to search for the answer myself, but I’m really hoping someone experience can have a glance at this and possibly spot what to them may be an obvious mistake.

Thank you for your time.

submitted by /u/yaroyoss
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *