-
Автор темы
- #1
python:
from bs4 import BeautifulSoup
import requests
from telebot.async_telebot import AsyncTeleBot
import asyncio
API_TOKEN = ''
bot = AsyncTeleBot(API_TOKEN)
url = "https://blox-fruits.fandom.com/wiki/Blox_Fruits_%22Stock%22"
def check(url):
page = requests.get(url)
soup = BeautifulSoup(page.text, "html.parser")
a = soup.find('div', {'class': 'mw-collapsible', 'id': 'mw-customcollapsible-current'})
if 'Buddha' in str(a):
return True
@bot.message_handler(commands=['help', 'start'])
async def send_welcome(message):
while True:
if check(url) == True:
await bot.send_message(message.from_user.id, "БУДДА В СТОКЕ!!!")
if [B]name[/B] == '[B]main[/B]':
asyncio.run(bot.polling())