mirror of
https://github.com/MuRuLOSE/limoka.git
synced 2026-06-16 22:34:19 +02:00
46 lines
1.8 KiB
Python
46 lines
1.8 KiB
Python
from hikkatl.types import Message
|
|
from .. import loader, utils
|
|
import aiohttp
|
|
import os
|
|
|
|
"""
|
|
███ ███ ██ ██ ██████ ██ ██ ██ ██████ ███████ ███████
|
|
████ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
|
██ ████ ██ ██ ██ ██████ ██ ██ ██ ██ ██ ███████ █████
|
|
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
|
██ ██ ██████ ██ ██ ██████ ███████ ██████ ███████ ███████
|
|
|
|
|
|
Compliments
|
|
📜 Licensed under the GNU AGPLv3
|
|
"""
|
|
|
|
|
|
# meta desc: desc
|
|
# meta developer: @BruhHikkaModules
|
|
# requires: aiohttp
|
|
|
|
|
|
@loader.tds
|
|
class compliments(loader.Module):
|
|
"""Генерирует комплименты"""
|
|
|
|
strings = {"name": "Compliments"}
|
|
|
|
@loader.command()
|
|
async def gen_compliment(self, message: Message):
|
|
"""- Генерирует комлпимент"""
|
|
async with aiohttp.ClientSession() as session:
|
|
async with session.get("http://complimentr.com/api") as response:
|
|
data = await response.json()
|
|
await utils.answer(
|
|
message,
|
|
await self._client.translate(
|
|
message.peer_id,
|
|
message,
|
|
"ru",
|
|
raw_text=data["compliment"],
|
|
entities=message.entities,
|
|
),
|
|
)
|