diff options
| author | 2018-04-27 16:01:24 +0200 | |
|---|---|---|
| committer | 2018-04-27 16:01:24 +0200 | |
| commit | 41901772b4dbd783dbb82f428ba9c4fe0e7f3862 (patch) | |
| tree | 0aa26b54ca1a30feaafc4cc3d5fed79741f273f5 | |
| parent | Declaring the encoding to be utf-8 is not necessary in Python3. (#58) (diff) | |
Fixed a critical bug that makes it impossible for users to change their nicknames while bot staging is running. Also fixed a couple of minor aesthetic problems with the hiphopify embed. (#61)
| -rw-r--r-- | bot/cogs/hiphopify.py | 10 | 
1 files changed, 6 insertions, 4 deletions
| diff --git a/bot/cogs/hiphopify.py b/bot/cogs/hiphopify.py index 54f217ca5..c28c9bdfc 100644 --- a/bot/cogs/hiphopify.py +++ b/bot/cogs/hiphopify.py @@ -49,7 +49,7 @@ class Hiphopify:          response = await response.json() -        if response: +        if response and response.get("end_timestamp") and not response.get("error_code"):              if after.display_name == response.get("forced_nick"):                  return  # Nick change was triggered by this event. Ignore. @@ -128,9 +128,11 @@ class Hiphopify:              embed.title = "Congratulations!"              embed.description = ( -                "Your previous nickname was so bad that we have decided to change it. " +                f"Your previous nickname, **{member.display_name}**, was so bad that we have decided to change it. "                  f"Your new nickname will be **{forced_nick}**.\n\n" -                f"You will be unable to change your nickname back until \n**{end_time}**." +                f"You will be unable to change your nickname until \n**{end_time}**.\n\n" +                "If you're confused by this, please read our " +                "[official nickname policy](https://pythondiscord.com/about/rules#nickname-policy)."              )              embed.set_image(url=image_url) @@ -146,7 +148,7 @@ class Hiphopify:              # Change the nick and return the embed              log.debug("Changing the users nickname and sending the embed.")              await member.edit(nick=forced_nick) -            await ctx.send(member.mention, embed=embed) +            await ctx.send(embed=embed)      @with_role(ADMIN_ROLE, OWNER_ROLE, MODERATOR_ROLE)      @command(name="unhiphopify()", aliases=["unhiphopify", "release_nick()", "release_nick"]) | 
