Allow more methods to set an audit log reason
This commit is contained in:
@ -471,7 +471,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
|
||||
data = await self._state.http.create_webhook(self.id, name=str(name), avatar=avatar, reason=reason)
|
||||
return Webhook.from_state(data, state=self._state)
|
||||
|
||||
async def follow(self, *, destination):
|
||||
async def follow(self, *, destination, reason=None):
|
||||
"""
|
||||
Follows a channel using a webhook.
|
||||
|
||||
@ -488,6 +488,10 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
|
||||
-----------
|
||||
destination: :class:`TextChannel`
|
||||
The channel you would like to follow from.
|
||||
reason: Optional[:class:`str`]
|
||||
The reason for following the channel. Shows up on the destination guild's audit log.
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
Raises
|
||||
-------
|
||||
@ -508,7 +512,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
|
||||
if not isinstance(destination, TextChannel):
|
||||
raise InvalidArgument('Expected TextChannel received {0.__name__}'.format(type(destination)))
|
||||
|
||||
data = await self._state.http.follow_webhook(self.id, webhook_channel_id=destination.id)
|
||||
data = await self._state.http.follow_webhook(self.id, webhook_channel_id=destination.id, reason=reason)
|
||||
return Webhook._as_follower(data, channel=destination, user=self._state.user)
|
||||
|
||||
class VoiceChannel(discord.abc.Connectable, discord.abc.GuildChannel, Hashable):
|
||||
|
Reference in New Issue
Block a user