2021年3月4日星期四

discord.js Welcome message

yea hello I'm making a discord.js bot and I have this code currently and it REFUSES to send a message (it doesn't error either

    let chx = db.get(`welchannel_${member.guild.id}`);      if (chx === null) {        return;      }             let data = await canva.welcome(member, { link: "https://i.pinimg.com/originals/f3/1c/39/f31c39d56512dc8fbf30f9d0fb3ee9d3.jpg" })             const attachment = new discord.MessageAttachment(          data,          "welcome-image.png"        );                  client.channels.cache.get(chx).send("Welcome to our Server " + member.user.username, attachment);    });  

and then i have welcome.js with this code but it aint sending and i cant figure out why ...

const db = require("quick.db")    module.exports = {    name: "setwelcome",    category: "moderation",    usage: "setwelcome <#channel>",    description: "Set the welcome channel",    run: (client, message, args) => {            let channel = message.mentions.channels.first()            if(!channel) {        return message.channel.send("Please Mention the channel first")      }            //Now we gonna use quick.db            db.set(`welchannel_${message.guild.id}`, channel.id)            message.channel.send(`Welcome Channel is set to ${channel}`)    }  }```  
https://stackoverflow.com/questions/66484649/discord-js-welcome-message March 05, 2021 at 07:39AM

没有评论:

发表评论