nyx

The first CODM discrod bot -- cath.exe Template
git clone https://codeberg.org/night0721/nyx
Log | Files | Refs | LICENSE

dm.js (865B)


      1 module.exports = {
      2   name: "dm",
      3   category: "Owner",
      4   usage: "(User) (Message)",
      5   description: "DM a user",
      6   Owner: true,
      7   options: [
      8     {
      9       type: 6,
     10       name: "user",
     11       description: "The user you want to send",
     12       required: true,
     13     },
     14     {
     15       type: 3,
     16       name: "msg",
     17       description: "The message you want to send",
     18       required: true,
     19     },
     20   ],
     21   run: async (client, interaction, args) => {
     22     const user = interaction.options.getUser("user");
     23     if (!user) return interaction.followUp("User?");
     24     if (!args[1]) return interaction.followUp("Message?");
     25     try {
     26       await user
     27         .send({ content: args[1] })
     28         .then(() => interaction.followUp({ content: `Sent message` }));
     29     } catch (err) {
     30       interaction.user.send({ content: "That user can't be dmed" });
     31     }
     32   },
     33 };