mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-08 04:38:42 +00:00
Update Webhook.channel typing to include VoiceChannel as well
This commit is contained in:
parent
c284145f18
commit
538ba0d076
@ -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…
x
Reference in New Issue
Block a user