diff options
Diffstat (limited to 'discord/channel.py')
| -rw-r--r-- | discord/channel.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/discord/channel.py b/discord/channel.py index a554d0d5..c02c00f3 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -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): |