1
0
mirror of https://github.com/Rapptz/discord.py.git synced 2025-05-15 18:29:52 +00:00

Fix warning in entity_type reassignment

This commit is contained in:
Rapptz 2022-06-06 12:26:05 -04:00
parent 3fe9fc92eb
commit 75d57ab3ce

@ -2746,14 +2746,16 @@ class Guild(Hashable):
if channel is MISSING:
entity_type = EntityType.external
else:
entity_type = getattr(channel, '_scheduled_event_entity_type', MISSING)
if entity_type is None:
_entity_type = getattr(channel, '_scheduled_event_entity_type', MISSING)
if _entity_type is None:
raise TypeError(
f'invalid GuildChannel type passed, must be VoiceChannel or StageChannel not {channel.__class__!r}'
)
if entity_type is MISSING:
if _entity_type is MISSING:
raise TypeError('entity_type must be passed in when passing an ambiguous channel type')
entity_type = _entity_type
if not isinstance(entity_type, EntityType):
raise TypeError('entity_type must be of type EntityType')