Skip to content

Commit

Permalink
add masquerade colour
Browse files Browse the repository at this point in the history
  • Loading branch information
Zomatree committed Jul 15, 2022
1 parent e34af62 commit d187fff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions revolt/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,12 @@ class Masquerade(NamedTuple):
The name to display for the message
avatar: Optional[:class:`str`]
The avatar's url to display for the message
colour: Optional[:class:`str`]
The colour of the name, similar to role colours
"""
name: Optional[str] = None
avatar: Optional[str] = None
colour: Optional[str] = None

def to_dict(self) -> MasqueradePayload:
output: MasqueradePayload = {}
Expand All @@ -173,4 +176,7 @@ def to_dict(self) -> MasqueradePayload:
if avatar := self.avatar:
output["avatar"] = avatar

if colour := self.colour:
output["colour"] = colour

return output
1 change: 1 addition & 0 deletions revolt/types/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class ChannelIconChangeContent(TypedDict):
class Masquerade(TypedDict, total=False):
name: str
avatar: str
colour: str

class Message(TypedDict):
_id: str
Expand Down

0 comments on commit d187fff

Please sign in to comment.