#Check if role is valid from Id not working

1 messages · Page 1 of 1 (latest)

zinc viper
#

Hey, do you have any idea why my method to check if a role is still valid from it's id is always returning true

teal mason
#

What do you mean with is valid? eg if the role is deleted?

teal mason
#

Try to use get roleAsync. The normal method seems to doesnt throw exceptions

zinc viper
#

i'll try, because i was expecting to get an exception

teal mason
#

hm

#

in the dsharp api doc are no possible exceptions listed

zinc viper
#

wdym ?

#

btw i can't find the getRoleasync

teal mason
#

my bad

#

wrong section

#

do a null check on the return value of GetRole

#

it seems to return null when its not found