first init

This commit is contained in:
2025-06-04 11:27:24 +02:00
parent 2c12236a61
commit 565ea066b9
3 changed files with 33 additions and 0 deletions

25
app.py Normal file
View File

@ -0,0 +1,25 @@
from flask import Flask, request, jsonify
import requests
app = Flask(__name__)
@app.route('/', methods=['GET'])
def hello():
return jsonify({'message': 'Hello from Flask!'})
@app.route('/send', methods=['POST'])
def send():
data = request.get_json()
message_text = data.get('message', '')
token = "8125637902:AAHHOyAFNuWAo6SCViqvj6rnt2Oim3RdEvs"
url = f"https://api.telegram.org/bot{token}"
params = {"chat_id": "7951012135", "text": message_text}
r = requests.get(url + "/sendMessage", params=params)
return jsonify({'received_message': message_text})
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')

6
dockerfile Normal file
View File

@ -0,0 +1,6 @@
FROM python:3
WORKDIR /app
COPY . .
RUN pip install -r requirements.txt
EXPOSE 5000
CMD ["python", "app.py"]

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
Flask
requests