feat(repo): make all cogs pylance-typechecking compliant
at `basic` level, does not include Aurora as it's being rewritten in the `aurora/v3` branch
This commit is contained in:
parent
ea0b7937f8
commit
2a5b924409
11 changed files with 184 additions and 139 deletions
|
@ -26,7 +26,7 @@ class Backup(commands.Cog):
|
|||
|
||||
__author__ = ["[cswimr](https://www.coastalcommits.com/cswimr)"]
|
||||
__git__ = "https://www.coastalcommits.com/cswimr/SeaCogs"
|
||||
__version__ = "1.1.2"
|
||||
__version__ = "1.1.3"
|
||||
__documentation__ = "https://seacogs.coastalcommits.com/backup/"
|
||||
|
||||
def __init__(self, bot: Red):
|
||||
|
@ -45,14 +45,15 @@ class Backup(commands.Cog):
|
|||
]
|
||||
return "\n".join(text)
|
||||
|
||||
@commands.group(autohelp=True)
|
||||
@commands.group(autohelp=True) # type: ignore
|
||||
@commands.is_owner()
|
||||
async def backup(self, ctx: commands.Context):
|
||||
async def backup(self, ctx: commands.Context) -> None:
|
||||
"""Backup your installed cogs."""
|
||||
pass
|
||||
|
||||
@backup.command(name="export")
|
||||
@commands.is_owner()
|
||||
async def backup_export(self, ctx: commands.Context):
|
||||
async def backup_export(self, ctx: commands.Context) -> None:
|
||||
"""Export your installed repositories and cogs to a file."""
|
||||
downloader = ctx.bot.get_cog("Downloader")
|
||||
if downloader is None:
|
||||
|
@ -91,13 +92,13 @@ class Backup(commands.Cog):
|
|||
|
||||
@backup.command(name="import")
|
||||
@commands.is_owner()
|
||||
async def backup_import(self, ctx: commands.Context):
|
||||
async def backup_import(self, ctx: commands.Context) -> None:
|
||||
"""Import your installed repositories and cogs from an export file."""
|
||||
try:
|
||||
export = json.loads(await ctx.message.attachments[0].read())
|
||||
except (json.JSONDecodeError, IndexError):
|
||||
try:
|
||||
export = json.loads(await ctx.message.reference.resolved.attachments[0].read())
|
||||
export = json.loads(await ctx.message.reference.resolved.attachments[0].read()) # type: ignore - this is fine to let error because it gets handled
|
||||
except (json.JSONDecodeError, IndexError, AttributeError):
|
||||
await ctx.send(error("Please provide a valid JSON export file."))
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue