-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathneko.py
More file actions
21 lines (18 loc) · 784 Bytes
/
neko.py
File metadata and controls
21 lines (18 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from pyrogram import Client, filters
from command import fox_command, fox_sudo, who_message
from requirements_installer import install_library
import os
install_library("requests -U")
import requests
@Client.on_message(fox_command("neko", "Neko", os.path.basename(__file__)) & fox_sudo())
async def neko(client, message):
message = await who_message(client, message)
await message.edit("Neko tyan..~")
try:
resp = requests.get("https://nekos.best/api/v2/neko")
data = resp.json()
url = data["results"][0]["url"]
await client.send_photo(message.chat.id, photo=str(url),message_thread_id=message.message_thread_id)
await message.delete()
except Exception as f:
await message.edit(f"Oops..~\n{f}")