[V3 Core] fix some issues with [p]set and [p]set nickname (#1494)

* [V3 Core] fix AttributeError in [p]set

* Fix [p]set nickname

* Make the nickname param on [p]set nickname optional
This commit is contained in:
palmtree5 2018-04-04 02:42:10 -08:00 committed by Kowlin
parent 84b0df0437
commit 402f6c19e7

View File

@ -541,7 +541,8 @@ class Core:
"Locale: {}" "Locale: {}"
"".format( "".format(
ctx.bot.user.name, " ".join(prefixes), ctx.bot.user.name, " ".join(prefixes),
admin_role.name, mod_role.name, locale admin_role.name if admin_role else "Not set",
mod_role.name if mod_role else "Not set", locale
) )
) )
await ctx.send(box(settings)) await ctx.send(box(settings))
@ -696,10 +697,10 @@ class Core:
@_set.command(name="nickname") @_set.command(name="nickname")
@checks.admin() @checks.admin()
@commands.guild_only() @commands.guild_only()
async def _nickname(self, ctx, *, nickname: str): async def _nickname(self, ctx, *, nickname: str=None):
"""Sets Red's nickname""" """Sets Red's nickname"""
try: try:
await ctx.bot.user.edit(nick=nickname) await ctx.guild.me.edit(nick=nickname)
except discord.Forbidden: except discord.Forbidden:
await ctx.send(_("I lack the permissions to change my own " await ctx.send(_("I lack the permissions to change my own "
"nickname.")) "nickname."))