From 4aecdea0524e7b481f9750166bf9e9be287ec445 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Fri, 20 Jul 2018 04:17:28 -0400 Subject: Make TextChannel.create_webhook name parameter mandatory. --- discord/channel.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'discord/channel.py') diff --git a/discord/channel.py b/discord/channel.py index 27b6301e..a79b3424 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -340,7 +340,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): data = await self._state.http.channel_webhooks(self.id) return [Webhook.from_state(d, state=self._state) for d in data] - async def create_webhook(self, *, name=None, avatar=None): + async def create_webhook(self, *, name, avatar=None): """|coro| Creates a webhook for this channel. @@ -349,7 +349,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): Parameters ------------- - name: Optional[str] + name: str The webhook's name. avatar: Optional[bytes] A *bytes-like* object representing the webhook's default avatar. @@ -371,10 +371,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable): if avatar is not None: avatar = utils._bytes_to_base64_data(avatar) - if name is not None: - name = str(name) - - data = await self._state.http.create_webhook(self.id, name=name, avatar=avatar) + data = await self._state.http.create_webhook(self.id, name=str(name), avatar=avatar) return Webhook.from_state(data, state=self._state) class VoiceChannel(discord.abc.Connectable, discord.abc.GuildChannel, Hashable): -- cgit v1.2.3