Fix create_scheduled_event param handling

This commit is contained in:
Puncher
2023-03-05 23:28:50 +01:00
committed by GitHub
parent a938b10e5a
commit 60094b17a9
2 changed files with 97 additions and 28 deletions

View File

@ -503,18 +503,17 @@ class ScheduledEvent(Hashable):
entity_type = EntityType.stage_instance
elif location not in (MISSING, None):
entity_type = EntityType.external
else:
if not isinstance(entity_type, EntityType):
raise TypeError('entity_type must be of type EntityType')
payload['entity_type'] = entity_type.value
if entity_type is None:
raise TypeError(
f'invalid GuildChannel type passed, must be VoiceChannel or StageChannel not {channel.__class__.__name__}'
)
if entity_type is not MISSING:
if not isinstance(entity_type, EntityType):
raise TypeError('entity_type must be of type EntityType')
payload['entity_type'] = entity_type.value
_entity_type = entity_type or self.entity_type
_entity_type_changed = _entity_type is not self.entity_type