-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathhelpers.py
60 lines (50 loc) · 1.85 KB
/
helpers.py
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# temp db for banned
import asyncio
import logging
import traceback
import aiohttp
import database
from config import ADMINS
class temp(object): # TrojanZ Idea of Temping
BOT_USERNAME = None
CANCEL = False
FIRST_NAME = None
START_TIME = None
BANNED_USERS = []
class AsyncIter:
def __init__(self, items):
self.items = items
async def __aiter__(self):
for item in self.items:
yield item
async def __anext__(self):
try:
return next(self.iter)
except StopIteration as e:
raise StopAsyncIteration from e
class Helpers:
def __init__(self):
self.username = temp.BOT_USERNAME
@property
async def user_method(self):
user_method = await database.db.get_bot_method(self.username)
return user_method or "None"
@property
async def get_admins(self):
x=''
async for i in AsyncIter(ADMINS):
x+= f"~ `{i}`\n"
return x
"""
_____ __ __ _ _ _ _______ _
/ ____| | \/ | | | | | ( ) |__ __| | |
| | __ _ __ ___ _ _ | \ / | __ _ | |_ | |_ ___ _ __|/ ___ | | ___ ___ | |__
| | |_ || '__|/ _ \| | | || |\/| | / _` || __|| __|/ _ \| '__| / __| | | / _ \ / __|| '_ \
| |__| || | | __/| |_| || | | || (_| || |_ | |_| __/| | \__ \ | || __/| (__ | | | |
\_____||_| \___| \__, ||_| |_| \__,_| \__| \__|\___||_| |___/ |_| \___| \___||_| |_|
__/ |
|___/
Author: GreyMatter's Tech
GitHub: https://GreyMattersTech.com/GitHub
Website: https://GreyMattersTech.com
"""