How do i make a slash command that dms a user in discord.js

22 Views Asked by At

When I make a slash command in Discord js that DM me a YouTuber request it does not work and gives me an error. There was an error while executing this command! Can anyone help I'm using node.js to code discord.js it's using the discord js faq for the client.users.send('user id', 'youtuber request'); and the guide is everything else

My code:

const { SlashCommandBuilder } = require("discord.js");

module.exports = {
    data: new SlashCommandBuilder().setName("youtuber").setDescription("sends zachary a dm to see your channel"),
    async execute(interaction) {
        await client.users.send("1187767154909642843", "youtuber request");
    },
};
0

There are 0 best solutions below