Support [botname] substitutions in cog install messages too (#6491)

This commit is contained in:
Jakub Kuczys 2024-12-24 01:18:36 +01:00 committed by GitHub
parent d29ae723c1
commit f0a29e9815
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -936,7 +936,11 @@ class Downloader(commands.Cog):
await self.send_pagified(ctx, f"{message}{deprecation_notice}\n---") await self.send_pagified(ctx, f"{message}{deprecation_notice}\n---")
for cog in installed_cogs: for cog in installed_cogs:
if cog.install_msg: if cog.install_msg:
await ctx.send(cog.install_msg.replace("[p]", ctx.clean_prefix)) await ctx.send(
cog.install_msg.replace("[p]", ctx.clean_prefix).replace(
"[botname]", ctx.me.display_name
)
)
@cog.command(name="uninstall", require_var_positional=True) @cog.command(name="uninstall", require_var_positional=True)
async def _cog_uninstall(self, ctx: commands.Context, *cogs: InstalledCog) -> None: async def _cog_uninstall(self, ctx: commands.Context, *cogs: InstalledCog) -> None: