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

[pull] master from Rapptz:master #18

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ Installing

To install the library without full voice support, you can just run the following command:

.. note::

A `Virtual Environment <https://docs.python.org/3/library/venv.html>`__ is recommended to install
the library, especially on Linux where the system Python is externally managed and restricts which
packages you can install on it.


.. code:: sh

# Linux/macOS
Expand Down
9 changes: 5 additions & 4 deletions discord/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1530,10 +1530,11 @@ async def send(
.. versionadded:: 1.4

reference: Union[:class:`~discord.Message`, :class:`~discord.MessageReference`, :class:`~discord.PartialMessage`]
A reference to the :class:`~discord.Message` to which you are replying, this can be created using
:meth:`~discord.Message.to_reference` or passed directly as a :class:`~discord.Message`. You can control
whether this mentions the author of the referenced message using the :attr:`~discord.AllowedMentions.replied_user`
attribute of ``allowed_mentions`` or by setting ``mention_author``.
A reference to the :class:`~discord.Message` to which you are referencing, this can be created using
:meth:`~discord.Message.to_reference` or passed directly as a :class:`~discord.Message`.
In the event of a replying reference, you can control whether this mentions the author of the referenced
message using the :attr:`~discord.AllowedMentions.replied_user` attribute of ``allowed_mentions`` or by
setting ``mention_author``.

.. versionadded:: 1.6

Expand Down
10 changes: 9 additions & 1 deletion discord/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def __init__(self, **kwargs: bool):
setattr(self, key, value)

@classmethod
def _from_value(cls, value):
def _from_value(cls, value: int) -> Self:
self = cls.__new__(cls)
self.value = value
return self
Expand Down Expand Up @@ -490,6 +490,14 @@ def voice(self):
"""
return 8192

@flag_value
def forwarded(self):
""":class:`bool`: Returns ``True`` if the message is a forwarded message.

.. versionadded:: 2.5
"""
return 16384


@fill_with_flags()
class PublicUserFlags(BaseFlags):
Expand Down
8 changes: 3 additions & 5 deletions discord/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ class MessageReference:
guild_id: Optional[:class:`int`]
The guild id of the message referenced.
fail_if_not_exists: :class:`bool`
Whether replying to the referenced message should raise :class:`HTTPException`
Whether the referenced message should raise :class:`HTTPException`
if the message no longer exists or Discord could not fetch the message.

.. versionadded:: 1.7
Expand All @@ -627,8 +627,6 @@ class MessageReference:
If the message was resolved at a prior point but has since been deleted then
this will be of type :class:`DeletedReferencedMessage`.

Currently, this is mainly the replied to message when a user replies to a message.

.. versionadded:: 1.6
"""

Expand Down Expand Up @@ -680,7 +678,7 @@ def from_message(
message: :class:`~discord.Message`
The message to be converted into a reference.
fail_if_not_exists: :class:`bool`
Whether replying to the referenced message should raise :class:`HTTPException`
Whether the referenced message should raise :class:`HTTPException`
if the message no longer exists or Discord could not fetch the message.

.. versionadded:: 1.7
Expand Down Expand Up @@ -1869,7 +1867,7 @@ def to_reference(
Parameters
----------
fail_if_not_exists: :class:`bool`
Whether replying using the message reference should raise :class:`HTTPException`
Whether the referenced message should raise :class:`HTTPException`
if the message no longer exists or Discord could not fetch the message.

.. versionadded:: 1.7
Expand Down
Loading