Skip to content

Commit a90285e

Browse files
committed
wip
1 parent 3408d70 commit a90285e

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

.github/workflows/google-cloudrun-docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Build and Deploy to Cloud Run
22
on:
33
push:
4-
pull_request:
4+
#pull_request:
55
workflow_dispatch:
66

77
env:

main.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
import telegram
22
import os
3+
from flask import Flask, request
34

5+
app = Flask(__name__)
46
bot = telegram.Bot(os.environ["TELEGRAM_BOT_TOKEN"])
57

6-
def webhook(request):
8+
@app.route('/webhook', methods=['POST'])
9+
def webhook():
710
if request.method == "POST":
811
update = telegram.Update.de_json(request.get_json(force=True), bot)
912
chat_id = update.message.chat.id
1013

1114
bot.sendMessage(chat_id=chat_id, text=update.message.text)
12-
return True
15+
return "OK"
16+
17+
if __name__ == "__main__":
18+
app.run(debug=True, host='0.0.0.0', port=int(os.environ.get('PORT', 8080)))

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ requests
55
python_telegram_bot==13.11
66
robobrowser==0.5.3
77
Werkzeug==0.15.5
8+
Flask
9+
gunicorn

0 commit comments

Comments
 (0)