Код:
from flask import Flask
from flask import Flask, request, json
import telebot
import json
import vk_api
telegram = telebot.TeleBot('127****421**AFyu7i8-n9j*****N***SAc********SY')
vk_session = vk_api.VkApi(token='ac********c****40f6****927f84****d7616b7d514f82****22e339901****ada3811e****ea3****')
vk = vk_session.get_api()
app = Flask(__name__)
@app.route('/', methods=['POST'])
def processing():
data = json.loads(request.data)
telegram.send_message(973302492, str(data))
if 'type' not in data.keys():
return 'not vk'
elif data['type'] == 'wall_repost':
if data['secret'] == '6tgfGJhgfygjdrsjb':
vk.messages.send(random_id=0, user_id=int(data['object']['from_id']), message='Ты сделал репост записи, спасибо')
return '12909e1a'
@app.route('/test')
def test():
telegram.send_message(973302492, 'Working')
return 'Working GG'
Хостинг:
pythonanywhere.com
Error log:
2020-08-27 12:31:44,371: Starting new HTTPS connection (1): api.telegram.org
Остальное на скринах: