add support for delete_after kwarg for interaction and webhook messages #79

Open
ethanolchik wants to merge 4 commits from ethanolchik/2.0 into 2.0
ethanolchik commented 2021-09-28 12:48:05 +00:00 (Migrated from github.com)

Summary

adds a delete_message: Optional[float] = None kwarg to interaction.send_message and Webhook.send.
adds a delay: Optional[float] = None parameter to Interaction.delete_original_message.

note: delete_after for Webhook.send will only work if wait kwarg is True.

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)
<!-- Pull requests that do not fill this information in will likely be closed --> ## Summary adds a `delete_message: Optional[float] = None` kwarg to `interaction.send_message` and `Webhook.send`. adds a `delay: Optional[float] = None` parameter to `Interaction.delete_original_message`. note: `delete_after` for `Webhook.send` will only work if `wait` kwarg is `True`. ## Checklist - [x] If code changes were made then they have been tested. - [x] I have updated the documentation to reflect the changes. - [ ] This PR fixes an issue. - [x] This PR adds something new (e.g. new method or parameters). - [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed) - [ ] This PR is **not** a code change (e.g. documentation, README, ...)
Gnome-py (Migrated from github.com) requested changes 2021-10-01 16:15:58 +00:00
Gnome-py (Migrated from github.com) left a comment

Good idea, however needs to be reworked to act more like delete_after in Message.delete

Good idea, however needs to be reworked to act more like delete_after in ``Message.delete``
@ -354,2 +362,4 @@
"""
if delay is not None:
await asyncio.sleep(delay)
adapter = async_context.get()
Gnome-py (Migrated from github.com) commented 2021-10-01 16:06:38 +00:00

This is not done in the background as the docs say, please make it do.

This is not done in the background as the docs say, please make it do.
Gnome-py (Migrated from github.com) commented 2021-10-01 16:06:57 +00:00

Needs await

Needs ``await``
Gnome-py (Migrated from github.com) commented 2021-10-01 16:08:05 +00:00

If you are modifying this to use delay in delete_original_message this shouldn't be in a task.

If you are modifying this to use delay in ``delete_original_message`` this shouldn't be in a task.
Gnome-py (Migrated from github.com) commented 2021-10-01 16:13:42 +00:00

If you are modifying this to use delay in delete_message this shouldn't be in a task.

If you are modifying this to use delay in ``delete_message`` this shouldn't be in a task.
Gnome-py (Migrated from github.com) commented 2021-10-01 16:14:27 +00:00

This is not done in the background as the docs say, please make it do.

This is not done in the background as the docs say, please make it do.
Soheab commented 2021-10-30 16:07:49 +00:00 (Migrated from github.com)

@ethanolchik Please do the requested changes above.

@ethanolchik Please do the requested changes above.
This pull request can be merged automatically.
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin ethanolchik/2.0:ethanolchik/2.0
git checkout ethanolchik/2.0
Sign in to join this conversation.
No description provided.