1

I have started a simple bot with two message handlers, one of them is echo function and second one to respond for a command, just to check how it is working in pythonanywhere. Everything is working fine, but after I have run my script I tried to stop it and so I tried to killed my task in task section. Now it is written that I don't have any running tasks, but my bot is still running. So how can I stop my bot?

I have deleted file of my bot from file section, and also I have disabling web

Here is my cod:

from flask_sslify import SSLify
from flask import Flask

from aiogram import Bot, types, executor, Dispatcher

PROXY_URL = "http://proxy.server:3128"
app = Flask(__name__)
sslify = SSLify(app)

bot1= Bot(token='token', proxy=PROXY_URL)
dp1=Dispatcher(bot1)

def on_startup1():
    print("Бот 1 вышел в онлайн")

@dp1.message_handler(commands=['Подивитись'])
async def check_info_from_database(message: types.message):
    await bot1.send_message(user_id, "Some text")

@dp1.message_handler()
async def echo(message: types.message):
    await message.answer(message.text)

executor.start_polling(dp1, skip_updates=True, on_startup=on_startup1())
  • How did you run it? – Filip Sep 01 '23 at 11:32
  • Actually here can be a problem. I have noticed that when I run my bot using flask and changing flask section in wsgi configuration file nothing changed even if I remove and set new bot file. But then I tried to simply run bot file without using flask and now I have 2 bots running. I still don't know how to turn off them, but I think the reason of the problem somewhere here. – Ярослав Кузьмін Sep 02 '23 at 08:18

0 Answers0