Changed applications.json options

This commit is contained in:
Profitroll 2022-10-26 12:54:55 +02:00
parent c89072b80e
commit de0df8f0f6
3 changed files with 11 additions and 2 deletions

3
.gitignore vendored
View File

@ -159,4 +159,5 @@ config.json
users
!users/.gitkeep
TASK.md
inline_bot.py
inline_bot.py
data/applications.json

View File

@ -1 +0,0 @@
{}

View File

@ -20,6 +20,15 @@ pid = getpid()
app = Client("holochecker", bot_token=configGet("bot_token", "bot"), api_id=configGet("api_id", "bot"), api_hash=configGet("api_hash", "bot"))
for entry in [f"{configGet('data', 'locations')}{sep}applications.json"]:
mode = 'r' if path.exists(entry) else 'w'
with open(entry, mode) as f:
try:
f.write("{}")
except:
pass
async def isAnAdmin(admin_id):
if admin_id == configGet("owner") or admin_id in configGet("admins"):
return True