Calling a DM function from outside Discord.js

Heya, I was wondering if anyone has insight to how i can call for a DM event via a outside function, My bot is running in-junction with a Fastify server, that runs authentication for a database, and when handing out access to this, I want the bot to DM the user their randomly generated key. I would assume there's a way to go about doing this, obviously, but i don't know how i would go about doing this, do i register a event in the event handler or something similar? Or can I just make a function to do this?
2 Replies
d.js toolkit
d.js toolkit12mo ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Squid
Squid12mo ago
Instead of relying on your client, you could just make a REST API request for DMing the user, and use something like fetch() or the rest subpackage