Added "selectable" parameter

This commit is contained in:
Profitroll 2023-08-11 22:46:30 +02:00
parent 860d9ac281
commit 5ad8cc750d
Signed by: profitroll
GPG Key ID: FA35CAB49DACD3B2
4 changed files with 7 additions and 3 deletions

View File

@ -2,6 +2,7 @@
"metadata": { "metadata": {
"flag": "🇩🇪", "flag": "🇩🇪",
"name": "Deutsch", "name": "Deutsch",
"selectable": true,
"codes": [ "codes": [
"de", "de",
"de-AT", "de-AT",

View File

@ -2,6 +2,7 @@
"metadata": { "metadata": {
"flag": "🇬🇧", "flag": "🇬🇧",
"name": "English", "name": "English",
"selectable": true,
"codes": [ "codes": [
"en", "en",
"en-GB", "en-GB",

View File

@ -2,6 +2,7 @@
"metadata": { "metadata": {
"flag": "🇺🇦", "flag": "🇺🇦",
"name": "Українська", "name": "Українська",
"selectable": true,
"codes": [ "codes": [
"uk", "uk",
"uk-UA" "uk-UA"

View File

@ -33,9 +33,10 @@ async def command_language(app: PyroClient, message: Message):
buttons = [] buttons = []
for language, data in app.in_every_locale("metadata").items(): for language, data in app.in_every_locale("metadata").items():
buttons.append( if data["selectable"]:
InlineButton(f"{data['flag']} {data['name']}", f"language;{language}") buttons.append(
) InlineButton(f"{data['flag']} {data['name']}", f"language;{language}")
)
buttons.append( buttons.append(
InlineButton( InlineButton(