@@ -89,7 +89,8 @@ def __bool__(self) -> bool:
8989 or bool (self .attachments )
9090 )
9191
92- def get (self , snowflake : Snowflake , default : typing .Any = None ) -> typing .Any :
92+ def get (self , snowflake : Snowflake | str , default : typing .Any = None ) -> typing .Any :
93+ snowflake = Snowflake (snowflake )
9394 """Returns the value of the given snowflake."""
9495 if channel := self .channels .get (snowflake ):
9596 return channel
@@ -353,31 +354,8 @@ def gather_options(_options: list[dict[str, typing.Any]]) -> dict[str, typing.An
353354
354355 value = option .get ("value" )
355356
356- # resolve data using the cache
357- match option ["type" ]:
358- case OptionType .USER :
359- if self .guild_id :
360- value = (
361- self .client .cache .get_member (self .guild_id , value )
362- or self .client .cache .get_user (value )
363- or value
364- )
365- else :
366- value = self .client .cache .get_user (value ) or value
367- case OptionType .CHANNEL :
368- value = self .client .cache .get_channel (value )
369- case OptionType .ROLE :
370- value = self .client .cache .get_role (value ) or value
371- case OptionType .MENTIONABLE :
372- snow = Snowflake (value )
373- if user := (
374- self .client .cache .get_member (self .guild_id , snow ) or self .client .cache .get_user (snow )
375- ):
376- value = user
377- elif channel := self .client .cache .get_channel (snow ):
378- value = channel
379- elif role := self .client .cache .get_role (snow ):
380- value = role
357+ if option ["type" ] in OptionType .resolvable_types ():
358+ value = self .resolved .get (value , value )
381359
382360 kwargs [option ["name" ]] = value
383361 return kwargs
0 commit comments