Browse Source

Update Webhook.channel typing to include VoiceChannel as well

pull/7870/head
Rapptz 3 years ago
parent
commit
538ba0d076
  1. 8
      discord/webhook/async_.py

8
discord/webhook/async_.py

@ -46,7 +46,7 @@ from ..asset import Asset
from ..partial_emoji import PartialEmoji from ..partial_emoji import PartialEmoji
from ..http import Route, handle_message_parameters, MultipartParameters, HTTPClient from ..http import Route, handle_message_parameters, MultipartParameters, HTTPClient
from ..mixins import Hashable from ..mixins import Hashable
from ..channel import PartialMessageable from ..channel import TextChannel, PartialMessageable
from ..file import File from ..file import File
__all__ = ( __all__ = (
@ -69,7 +69,7 @@ if TYPE_CHECKING:
from ..http import Response from ..http import Response
from ..guild import Guild from ..guild import Guild
from ..emoji import Emoji from ..emoji import Emoji
from ..channel import TextChannel from ..channel import VoiceChannel
from ..abc import Snowflake from ..abc import Snowflake
from ..ui.view import View from ..ui.view import View
import datetime import datetime
@ -932,8 +932,8 @@ class BaseWebhook(Hashable):
return self._state and self._state._get_guild(self.guild_id) return self._state and self._state._get_guild(self.guild_id)
@property @property
def channel(self) -> Optional[TextChannel]: def channel(self) -> Optional[Union[VoiceChannel, TextChannel]]:
"""Optional[:class:`TextChannel`]: The text channel this webhook belongs to. """Optional[Union[:class:`VoiceChannel`, :class:`TextChannel`]]: The channel this webhook belongs to.
If this is a partial webhook, then this will always return ``None``. If this is a partial webhook, then this will always return ``None``.
""" """

Loading…
Cancel
Save