Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.80 KB | None | 0 0
  1.         if msg.text.lower().startswith("[ан"):
  2.             anagram = word = msg.text.split(":")[1].split("\n")[0].replace(" ", "")
  3.             response = await resp.text()
  4.             tree = html.fromstring(response)
  5.             res = tree.xpath('//div[@class="result_body"]/ul/li/a/text()')
  6.             res2 = tree.xpath('//div[@class="result_body"]/ul/li/text()')
  7.             data = res if len(res) > 0 else res2
  8.             for i in data:
  9.                  text += i.title() + ', ' if len(res) > 1 else i.title()
  10.                  if len(msg.text.split(":")[1].split("\n")) > 1:
  11.                       await self.bot.api.messages.send(chat_id=msg.chat_id, message=f"!о {i.title()}")
  12.                  else:
  13.                       await self.bot.api.messages.send(chat_id=msg.chat_id, message=i.title())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement