Show all packages with /version command
This commit is contained in:
parent
edb2201773
commit
baf1dbbe62
@ -14,7 +14,7 @@ __author__ = "Davide Testa"
|
|||||||
__email__ = "davide@davte.it"
|
__email__ = "davide@davte.it"
|
||||||
__credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
|
__credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
|
||||||
__license__ = "GNU General Public License v3.0"
|
__license__ = "GNU General Public License v3.0"
|
||||||
__version__ = "2.5.0"
|
__version__ = "2.5.1"
|
||||||
__maintainer__ = "Davide Testa"
|
__maintainer__ = "Davide Testa"
|
||||||
__contact__ = "t.me/davte"
|
__contact__ = "t.me/davte"
|
||||||
|
|
||||||
|
@ -796,14 +796,19 @@ async def get_last_commit():
|
|||||||
return last_commit
|
return last_commit
|
||||||
|
|
||||||
|
|
||||||
async def _version_command(bot, update, user_record):
|
async def _version_command(bot: davtelepot_bot, update, user_record):
|
||||||
last_commit = await get_last_commit()
|
last_commit = await get_last_commit()
|
||||||
return bot.get_message(
|
text = bot.get_message(
|
||||||
'admin', 'version_command', 'result',
|
'admin', 'version_command', 'header',
|
||||||
last_commit=last_commit,
|
last_commit=last_commit,
|
||||||
davtelepot_version=__version__,
|
|
||||||
update=update, user_record=user_record
|
update=update, user_record=user_record
|
||||||
)
|
)
|
||||||
|
text += '\n'.join(
|
||||||
|
f"<b>{package.__name__}</b>: "
|
||||||
|
f"<code>{package.__version__}</code>"
|
||||||
|
for package in bot.packages
|
||||||
|
)
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
async def notify_new_version(bot: davtelepot_bot):
|
async def notify_new_version(bot: davtelepot_bot):
|
||||||
|
@ -262,15 +262,15 @@ default_admin_messages = {
|
|||||||
'it': "Versione #️⃣",
|
'it': "Versione #️⃣",
|
||||||
},
|
},
|
||||||
'description': {
|
'description': {
|
||||||
'en': "Get source code version",
|
'en': "Get packages version and source code last commit",
|
||||||
'it': "Chiedi la versione del codice sorgente",
|
'it': "Chiedi la versione dei pacchetti e del codice sorgente",
|
||||||
},
|
},
|
||||||
'help_section': None,
|
'help_section': None,
|
||||||
'result': {
|
'header': {
|
||||||
'en': "Last commit: <code>{last_commit}</code>\n\n"
|
'en': "ℹ️ Version information #️⃣\n\n"
|
||||||
"davtelepot version: <code>{davtelepot_version}</code>",
|
"Last commit: <code>{last_commit}</code>",
|
||||||
'it': "Ultimo commit: <code>{last_commit}</code>\n\n"
|
'it': "ℹ️ Informazioni sulle versioni dei pacchetti #️⃣\n\n"
|
||||||
"Versione di davtelepot: <code>{davtelepot_version}</code>",
|
"Ultimo commit: <code>{last_commit}</code>"
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user