WIP: Improvements

This commit is contained in:
Profitroll 2023-07-14 12:36:42 +02:00
parent d9b72e5ad8
commit 01f8a73dae
Signed by: profitroll
GPG Key ID: FA35CAB49DACD3B2
4 changed files with 94 additions and 6 deletions

View File

@ -1,10 +1,80 @@
{
"owner_id": 0,
"locale": "en",
"bot": {
"owner": 0,
"api_id": 0,
"api_hash": "",
"bot_token": "",
"workers": 1
"scoped_commands": true
},
"use_compiled_page_saver": false
"use_compiled_page_saver": false,
"reports": {
"chat_id": "owner"
},
"disabled_plugins": [],
"commands": {
"help": {
"scopes": [
{
"name": "BotCommandScopeDefault"
},
{
"name": "BotCommandScopeChat",
"chat_id": "owner"
}
]
},
"balance": {
"scopes": [
{
"name": "BotCommandScopeDefault"
},
{
"name": "BotCommandScopeChat",
"chat_id": "owner"
}
]
},
"topup": {
"scopes": [
{
"name": "BotCommandScopeDefault"
},
{
"name": "BotCommandScopeChat",
"chat_id": "owner"
}
]
},
"setcard": {
"scopes": [
{
"name": "BotCommandScopeDefault"
},
{
"name": "BotCommandScopeChat",
"chat_id": "owner"
}
]
},
"resetcard": {
"scopes": [
{
"name": "BotCommandScopeDefault"
},
{
"name": "BotCommandScopeChat",
"chat_id": "owner"
}
]
},
"shutdown": {
"scopes": [
{
"name": "BotCommandScopeChat",
"chat_id": "owner"
}
]
}
}
}

10
locale/en.json Normal file
View File

@ -0,0 +1,10 @@
{
"commands": {
"help": "Help menu",
"balance": "Card's balance",
"topup": "Refill the card",
"setcard": "Link the card",
"resetcard": "Unlink the card",
"shutdown": "Turn the bot off"
}
}

10
locale/uk.json Normal file
View File

@ -0,0 +1,10 @@
{
"commands": {
"help": "Меню допомоги",
"balance": "Баланс картки",
"topup": "Поповнити картку",
"setcard": "Прив'язати картку",
"resetcard": "Відв'язати картку",
"shutdown": "Вимкнути бота"
}
}

View File

@ -29,7 +29,5 @@ def userReset(userid, key: str):
def userGet(userid, key: str):
try:
return sync.json_read("data/database.json")[str(userid)][key]
except KeyError:
return None
except FileNotFoundError:
except (KeyError, FileNotFoundError):
return None