mirror of
https://github.com/MuRuLOSE/limoka.git
synced 2026-06-18 07:04:19 +02:00
Commited backup
This commit is contained in:
32
trololo65/Modules/webshot.py
Normal file
32
trololo65/Modules/webshot.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from .. import loader, utils
|
||||
import logging
|
||||
from requests import get
|
||||
import io
|
||||
|
||||
@loader.tds
|
||||
class WebShotMod(loader.Module):
|
||||
"""link to screen"""
|
||||
strings = {
|
||||
"name": "WebShot"
|
||||
}
|
||||
|
||||
|
||||
@loader.sudo
|
||||
async def webshotcmd(self, message):
|
||||
""".webshot <link>"""
|
||||
reply = None
|
||||
link = utils.get_args_raw(message)
|
||||
if not link:
|
||||
reply = await message.get_reply_message()
|
||||
if not reply:
|
||||
await message.delete()
|
||||
return
|
||||
link = reply.raw_text
|
||||
await message.edit("<b>📸Фоткаю...</b>")
|
||||
url = "https://mini.s-shot.ru/1024x768/JPEG/1024/Z100/?{}"
|
||||
file = get(url.format(link))
|
||||
file = io.BytesIO(file.content)
|
||||
file.name = "webshot.png"
|
||||
file.seek(0)
|
||||
await message.client.send_file(message.to_id, file, reply_to=reply)
|
||||
await message.delete()
|
||||
Reference in New Issue
Block a user