Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bot/exts/backend/branding/_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ async def send_info_embed(self, channel_id: int, *, is_notification: bool) -> No

else:
content = "Python Discord is entering a new event!" if is_notification else None
embed = discord.Embed(description=description[:4096], colour=discord.Colour.blurple())
embed = discord.Embed(description=description[:4096], colour=discord.Colour.og_blurple())
embed.set_footer(text=duration[:4096])

await channel.send(content=content, embed=embed)
Expand Down Expand Up @@ -573,7 +573,7 @@ async def branding_calendar_group(self, ctx: commands.Context) -> None:
await ctx.send(embed=resp)
return

embed = discord.Embed(title="Current event calendar", colour=discord.Colour.blurple())
embed = discord.Embed(title="Current event calendar", colour=discord.Colour.og_blurple())

# Because Discord embeds can only contain up to 25 fields, we only show the first 25.
first_25 = list(available_events.items())[:25]
Expand Down
2 changes: 1 addition & 1 deletion bot/exts/events/code_jams/_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ async def info(self, ctx: commands.Context, member: Member) -> None:

embed = Embed(
title=str(member),
colour=Colour.blurple()
colour=Colour.og_blurple()
)
embed.add_field(name="Team", value=self.team_name(channel), inline=True)

Expand Down
6 changes: 3 additions & 3 deletions bot/exts/info/information.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ async def roles_info(self, ctx: Context) -> None:
# Build an embed
embed = Embed(
title=f"Role information (Total {len(roles)} role{'s' * (len(role_list) > 1)})",
colour=Colour.blurple()
colour=Colour.og_blurple()
)

await LinePaginator.paginate(role_list, ctx, embed, empty=False)
Expand Down Expand Up @@ -170,7 +170,7 @@ async def role_info(self, ctx: Context, *roles: Union[Role, str]) -> None:
@command(name="server", aliases=["server_info", "guild", "guild_info"])
async def server_info(self, ctx: Context) -> None:
"""Returns an embed full of server information."""
embed = Embed(colour=Colour.blurple(), title="Server Information")
embed = Embed(colour=Colour.og_blurple(), title="Server Information")

created = discord_timestamp(ctx.guild.created_at, TimestampFormats.RELATIVE)
region = ctx.guild.region
Expand Down Expand Up @@ -316,7 +316,7 @@ async def create_user_embed(self, ctx: Context, user: MemberOrUser) -> Embed:
embed.add_field(name=field_name, value=field_content, inline=False)

embed.set_thumbnail(url=user.display_avatar.url)
embed.colour = user.colour if user.colour != Colour.default() else Colour.blurple()
embed.colour = user.colour if user.colour != Colour.default() else Colour.og_blurple()

return embed

Expand Down
12 changes: 6 additions & 6 deletions bot/exts/info/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def site_main(self, ctx: Context) -> None:

