Finished working on /version command
This commit is contained in:
@@ -11,7 +11,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.10"
|
__version__ = "2.5.11"
|
||||||
__maintainer__ = "Davide Testa"
|
__maintainer__ = "Davide Testa"
|
||||||
__contact__ = "t.me/davte"
|
__contact__ = "t.me/davte"
|
||||||
|
|
||||||
|
|||||||
@@ -884,10 +884,27 @@ async def _version_command(bot: Bot, update, user_record):
|
|||||||
)
|
)
|
||||||
temporary_message = await bot.send_message(
|
temporary_message = await bot.send_message(
|
||||||
text=text + '\n\n⏳ Checking for updates... ☑️',
|
text=text + '\n\n⏳ Checking for updates... ☑️',
|
||||||
update=update
|
update=update,
|
||||||
|
send_default_keyboard=False
|
||||||
)
|
)
|
||||||
news = await get_new_versions(bot=bot)
|
news = await get_new_versions(bot=bot)
|
||||||
print(news)
|
if not news:
|
||||||
|
text += '\n\n⌛️ All packages are updated! ✅'
|
||||||
|
else:
|
||||||
|
text += '\n\n' + bot.get_message(
|
||||||
|
'admin', 'updates_available', 'header',
|
||||||
|
user_record=user_record
|
||||||
|
) + '\n\n'
|
||||||
|
text += '\n'.join(
|
||||||
|
f"<b>{package}</b>: "
|
||||||
|
f"<code>{versions['current']}</code> —> "
|
||||||
|
f"<code>{versions['new']}</code>"
|
||||||
|
for package, versions in news.items()
|
||||||
|
)
|
||||||
|
await bot.edit_message_text(
|
||||||
|
text=text,
|
||||||
|
update=temporary_message
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
async def notify_new_version(bot: Bot):
|
async def notify_new_version(bot: Bot):
|
||||||
|
|||||||
Reference in New Issue
Block a user