Make [p]cog checkforupdates indicate when cog can't be updated on current Red/Python version

This commit is contained in:
jack1142 2020-03-28 15:53:10 +01:00 committed by GitHub
parent 35ebc4899e
commit 41c2b76d8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -866,6 +866,8 @@ class Downloader(commands.Cog):
async with ctx.typing(): async with ctx.typing():
cogs_to_check, failed = await self._get_cogs_to_check() cogs_to_check, failed = await self._get_cogs_to_check()
cogs_to_update, libs_to_update = await self._available_updates(cogs_to_check) cogs_to_update, libs_to_update = await self._available_updates(cogs_to_check)
cogs_to_update, filter_message = self._filter_incorrect_cogs(cogs_to_update)
message = "" message = ""
if cogs_to_update: if cogs_to_update:
cognames = [cog.name for cog in cogs_to_update] cognames = [cog.name for cog in cogs_to_update]
@ -877,6 +879,9 @@ class Downloader(commands.Cog):
message += _("\nThese shared libraries can be updated: ") + humanize_list( message += _("\nThese shared libraries can be updated: ") + humanize_list(
tuple(map(inline, libnames)) tuple(map(inline, libnames))
) )
if not (cogs_to_update or libs_to_update) and filter_message:
message += _("No cogs can be updated.")
message += filter_message
if not message: if not message:
message = _("All installed cogs are up to date.") message = _("All installed cogs are up to date.")