-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path0x0
45 lines (38 loc) · 1.12 KB
/
0x0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from .. import loader, utils # pylint: disable=relative-beyond-top-level
import logging
from requests import post
from random import choice
logger = logging.getLogger(__name__)
def register(cb):
cb(ZeroXzerOMod())
@loader.tds
class ZeroXzerOMod(loader.Module):
"""Uploader"""
strings = {
"name": "0x0 Загрузчик"
}
async def client_ready(self, client, db):
self.client = client
@loader.sudo
async def oxocmd(self, message):
message.edit("<b>⚞-⚟</b>")
reply = await message.get_reply_message()
if not reply:
await message.edit("<b>⚞reply to media⚟</b>")
return
media = reply.media
if not media:
await message.edit("<b>⚞reply to media⚟</b>")
return
file = await message.client.download_file(media)
try:
OxO = post('https://0x0.st', files={'file': file})
except ConnectionError:
await message.edit("<b>C</b>onne<b>c</b>tionError")
return
if str(OxO) != "<Response [200]>":
await message.edit(OxO.text)
return
url = OxO.text
output = f"{choice(list('⚀⚁⚂⚃⚄⚅'))}<code>{url}</code>"
await message.edit(output)