Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if msg.text.lower().startswith("[ан"):
- anagram = word = msg.text.split(":")[1].split("\n")[0].replace(" ", "")
- response = await resp.text()
- tree = html.fromstring(response)
- res = tree.xpath('//div[@class="result_body"]/ul/li/a/text()')
- res2 = tree.xpath('//div[@class="result_body"]/ul/li/text()')
- data = res if len(res) > 0 else res2
- for i in data:
- text += i.title() + ', ' if len(res) > 1 else i.title()
- if len(msg.text.split(":")[1].split("\n")) > 1:
- await self.bot.api.messages.send(chat_id=msg.chat_id, message=f"!о {i.title()}")
- else:
- await self.bot.api.messages.send(chat_id=msg.chat_id, message=i.title())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement