Skip to content

Commit

Permalink
Update discord/message.py
Browse files Browse the repository at this point in the history
Signed-off-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com>
  • Loading branch information
Dorukyum authored Jan 31, 2024
1 parent 3e2164e commit eacf38f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions discord/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,13 @@ def __init__(self, *, data: AttachmentPayload, state: ConnectionState):
self._is: str | None = None
self.hm: str | None = None

q = urlparse(self.url).query
query = urlparse(self.url).query
extras = ["_ex", "_is", "hm"]
if qs := parse_qs(q):
if query_params := parse_qs(query):
for attr in extras:
v = "".join(qs.get(attr.replace("_", ""), []))
if v:
setattr(self, attr, v)
value = "".join(query_params.get(attr.replace("_", ""), []))
if value:
setattr(self, attr, value)

@property
def expires_at(self) -> datetime.datetime:
Expand Down

0 comments on commit eacf38f

Please sign in to comment.