Theo's Typesafe CultTTC
Theo's Typesafe Cultโ€ข3y agoโ€ข
8 replies
hyhy

Linking NextAuth Discord provider to Discord user calling a slash command

I've got an application that allows users to sign in using the NextAuth Discord provider.

I'm creating a Discord bot with a slash command that, when called, will create a chat room on my application and then reply to the user with a link (basically just a prisma create, return object id).

My issue is that the user needs to be assigned the room owner, so that they can only have 1 active room. Is it possible to do this? I was hoping to just find the user by email address but this isn't returned by the Discord API. It looks like the user's name doesn't update in the db if they change it.
Solution
It is the Discord user id is store i canโ€™t remember if itโ€™s in user table or account but create a user and search for the id ๐Ÿ‘
Was this page helpful?