mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
[Downloader] Fix AttributeError in [p]findcog for cogs that weren't installed through Downloader (#3278)
* Update downloader.py * Create 3278.misc.rst
This commit is contained in:
parent
a2b68ea7fc
commit
d3c97eedfe
1
changelog.d/downloader/3278.misc.rst
Normal file
1
changelog.d/downloader/3278.misc.rst
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix `AttributeError` in ``[p]findcog`` for cogs that weren't installed through Downloader.
|
||||||
@ -1281,6 +1281,7 @@ class Downloader(commands.Cog):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
if isinstance(cog_installable, Installable):
|
if isinstance(cog_installable, Installable):
|
||||||
|
is_installable = True
|
||||||
made_by = ", ".join(cog_installable.author) or _("Missing from info.json")
|
made_by = ", ".join(cog_installable.author) or _("Missing from info.json")
|
||||||
repo_url = (
|
repo_url = (
|
||||||
_("Missing from installed repos")
|
_("Missing from installed repos")
|
||||||
@ -1289,6 +1290,7 @@ class Downloader(commands.Cog):
|
|||||||
)
|
)
|
||||||
cog_name = cog_installable.name
|
cog_name = cog_installable.name
|
||||||
else:
|
else:
|
||||||
|
is_installable = False
|
||||||
made_by = "26 & co."
|
made_by = "26 & co."
|
||||||
repo_url = "https://github.com/Cog-Creators/Red-DiscordBot"
|
repo_url = "https://github.com/Cog-Creators/Red-DiscordBot"
|
||||||
cog_name = cog_installable.__class__.__name__
|
cog_name = cog_installable.__class__.__name__
|
||||||
@ -1296,7 +1298,7 @@ class Downloader(commands.Cog):
|
|||||||
msg = _(
|
msg = _(
|
||||||
"Command: {command}\nCog name: {cog}\nMade by: {author}\nRepo: {repo_url}\n"
|
"Command: {command}\nCog name: {cog}\nMade by: {author}\nRepo: {repo_url}\n"
|
||||||
).format(command=command_name, author=made_by, repo_url=repo_url, cog=cog_name)
|
).format(command=command_name, author=made_by, repo_url=repo_url, cog=cog_name)
|
||||||
if cog_installable.repo is not None and cog_installable.repo.branch:
|
if is_installable and cog_installable.repo is not None and cog_installable.repo.branch:
|
||||||
msg += _("Repo branch: {branch_name}\n").format(
|
msg += _("Repo branch: {branch_name}\n").format(
|
||||||
branch_name=cog_installable.repo.branch
|
branch_name=cog_installable.repo.branch
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user