Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(message): implement message forwarding #1188

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e232ef2
implement message forwarding
Snipy7374 Apr 25, 2024
2291ba7
finalize feature
Snipy7374 Apr 27, 2024
c219eb0
add documentation for message forward method
Snipy7374 Apr 27, 2024
f01eba6
update changelog
Snipy7374 Apr 27, 2024
4b20515
add MessageReferenceType to the docs
Snipy7374 Apr 27, 2024
ba2dd4e
fix docs
Snipy7374 Apr 27, 2024
c1a6551
fix: make users be able to choose where to send forwards
Snipy7374 Apr 30, 2024
35acee8
Update disnake/abc.py
Snipy7374 Nov 14, 2024
f5da391
Update disnake/message.py
Snipy7374 Nov 14, 2024
c572922
feat: implement new attributes for ForwardedMessage class and fix doc…
Snipy7374 Nov 14, 2024
0d32187
Merge branch 'master' into feat/forward
Snipy7374 Nov 14, 2024
ed8bd63
fix: docstrings and run pre-commit
Snipy7374 Nov 14, 2024
b45c2cc
fix: remove old interaction attr - wrong conflicts resolution :'(
Snipy7374 Nov 14, 2024
8db23bf
Update disnake/abc.py
Snipy7374 Nov 16, 2024
c9181d0
Update disnake/message.py
Snipy7374 Nov 16, 2024
fb8a4b7
Update disnake/message.py
Snipy7374 Nov 16, 2024
32f682b
Update docs/api/messages.rst
Snipy7374 Nov 16, 2024
f93efc8
Update disnake/message.py
Snipy7374 Nov 16, 2024
bbbc5c7
Update disnake/message.py
Snipy7374 Nov 16, 2024
9e54d14
feat: apply suggested changes
Snipy7374 Nov 16, 2024
d4fe03f
Merge branch 'feat/forward' of github.com:Snipy7374/disnake into feat…
Snipy7374 Nov 16, 2024
dfb26ff
feat: implement forward on PartialMessage
Snipy7374 Nov 16, 2024
3a03f69
fix: remove useless variable
Snipy7374 Nov 16, 2024
cfeffe1
fix: make type required to forward in TypedDict, remove TODO comment …
Snipy7374 Nov 16, 2024
e7d9a60
feat: implement logic for mentions and role_mentions (mention_roles) …
Snipy7374 Nov 16, 2024
ef05e6c
feat: refeactor mention and role_mentions attrs build for ForwardedMe…
Snipy7374 Nov 16, 2024
ffe679f
fix: make annotations for _handle_mentions and Member._try_upgrade co…
Snipy7374 Nov 18, 2024
774be89
Merge branch 'master' into feat/forward
Snipy7374 Nov 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/1187.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for message forwarding. New :class:`ForwardedMessage`, new enum :class:`MessageReferenceType`, new method :func:`Message.forward`, edited :class:`MessageReference` to support message forwarding.
5 changes: 5 additions & 0 deletions disnake/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1604,6 +1604,11 @@ async def send(

.. versionadded:: 1.6

.. note::

Passing a :class:`.Message` or :class:`.PartialMessage` will only allow replies. To forward a message
you must explicitly transform the message to a :class:`.MessageReference` using :meth:`.Message.to_reference` and specify the :class:`.MessageReferenceType`.
Snipy7374 marked this conversation as resolved.
Show resolved Hide resolved

mention_author: Optional[:class:`bool`]
If set, overrides the :attr:`.AllowedMentions.replied_user` attribute of ``allowed_mentions``.

Expand Down
8 changes: 8 additions & 0 deletions disnake/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"EntitlementType",
"PollLayoutType",
"VoiceChannelEffectAnimationType",
"MessageReferenceType",
)


Expand Down Expand Up @@ -1414,6 +1415,13 @@ class VoiceChannelEffectAnimationType(Enum):
basic = 1


class MessageReferenceType(Enum):
default = 0
"""A standard message reference used in message replies."""
forward = 1
"""Reference used to point to a message at a point in time (forward)."""


T = TypeVar("T")


Expand Down
Loading
Loading