APP_URL = 'https://176.113.83.185'
bot = Bot(token='5973874857:', parse_mode='HTML', disable_web_page_preview=True)
dp = Dispatcher(bot)
async def on_startup(dp):
await bot.set_webhook(APP_URL)
async def on_shutdown(dp):
await bot.delete_webhook()
@dp.message_handler()
async def hi_command(message: types.Message):
await bot.send_message(message.chat.id, f'Привет {message.from_user.first_name}!\n\nЗдесь ты можешь задать свой вопрос по cleo bot')
executor.start_webhook(dispatcher = dp, webhook_path = '', host = '176.113.83.185', port = int(os.environ.get("PORT", 3001)), on_startup = on_startup, on_shutdown = on_shutdown, skip_updates=True)
APP_URL = 'http://176.113.83.185'
bot = Bot(token='token', parse_mode='HTML', disable_web_page_preview=True)
dp = Dispatcher(bot)
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
SSL_CERTIFICATE = open("webhook_cert.pem", "rb").read()
ssl_context.load_cert_chain("webhook_cert.pem", "webhook_pkey.pem")
WEBHOOK_HOST = f'https://176.113.83.185'
WEBHOOK_PORT = 8443
WEBHOOK_PATH = ''
WEBHOOK_URL = f'{WEBHOOK_HOST}:{WEBHOOK_PORT}{WEBHOOK_PATH}'
WEBAPP_HOST = '176.113.83.185'
WEBAPP_PORT = 3001
async def on_startup(dp):
await bot.set_webhook(url = WEBHOOK_URL, certificate = SSL_CERTIFICATE)
async def on_shutdown(dp):
await bot.delete_webhook()
@dp.message_handler(commands=['start'])
async def hi_command(message: types.Message):
await bot.send_message(message.chat.id, f'Привет {message.from_user.first_name}!\n\nЗдесь ты можешь задать свой вопрос по cleo bot')
#@dp.message_handler()
if __name__ == "__main__":
executor.start_webhook(dispatcher = dp, webhook_path = WEBHOOK_PATH, host = WEBAPP_HOST, port = WEBAPP_PORT, on_startup = on_startup, ssl_context = ssl_context)
{"ok":true,"result":{"url":"https://39ce-176-113-83-185.eu.ngrok.io:8443","has_custom_certificate":true,"pending_update_count":37,"last_error_date":1676212082,"last_error_message":"Connection timed out","max_connections":40,"ip_address":"18.158.249.75"}}
bot = Bot(token='token', parse_mode='HTML', disable_web_page_preview=True)
dp = Dispatcher(bot)
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
SSL_CERTIFICATE = open("webhook_cert.pem", "rb").read()
ssl_context.load_cert_chain("webhook_cert.pem", "webhook_pkey.pem")
WEBHOOK_HOST = f'https://39ce-176-113-83-185.eu.ngrok.io'
WEBHOOK_PORT = 8443
WEBHOOK_PATH = ''
WEBHOOK_URL = f'{WEBHOOK_HOST}:{WEBHOOK_PORT}{WEBHOOK_PATH}'
WEBAPP_HOST = '0.0.0.0'
WEBAPP_PORT = 3001
async def on_startup(dp):
await bot.set_webhook(url = WEBHOOK_URL, certificate = SSL_CERTIFICATE)
async def on_shutdown(dp):
await bot.delete_webhook()
@dp.message_handler(commands=['start'])
async def hi_command(message: types.Message):
await bot.send_message(message.chat.id, f'Привет {message.from_user.first_name}!\n\nЗдесь ты можешь задать свой вопрос по cleo bot')
#@dp.message_handler()
if __name__ == "__main__":
executor.start_webhook(dispatcher = dp, webhook_path = WEBHOOK_PATH, host = WEBAPP_HOST, port = WEBAPP_PORT, on_startup = on_startup, ssl_context = ssl_context)