Add a command to set the bot description (#3340)

* description-command

* Cap the description length

* mmk
This commit is contained in:
Michael H
2020-01-13 10:12:31 -05:00
committed by GitHub
parent ab2e87a8fb
commit ef8b57a1d2
3 changed files with 31 additions and 3 deletions

View File

@@ -873,6 +873,32 @@ class Core(commands.Cog, CoreLogic):
for page in pagify(settings):
await ctx.send(box(page))
@checks.is_owner()
@_set.command(name="description")
async def setdescription(self, ctx: commands.Context, *, description: str = ""):
"""
Sets the bot's description.
Use without a description to reset.
This is shown in a few locations, including the help menu.
The default is "Red V3"
"""
if not description:
await ctx.bot._config.description.clear()
ctx.bot.description = "Red V3"
await ctx.send(_("Description reset."))
elif len(description) > 250: # While the limit is 256, we bold it adding characters.
await ctx.send(
_(
"This description is too long to properly display. "
"Please try again with below 250 characters"
)
)
else:
await ctx.bot._config.description.set(description)
ctx.bot.description = description
await ctx.tick()
@_set.command()
@checks.guildowner()
@commands.guild_only()