Skip to content

Commit 998a663

Browse files
use the same colours discord github webhooks use for comments
1 parent 34f3caf commit 998a663

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

monty/constants.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ class GHColour(int, enum.Enum):
235235
attention = 0x9A6700
236236
default = 0x1F2328
237237

238+
# These are used by Discord
239+
issue_comment = 0xE68D60
240+
pull_comment = 0xBFE5BF
241+
238242

239243
## DEPRECATED
240244
# TODO: Will be replaced in favour of application emojis

monty/exts/info/github/_handlers.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
T = TypeVar("T", bound=githubkit.GitHubModel)
2424
V = TypeVar("V", bound=ghretos.GitHubResource)
2525

26-
GITHUB_COLOUR = disnake.Colour(0xFFFFFF)
27-
2826

2927
class VisualStyleState(NamedTuple):
3028
emoji: disnake.Emoji | disnake.PartialEmoji
@@ -395,9 +393,13 @@ def render_ogp(
395393
| ghretos.PullRequestReviewComment
396394
| ghretos.DiscussionComment,
397395
) -> disnake.Embed:
396+
if isinstance(obj, githubkit.rest.PullRequestReviewComment):
397+
colour = constants.GHColour.pull_comment
398+
else:
399+
colour = constants.GHColour.issue_comment
398400
embed = disnake.Embed(
399401
url=obj.html_url,
400-
colour=GITHUB_COLOUR,
402+
colour=colour,
401403
description="",
402404
timestamp=obj.created_at,
403405
)

0 commit comments

Comments
 (0)