mirror of
				https://github.com/Rapptz/discord.py.git
				synced 2025-10-27 03:22:55 +00:00 
			
		
		
		
	Fix warning in entity_type reassignment
This commit is contained in:
		| @@ -2746,14 +2746,16 @@ class Guild(Hashable): | |||||||
|             if channel is MISSING: |             if channel is MISSING: | ||||||
|                 entity_type = EntityType.external |                 entity_type = EntityType.external | ||||||
|             else: |             else: | ||||||
|                 entity_type = getattr(channel, '_scheduled_event_entity_type', MISSING) |                 _entity_type = getattr(channel, '_scheduled_event_entity_type', MISSING) | ||||||
|                 if entity_type is None: |                 if _entity_type is None: | ||||||
|                     raise TypeError( |                     raise TypeError( | ||||||
|                         f'invalid GuildChannel type passed, must be VoiceChannel or StageChannel not {channel.__class__!r}' |                         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') |                     raise TypeError('entity_type must be passed in when passing an ambiguous channel type') | ||||||
|  |  | ||||||
|  |                 entity_type = _entity_type | ||||||
|  |  | ||||||
|         if not isinstance(entity_type, EntityType): |         if not isinstance(entity_type, EntityType): | ||||||
|             raise TypeError('entity_type must be of type EntityType') |             raise TypeError('entity_type must be of type EntityType') | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user