embed = Embed(title="Python Discord website")
embed.set_footer(text=url)
embed.colour = Colour.blurple()
embed.colour = Colour.og_blurple()
embed.description = (
f"[Our official website]({url}) is an open-source community project "
"created with Python and Django. It contains information about the server "
Expand All @@ -46,7 +46,7 @@ async def site_resources(self, ctx: Context) -> None:

embed = Embed(title="Resources")
embed.set_footer(text=f"{learning_url}")
embed.colour = Colour.blurple()
embed.colour = Colour.og_blurple()
embed.description = (
f"The [Resources page]({learning_url}) on our website contains a "
"list of hand-selected learning resources that we regularly recommend "
Expand All @@ -62,7 +62,7 @@ async def site_tools(self, ctx: Context) -> None:

embed = Embed(title="Tools")
embed.set_footer(text=f"{tools_url}")
embed.colour = Colour.blurple()
embed.colour = Colour.og_blurple()
embed.description = (
f"The [Tools page]({tools_url}) on our website contains a "
f"couple of the most popular tools for programming in Python."
Expand All @@ -77,7 +77,7 @@ async def site_help(self, ctx: Context) -> None:

embed = Embed(title="Asking Good Questions")
embed.set_footer(text=url)
embed.colour = Colour.blurple()
embed.colour = Colour.og_blurple()
embed.description = (
"Asking the right question about something that's new to you can sometimes be tricky. "
f"To help with this, we've created a [guide to asking good questions]({url}) on our website. "
Expand All @@ -93,7 +93,7 @@ async def site_faq(self, ctx: Context) -> None:

embed = Embed(title="FAQ")
embed.set_footer(text=url)
embed.colour = Colour.blurple()
embed.colour = Colour.og_blurple()
embed.description = (
"As the largest Python community on Discord, we get hundreds of questions every day. "
"Many of these questions have been asked before. We've compiled a list of the most "
Expand All @@ -106,7 +106,7 @@ async def site_faq(self, ctx: Context) -> None:
@site_group.command(name="rules", aliases=("r", "rule"), root_aliases=("rules", "rule"))
async def site_rules(self, ctx: Context, rules: Greedy[int]) -> None:
"""Provides a link to all rules or, if specified, displays specific rule(s)."""
rules_embed = Embed(title='Rules', color=Colour.blurple(), url=f'{BASE_URL}/pages/rules')
rules_embed = Embed(title='Rules', color=Colour.og_blurple(), url=f'{BASE_URL}/pages/rules')

if not rules:
# Rules were not submitted. Return the default description.
Expand Down
4 changes: 2 additions & 2 deletions bot/exts/moderation/defcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Action(Enum):
SERVER_OPEN = ActionInfo(Icons.defcon_unshutdown, Emojis.defcon_unshutdown, Colours.soft_green, "")
SERVER_SHUTDOWN = ActionInfo(Icons.defcon_shutdown, Emojis.defcon_shutdown, Colours.soft_red, "")
DURATION_UPDATE = ActionInfo(
Icons.defcon_update, Emojis.defcon_update, Colour.blurple(), "**Threshold:** {threshold}\n\n"
Icons.defcon_update, Emojis.defcon_update, Colour.og_blurple(), "**Threshold:** {threshold}\n\n"
)


Expand Down Expand Up @@ -152,7 +152,7 @@ async def defcon_group(self, ctx: Context) -> None:
async def status(self, ctx: Context) -> None:
"""Check the current status of DEFCON mode."""
embed = Embed(
colour=Colour.blurple(), title="DEFCON Status",
colour=Colour.og_blurple(), title="DEFCON Status",
description=f"""
**Threshold:** {humanize_delta(self.threshold) if self.threshold else "-"}
**Expires:** {discord_timestamp(self.expiry, TimestampFormats.RELATIVE) if self.expiry else "-"}
Expand Down
2 changes: 1 addition & 1 deletion bot/exts/moderation/infraction/management.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ async def infraction_edit(

await self.mod_log.send_log_message(
icon_url=constants.Icons.pencil,
colour=discord.Colour.blurple(),
colour=discord.Colour.og_blurple(),
title="Infraction edited",
thumbnail=thumbnail,
text=textwrap.dedent(f"""
Expand Down
20 changes: 10 additions & 10 deletions bot/exts/moderation/modlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ async def on_guild_channel_update(self, before: GUILD_CHANNEL, after: GuildChann
message = f"**#{after.name}** (`{after.id}`)\n{message}"

await self.send_log_message(
Icons.hash_blurple, Colour.blurple(),
Icons.hash_blurple, Colour.og_blurple(),
"Channel updated", message
)

Expand Down Expand Up @@ -326,7 +326,7 @@ async def on_guild_role_update(self, before: discord.Role, after: discord.Role)
message = f"**{after.name}** (`{after.id}`)\n{message}"

await self.send_log_message(
Icons.crown_blurple, Colour.blurple(),
Icons.crown_blurple, Colour.og_blurple(),
"Role updated", message
)

Expand Down Expand Up @@ -376,7 +376,7 @@ async def on_guild_update(self, before: discord.Guild, after: discord.Guild) ->
message = f"**{after.name}** (`{after.id}`)\n{message}"

await self.send_log_message(
Icons.guild_update, Colour.blurple(),
Icons.guild_update, Colour.og_blurple(),
"Guild updated", message,
thumbnail=after.icon.with_static_format("png")
)
Expand Down Expand Up @@ -447,7 +447,7 @@ async def on_member_unban(self, guild: discord.Guild, member: discord.User) -> N
return

await self.send_log_message(
Icons.user_unban, Colour.blurple(),
Icons.user_unban, Colour.og_blurple(),
"User unbanned", format_user(member),
thumbnail=member.display_avatar.url,
channel_id=Channels.mod_log
Expand Down Expand Up @@ -512,7 +512,7 @@ async def on_member_update(self, before: discord.Member, after: discord.Member)

await self.send_log_message(
icon_url=Icons.user_update,
colour=Colour.blurple(),
colour=Colour.og_blurple(),
title="Member updated",
text=message,
thumbnail=after.display_avatar.url,
Expand Down Expand Up @@ -718,7 +718,7 @@ async def on_message_edit(self, msg_before: discord.Message, msg_after: discord.
footer = None

await self.send_log_message(
Icons.message_edit, Colour.blurple(), "Message edited", response,
Icons.message_edit, Colour.og_blurple(), "Message edited", response,
channel_id=Channels.message_log, timestamp_override=timestamp, footer=footer
)

Expand Down Expand Up @@ -761,12 +761,12 @@ async def on_raw_message_edit(self, event: discord.RawMessageUpdateEvent) -> Non
)

await self.send_log_message(
Icons.message_edit, Colour.blurple(), "Message edited (Before)",
Icons.message_edit, Colour.og_blurple(), "Message edited (Before)",
before_response, channel_id=Channels.message_log
)

await self.send_log_message(
Icons.message_edit, Colour.blurple(), "Message edited (After)",
Icons.message_edit, Colour.og_blurple(), "Message edited (After)",
after_response, channel_id=Channels.message_log
)

Expand All @@ -776,7 +776,7 @@ async def on_thread_update(self, before: Thread, after: Thread) -> None:
if before.name != after.name:
await self.send_log_message(
Icons.hash_blurple,
Colour.blurple(),
Colour.og_blurple(),
"Thread name edited",
(
f"Thread {after.mention} (`{after.id}`) from {after.parent.mention} (`{after.parent.id}`): "
Expand Down Expand Up @@ -870,7 +870,7 @@ async def on_voice_state_update(
diff_values = {**diff.get("values_changed", {}), **diff.get("type_changes", {})}

icon = Icons.voice_state_blue
colour = Colour.blurple()
colour = Colour.og_blurple()
changes = []

for attr, values in diff_values.items():
Expand Down
2 changes: 1 addition & 1 deletion bot/exts/utils/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ async def list_command(self, ctx: Context) -> None:
Grey indicates that the extension is unloaded.
Green indicates that the extension is currently loaded.
"""
embed = Embed(colour=Colour.blurple())
embed = Embed(colour=Colour.og_blurple())
embed.set_author(
name="Extensions List",
url=URLs.github_bot_repo,
Expand Down
2 changes: 1 addition & 1 deletion bot/exts/utils/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ async def socketstats(self, ctx: Context) -> None:
stats_embed = discord.Embed(
title="WebSocket statistics",
description=f"Receiving {per_s:0.2f} events per second.",
color=discord.Color.blurple()
color=discord.Color.og_blurple()
)

for event_type, count in self.socket_events.most_common(25):
Expand Down
6 changes: 3 additions & 3 deletions bot/exts/utils/reminders.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ async def send_reminder(self, reminder: dict, expected_time: datetime = None) ->
name="Sorry, your reminder should have arrived earlier!"
)
else:
embed.colour = discord.Colour.blurple()
embed.colour = discord.Colour.og_blurple()
embed.set_author(
icon_url=Icons.remind_blurple,
name="It has arrived!"
Expand Down Expand Up @@ -350,7 +350,7 @@ async def list_reminders(self, ctx: Context) -> None:
lines.append(text)

embed = discord.Embed()
embed.colour = discord.Colour.blurple()
embed.colour = discord.Colour.og_blurple()
embed.title = f"Reminders for {ctx.author}"

# Remind the user that they have no reminders :^)
Expand All @@ -360,7 +360,7 @@ async def list_reminders(self, ctx: Context) -> None:
return

# Construct the embed and paginate it.
embed.colour = discord.Colour.blurple()
embed.colour = discord.Colour.og_blurple()

await LinePaginator.paginate(
lines,
Expand Down
2 changes: 1 addition & 1 deletion bot/exts/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ async def zen(self, ctx: Context, *, search_value: Union[int, str, None] = None)
If a string is provided, the line which matches best will be produced.
"""
embed = Embed(
colour=Colour.blurple(),
colour=Colour.og_blurple(),
title="The Zen of Python",
description=ZEN_OF_PYTHON
)
Expand Down
14 changes: 7 additions & 7 deletions tests/bot/exts/info/test_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ async def test_roles_command_command(self):
embed = kwargs.pop('embed')

self.assertEqual(embed.title, "Role information (Total 1 role)")
self.assertEqual(embed.colour, discord.Colour.blurple())
self.assertEqual(embed.colour, discord.Colour.og_blurple())
self.assertEqual(embed.description, f"\n`{self.moderator_role.id}` - {self.moderator_role.mention}\n")

async def test_role_info_command(self):
"""Tests the `role info` command."""
dummy_role = helpers.MockRole(
name="Dummy",
id=112233445566778899,
colour=discord.Colour.blurple(),
colour=discord.Colour.og_blurple(),
position=10,
members=[self.ctx.author],
permissions=discord.Permissions(0)
Expand Down Expand Up @@ -80,11 +80,11 @@ async def test_role_info_command(self):
admin_embed = admin_kwargs["embed"]

self.assertEqual(dummy_embed.title, "Dummy info")
self.assertEqual(dummy_embed.colour, discord.Colour.blurple())
self.assertEqual(dummy_embed.colour, discord.Colour.og_blurple())

self.assertEqual(dummy_embed.fields[0].value, str(dummy_role.id))
self.assertEqual(dummy_embed.fields[1].value, f"#{dummy_role.colour.value:0>6x}")
self.assertEqual(dummy_embed.fields[2].value, "0.65 0.64 242")
self.assertEqual(dummy_embed.fields[2].value, "0.63 0.48 218")
self.assertEqual(dummy_embed.fields[3].value, "1")
self.assertEqual(dummy_embed.fields[4].value, "10")
self.assertEqual(dummy_embed.fields[5].value, "0")
Expand Down Expand Up @@ -417,14 +417,14 @@ async def test_create_user_embed_uses_top_role_colour_when_user_has_roles(self):
f"{COG_PATH}.basic_user_infraction_counts",
new=unittest.mock.AsyncMock(return_value=("Infractions", "basic infractions"))
)
async def test_create_user_embed_uses_blurple_colour_when_user_has_no_roles(self):
"""The embed should be created with a blurple colour if the user has no assigned roles."""
async def test_create_user_embed_uses_og_blurple_colour_when_user_has_no_roles(self):
"""The embed should be created with the og blurple colour if the user has no assigned roles."""
ctx = helpers.MockContext()

user = helpers.MockMember(id=217, colour=discord.Colour.default())
embed = await self.cog.create_user_embed(ctx, user)

self.assertEqual(embed.colour, discord.Colour.blurple())
self.assertEqual(embed.colour, discord.Colour.og_blurple())

@unittest.mock.patch(
f"{COG_PATH}.basic_user_infraction_counts",
Expand Down