from aiogram import Bot, types
from aiogram.dispatcher import Dispatcher
from aiogram.types import ReplyKeyboardMarkup, KeyboardButton, WebAppInfo
from aiogram.utils import executor
import asyncio
web_app = WebAppInfo(url = 'https://qwe***1.github.io/1')
tokens = [321321,123132] #это типо бд - я не тот код запихал сюда
async def start_bot(dp):
event_loop.create_task(dp.start_polling())
key = ReplyKeyboardMarkup(
keyboard=[
[KeyboardButton(text='site',web_app=web_app)]
],
resize_keyboard=True
)
def bot_init(event_loop, token):
bot = Bot(token)
dp = Dispatcher(bot=bot)
@dp.message_handler(commands=['start'])
async def process_start_command(message: types.Message):
await message.reply("Привет!\nпошел нахуй!",reply_markup=key)
@dp.message_handler()
async def process_start_command(message: types.Message):
await message.reply(message.text)
event_loop.run_until_complete(start_bot(dp))
if __name__ == '__main__':
event_loop = asyncio.get_event_loop()
for token in tokens: # приемник токенов
bot_init(event_loop, token)
event_loop.run_forever()