forked from VycktorStark/Userbot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtools.py
More file actions
22 lines (20 loc) · 679 Bytes
/
Copy pathtools.py
File metadata and controls
22 lines (20 loc) · 679 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from telethon import TelegramClient, events
from asyncio import sleep
import time, logging, subprocess, os
client = TelegramClient('cwf',api_id=os.environ['APIKEYHASID'] ,api_hash=os.environ['APIKEYHAS'])
sudo_id = os.environ['YOURID']
chat_group_main = os.environ["GROUPSNAME"]
def bash_(self):
try:
resp = subprocess.check_output(self, shell=True).decode('utf8')
if (len(resp) == 1) and (resp == "\n"):
resp = "OK"
return resp
except Exception as error:
logging.warning(error)
return error
async def delt(even, item, sleep_):
await sleep(sleep_)
if (even): await even.delete()
if (item): await item.delete()
__all__ = ['client', 'delt', 'sudo_id', 'sleep']