mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-19 04:24:41 +00:00
Allow more methods to set an audit log reason
This commit is contained in:
@@ -856,7 +856,7 @@ class Message:
|
||||
|
||||
await self._state.http.publish_message(self.channel.id, self.id)
|
||||
|
||||
async def pin(self):
|
||||
async def pin(self, *, reason=None):
|
||||
"""|coro|
|
||||
|
||||
Pins the message.
|
||||
@@ -864,6 +864,13 @@ class Message:
|
||||
You must have the :attr:`~Permissions.manage_messages` permission to do
|
||||
this in a non-private channel context.
|
||||
|
||||
Parameters
|
||||
-----------
|
||||
reason: Optional[:class:`str`]
|
||||
The reason for pinning the message. Shows up on the audit log.
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
Raises
|
||||
-------
|
||||
Forbidden
|
||||
@@ -875,10 +882,10 @@ class Message:
|
||||
having more than 50 pinned messages.
|
||||
"""
|
||||
|
||||
await self._state.http.pin_message(self.channel.id, self.id)
|
||||
await self._state.http.pin_message(self.channel.id, self.id, reason=reason)
|
||||
self.pinned = True
|
||||
|
||||
async def unpin(self):
|
||||
async def unpin(self, *, reason=None):
|
||||
"""|coro|
|
||||
|
||||
Unpins the message.
|
||||
@@ -886,6 +893,13 @@ class Message:
|
||||
You must have the :attr:`~Permissions.manage_messages` permission to do
|
||||
this in a non-private channel context.
|
||||
|
||||
Parameters
|
||||
-----------
|
||||
reason: Optional[:class:`str`]
|
||||
The reason for pinning the message. Shows up on the audit log.
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
Raises
|
||||
-------
|
||||
Forbidden
|
||||
@@ -896,7 +910,7 @@ class Message:
|
||||
Unpinning the message failed.
|
||||
"""
|
||||
|
||||
await self._state.http.unpin_message(self.channel.id, self.id)
|
||||
await self._state.http.unpin_message(self.channel.id, self.id, reason=reason)
|
||||
self.pinned = False
|
||||
|
||||
async def add_reaction(self, emoji):
|
||||
|
Reference in New Issue
Block a user