Add support for PartialMessageable instances

This allows library users to send messages to channels without fetching
it first.
This commit is contained in:
Rapptz
2021-08-10 09:24:49 -04:00
parent 4fca699810
commit 1279510194
6 changed files with 125 additions and 30 deletions

View File

@ -78,7 +78,7 @@ if TYPE_CHECKING:
from .channel import CategoryChannel
from .embeds import Embed
from .message import Message, MessageReference, PartialMessage
from .channel import TextChannel, DMChannel, GroupChannel
from .channel import TextChannel, DMChannel, GroupChannel, PartialMessageable
from .threads import Thread
from .enums import InviteTarget
from .ui.view import View
@ -88,7 +88,7 @@ if TYPE_CHECKING:
OverwriteType,
)
PartialMessageableChannel = Union[TextChannel, Thread, DMChannel]
PartialMessageableChannel = Union[TextChannel, Thread, DMChannel, PartialMessageable]
MessageableChannel = Union[PartialMessageableChannel, GroupChannel]
SnowflakeTime = Union["Snowflake", datetime]