Browse Source

Check for view finished state before resuming listening on edit

pull/7005/head
Rapptz 4 years ago
parent
commit
4a3491cc0a
  1. 2
      discord/interactions.py
  2. 4
      discord/message.py
  3. 2
      discord/webhook/async_.py

2
discord/interactions.py

@ -418,7 +418,7 @@ class InteractionResponse:
data=payload,
)
if view is not MISSING:
if view is not MISSING and not view.is_finished():
msg = self._parent.message
message_id = msg.id if msg else None
self._parent._state.store_view(view, message_id)

4
discord/message.py

@ -1225,7 +1225,7 @@ class Message(Hashable):
data = await self._state.http.edit_message(self.channel.id, self.id, **fields)
self._update(data)
if view:
if view and not view.is_finished():
self._state.store_view(view, self.id)
if delete_after is not None:
@ -1700,6 +1700,6 @@ class PartialMessage(Hashable):
if fields:
msg = self._state.create_message(channel=self.channel, data=data) # type: ignore
if view:
if view and not view.is_finished():
self._state.store_view(view, self.id)
return msg

2
discord/webhook/async_.py

@ -1327,7 +1327,7 @@ class Webhook(BaseWebhook):
if wait:
msg = self._create_message(data)
if view is not MISSING:
if view is not MISSING and not view.is_finished():
message_id = None if msg is None else msg.id
self._state.store_view(view, message_id)

Loading…
Cancel
Save