Skip to content

Commit

Permalink
remove code repetition #1
Browse files Browse the repository at this point in the history
Signed-off-by: CommandLine <71168720+Def-Try@users.noreply.github.com>
  • Loading branch information
Def-Try authored Jan 15, 2024
1 parent 1a37a0d commit 0773b80
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions discord/webhook/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ class SyncWebhookMessage(Message):
"""

_state: _WebhookState
_thread_id: int | None = None

def edit(
self,
Expand Down Expand Up @@ -515,7 +516,7 @@ def edit(
There was no token associated with this webhook.
"""
thread = MISSING
if hasattr(self, "_thread_id") and self._thread_id is not None:
if self._thread_id is not None:
thread = Object(self._thread_id)
elif isinstance(self.channel, Thread):
thread = Object(self.channel.id)
Expand Down Expand Up @@ -555,7 +556,7 @@ def delete(self, *, delay: float | None = None) -> None:
"""

thread_id: int | None = None
if hasattr(self, "_thread_id") and self._thread_id is not None:
if self._thread_id is not None:
thread_id = self._thread_id
elif isinstance(self.channel, Thread):
thread_id = self.channel.id
Expand Down

0 comments on commit 0773b80

Please sign in to comment.