[V3 Downloader] Allow use of prefix in install message (#1869)

* [V3 Downloader] Allow to use the prefix in install msg

* Update docs

* Let's do the same for repo addition

* Fix indent

* Use replace instead of format

* Update docs
This commit is contained in:
El Laggron 2018-06-25 04:42:47 +02:00 committed by Toby Harradine
parent 9f2ed694ce
commit c1bcca4432
2 changed files with 5 additions and 2 deletions

View File

@ -20,6 +20,9 @@ Keys common to both repo and cog info.json (case sensitive)
- ``install_msg`` (string) - The message that gets displayed when a cog
is installed or a repo is added
.. tip:: You can use the ``[p]`` key in your string to use the prefix
used for installing.
- ``short`` (string) - A short description of the cog or repo. For cogs, this info
is displayed when a user executes ``!cog list``

View File

@ -234,7 +234,7 @@ class Downloader:
else:
await ctx.send(_("Repo `{}` successfully added.").format(name))
if repo.install_msg is not None:
await ctx.send(repo.install_msg)
await ctx.send(repo.install_msg.replace("[p]", ctx.prefix))
@repo.command(name="delete")
async def _repo_del(self, ctx, repo_name: Repo):
@ -319,7 +319,7 @@ class Downloader:
await ctx.send(_("`{}` cog successfully installed.").format(cog_name))
if cog.install_msg is not None:
await ctx.send(cog.install_msg)
await ctx.send(cog.install_msg.replace("[p]", ctx.prefix))
@cog.command(name="uninstall")
async def _cog_uninstall(self, ctx, cog_name: InstalledCog):