mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-09 04:38:55 -05:00
[V3 Downloader] Add install messages from info.json (#1453)
This commit is contained in:
parent
e70e22d557
commit
935028addc
@ -220,7 +220,7 @@ class Downloader:
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
# noinspection PyTypeChecker
|
# noinspection PyTypeChecker
|
||||||
await self._repo_manager.add_repo(
|
repo = await self._repo_manager.add_repo(
|
||||||
name=name,
|
name=name,
|
||||||
url=repo_url,
|
url=repo_url,
|
||||||
branch=branch
|
branch=branch
|
||||||
@ -232,6 +232,8 @@ class Downloader:
|
|||||||
log.exception(_("Something went wrong during the cloning process."))
|
log.exception(_("Something went wrong during the cloning process."))
|
||||||
else:
|
else:
|
||||||
await ctx.send(_("Repo `{}` successfully added.").format(name))
|
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")
|
@repo.command(name="delete")
|
||||||
async def _repo_del(self, ctx, repo_name: Repo):
|
async def _repo_del(self, ctx, repo_name: Repo):
|
||||||
@ -268,7 +270,7 @@ class Downloader:
|
|||||||
"""
|
"""
|
||||||
Installs a cog from the given repo.
|
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:
|
if cog is None:
|
||||||
await ctx.send(_("Error, there is no cog by the name of"
|
await ctx.send(_("Error, there is no cog by the name of"
|
||||||
" `{}` in the `{}` repo.").format(cog_name, repo_name.name))
|
" `{}` in the `{}` repo.").format(cog_name, repo_name.name))
|
||||||
@ -286,6 +288,8 @@ class Downloader:
|
|||||||
await repo_name.install_libraries(self.SHAREDLIB_PATH)
|
await repo_name.install_libraries(self.SHAREDLIB_PATH)
|
||||||
|
|
||||||
await ctx.send(_("`{}` cog successfully installed.").format(cog_name))
|
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")
|
@cog.command(name="uninstall")
|
||||||
async def _cog_uninstall(self, ctx, cog_name: InstalledCog):
|
async def _cog_uninstall(self, ctx, cog_name: InstalledCog):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user