diff options
| author | 2018-11-13 15:03:02 +0000 | |
|---|---|---|
| committer | 2018-11-13 15:03:02 +0000 | |
| commit | 480c3c0cbe763514a76feb971dbe5d686d1f6008 (patch) | |
| tree | 8ffcb9ba0c2da89a5b573b2e92c9a2dd82375d6b | |
| parent | Merge branch 'int_eval_nohelp' into 'master' (diff) | |
| parent | Remove hiphopify (diff) | |
Merge branch 'superstarify' into 'master'
Add "superstarify" replacement for "hiphopify"
See merge request python-discord/projects/bot!82
| -rw-r--r-- | bot/__main__.py | 2 | ||||
| -rw-r--r-- | bot/cogs/superstarify.py (renamed from bot/cogs/hiphopify.py) | 48 | ||||
| -rw-r--r-- | bot/constants.py | 2 | ||||
| -rw-r--r-- | config-default.yml | 2 |
4 files changed, 27 insertions, 27 deletions
diff --git a/bot/__main__.py b/bot/__main__.py index f74b3545c..ab66492bb 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -61,7 +61,7 @@ bot.load_extension("bot.cogs.deployment") bot.load_extension("bot.cogs.defcon") bot.load_extension("bot.cogs.eval") bot.load_extension("bot.cogs.fun") -bot.load_extension("bot.cogs.hiphopify") +bot.load_extension("bot.cogs.superstarify") bot.load_extension("bot.cogs.information") bot.load_extension("bot.cogs.moderation") bot.load_extension("bot.cogs.off_topic_names") diff --git a/bot/cogs/hiphopify.py b/bot/cogs/superstarify.py index 785aedca2..e1cfcc184 100644 --- a/bot/cogs/hiphopify.py +++ b/bot/cogs/superstarify.py @@ -16,7 +16,7 @@ from bot.decorators import with_role log = logging.getLogger(__name__) -class Hiphopify: +class Superstarify: """ A set of commands to moderate terrible nicknames. """ @@ -30,7 +30,7 @@ class Hiphopify: This event will trigger when someone changes their name. At this point we will look up the user in our database and check whether they are allowed to change their names, or if they are in - hiphop-prison. If they are not allowed, we will change it back. + superstar-prison. If they are not allowed, we will change it back. :return: """ @@ -39,11 +39,11 @@ class Hiphopify: log.debug( f"{before.display_name} is trying to change their nickname to {after.display_name}. " - "Checking if the user is in hiphop-prison..." + "Checking if the user is in superstar-prison..." ) response = await self.bot.http_session.get( - URLs.site_hiphopify_api, + URLs.site_superstarify_api, headers=self.headers, params={"user_id": str(before.id)} ) @@ -55,7 +55,7 @@ class Hiphopify: return # Nick change was triggered by this event. Ignore. log.debug( - f"{after.display_name} is currently in hiphop-prison. " + f"{after.display_name} is currently in superstar-prison. " f"Changing the nick back to {before.display_name}." ) await after.edit(nick=response.get("forced_nick")) @@ -63,23 +63,23 @@ class Hiphopify: await after.send( "You have tried to change your nickname on the **Python Discord** server " f"from **{before.display_name}** to **{after.display_name}**, but as you " - "are currently in hiphop-prison, you do not have permission to do so. " + "are currently in superstar-prison, you do not have permission to do so. " "You will be allowed to change your nickname again at the following time:\n\n" f"**{response.get('end_timestamp')}**." ) except Forbidden: log.warning( - "The user tried to change their nickname while in hiphop-prison. " + "The user tried to change their nickname while in superstar-prison. " "This led to the bot trying to DM the user to let them know they cannot do that, " "but the user had either blocked the bot or disabled DMs, so it was not possible " "to DM them, and a discord.errors.Forbidden error was incurred." ) - @command(name='hiphopify', aliases=('force_nick', 'hh')) + @command(name='superstarify', aliases=('force_nick', 'ss')) @with_role(Roles.admin, Roles.owner, Roles.moderator) - async def hiphopify(self, ctx: Context, member: Member, duration: str, *, forced_nick: str = None): + async def superstarify(self, ctx: Context, member: Member, duration: str, *, forced_nick: str = None): """ - This command will force a random rapper name (like Lil' Wayne) to be the users + This command will force a random superstar name (like Taylor Swift) to be the user's nickname for a specified duration. If a forced_nick is provided, it will use that instead. :param ctx: Discord message context @@ -89,7 +89,7 @@ class Hiphopify: """ log.debug( - f"Attempting to hiphopify {member.display_name} for {duration}. " + f"Attempting to superstarify {member.display_name} for {duration}. " f"forced_nick is set to {forced_nick}." ) @@ -105,7 +105,7 @@ class Hiphopify: params["forced_nick"] = forced_nick response = await self.bot.http_session.post( - URLs.site_hiphopify_api, + URLs.site_superstarify_api, headers=self.headers, json=params ) @@ -114,7 +114,7 @@ class Hiphopify: if "error_message" in response: log.warning( - "Encountered the following error when trying to hiphopify the user:\n" + "Encountered the following error when trying to superstarify the user:\n" f"{response.get('error_message')}" ) embed.colour = Colour.red() @@ -142,7 +142,7 @@ class Hiphopify: mod_log = self.bot.get_channel(Channels.modlog) await mod_log.send( f":middle_finger: {member.name}#{member.discriminator} (`{member.id}`) " - f"has been hiphopified by **{ctx.author.name}**. Their new nickname is `{forced_nick}`. " + f"has been superstarified by **{ctx.author.name}**. Their new nickname is `{forced_nick}`. " f"They will not be able to change their nickname again until **{end_time}**" ) @@ -151,30 +151,30 @@ class Hiphopify: await member.edit(nick=forced_nick) await ctx.send(embed=embed) - @command(name='unhiphopify', aliases=('release_nick', 'uhh')) + @command(name='unsuperstarify', aliases=('release_nick', 'uss')) @with_role(Roles.admin, Roles.owner, Roles.moderator) - async def unhiphopify(self, ctx: Context, member: Member): + async def unsuperstarify(self, ctx: Context, member: Member): """ This command will remove the entry from our database, allowing the user to once again change their nickname. :param ctx: Discord message context - :param member: The member to unhiphopify + :param member: The member to unsuperstarify """ - log.debug(f"Attempting to unhiphopify the following user: {member.display_name}") + log.debug(f"Attempting to unsuperstarify the following user: {member.display_name}") embed = Embed() embed.colour = Colour.blurple() response = await self.bot.http_session.delete( - URLs.site_hiphopify_api, + URLs.site_superstarify_api, headers=self.headers, json={"user_id": str(member.id)} ) response = await response.json() - embed.description = "User has been released from hiphop-prison." + embed.description = "User has been released from superstar-prison." embed.title = random.choice(POSITIVE_REPLIES) if "error_message" in response: @@ -182,14 +182,14 @@ class Hiphopify: embed.title = random.choice(NEGATIVE_REPLIES) embed.description = response.get("error_message") log.warning( - f"Error encountered when trying to unhiphopify {member.display_name}:\n" + f"Error encountered when trying to unsuperstarify {member.display_name}:\n" f"{response}" ) - log.debug(f"{member.display_name} was successfully released from hiphop-prison.") + log.debug(f"{member.display_name} was successfully released from superstar-prison.") await ctx.send(embed=embed) def setup(bot): - bot.add_cog(Hiphopify(bot)) - log.info("Cog loaded: Hiphopify") + bot.add_cog(Superstarify(bot)) + log.info("Cog loaded: Superstarify") diff --git a/bot/constants.py b/bot/constants.py index 145dc4700..43f03d7bf 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -395,7 +395,7 @@ class URLs(metaclass=YAMLGetter): site_api: str site_facts_api: str site_clean_api: str - site_hiphopify_api: str + site_superstarify_api: str site_idioms_api: str site_logs_api: str site_logs_view: str diff --git a/config-default.yml b/config-default.yml index 15f1a143a..046c1ea56 100644 --- a/config-default.yml +++ b/config-default.yml @@ -218,7 +218,7 @@ urls: site_bigbrother_api: !JOIN [*SCHEMA, *API, "/bot/bigbrother"] site_docs_api: !JOIN [*SCHEMA, *API, "/bot/docs"] site_facts_api: !JOIN [*SCHEMA, *API, "/bot/snake_facts"] - site_hiphopify_api: !JOIN [*SCHEMA, *API, "/bot/hiphopify"] + site_superstarify_api: !JOIN [*SCHEMA, *API, "/bot/superstarify"] site_idioms_api: !JOIN [*SCHEMA, *API, "/bot/snake_idioms"] site_infractions: !JOIN [*SCHEMA, *API, "/bot/infractions"] site_infractions_user: !JOIN [*SCHEMA, *API, "/bot/infractions/user/{user_id}"] |