Skip to content

Commit

Permalink
[V3 Downloader] Add install messages from info.json (#1453)
Browse files Browse the repository at this point in the history
  • Loading branch information
tekulvw authored and palmtree5 committed Apr 3, 2018
1 parent e70e22d commit 935028a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions redbot/cogs/downloader/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ async def _repo_add(self, ctx, name: str, repo_url: str, branch: str=None):
"""
try:
# noinspection PyTypeChecker
await self._repo_manager.add_repo(
repo = await self._repo_manager.add_repo(
name=name,
url=repo_url,
branch=branch
Expand All @@ -232,6 +232,8 @@ async def _repo_add(self, ctx, name: str, repo_url: str, branch: str=None):
log.exception(_("Something went wrong during the cloning process."))
else:
await ctx.send(_("Repo `{}` successfully added.").format(name))
if repo.install_msg is not None:
await ctx.send(repo.install_msg)

@repo.command(name="delete")
async def _repo_del(self, ctx, repo_name: Repo):
Expand Down Expand Up @@ -268,7 +270,7 @@ async def _cog_install(self, ctx, repo_name: Repo, cog_name: str):
"""
Installs a cog from the given repo.
"""
cog = discord.utils.get(repo_name.available_cogs, name=cog_name)
cog = discord.utils.get(repo_name.available_cogs, name=cog_name) # type: Installable
if cog is None:
await ctx.send(_("Error, there is no cog by the name of"
" `{}` in the `{}` repo.").format(cog_name, repo_name.name))
Expand All @@ -286,6 +288,8 @@ async def _cog_install(self, ctx, repo_name: Repo, cog_name: str):
await repo_name.install_libraries(self.SHAREDLIB_PATH)

await ctx.send(_("`{}` cog successfully installed.").format(cog_name))
if cog.install_msg is not None:
await ctx.send(cog.install_msg)

@cog.command(name="uninstall")
async def _cog_uninstall(self, ctx, cog_name: InstalledCog):
Expand Down

0 comments on commit 935028a

Please sign in to comment.