mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 03:38:53 -05:00
[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:
parent
9f2ed694ce
commit
c1bcca4432
@ -21,6 +21,9 @@ Keys common to both repo and cog info.json (case sensitive)
|
|||||||
- ``install_msg`` (string) - The message that gets displayed when a cog
|
- ``install_msg`` (string) - The message that gets displayed when a cog
|
||||||
is installed or a repo is added
|
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
|
- ``short`` (string) - A short description of the cog or repo. For cogs, this info
|
||||||
is displayed when a user executes ``!cog list``
|
is displayed when a user executes ``!cog list``
|
||||||
|
|
||||||
|
|||||||
@ -234,7 +234,7 @@ class Downloader:
|
|||||||
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:
|
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")
|
@repo.command(name="delete")
|
||||||
async def _repo_del(self, ctx, repo_name: Repo):
|
async def _repo_del(self, ctx, repo_name: Repo):
|
||||||
@ -319,7 +319,7 @@ class Downloader:
|
|||||||
|
|
||||||
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:
|
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")
|
@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