#ulong as slash command argument results in 'input a valid integer'

1 messages · Page 1 of 1 (latest)

coarse glen
#

What gives?

fallen elk
#

Users ids are to long for discord to want to parse

#

You will need to make the input a string then convert afterwords

#

I can share what I use if you want

coarse glen
#

Okay so this is hitting the JSON int limit then

#

I figured they would have a bigint/double at this point but I will use string instead then

full nymph
#

You could just use an IUser as the param, it accepts user selection from the dropdown or id

coarse glen
#

let me try that

full nymph
#

I believe you can also use more specific castings like SocketGuildUser but I generally just use IUser and cast it to what I need

fallen elk
#

iUser only works on users tho

#

wont accept role-ids

full nymph
#

Use IRole then

#

Sorry didn't realize you needed a role ID, but it works the same for roles and channels

fallen elk
#

no i was using it as a example, not sure what they need it for

coarse glen
#

This method name/argument is misleading -- the method is taking an userID and testing role updates, so the argument is an actual user. IUser casted into SocketGuildUser might do the trick here

full nymph
#

Yeah it depends on what exactly you are trying to do

#

But regardless, IRole or IUser would work for the param to accept the ID of whichever you need to pass and then you can then cast it into something more specific. Though I'm pretty sure you can just swap IRole/IUser with the specific casts (such as SocketGuildUser) as the original param and it should work there as well

coarse glen
#

Yeah, I passed a IUser and casted it to SocketGuildUser and that solved the case. Thansk for the help

#

marking as solved