S
S
ScripterAD2019-07-24 13:30:05
JavaScript
ScripterAD, 2019-07-24 13:30:05

Problem with code, can you help?

The other day I found a code in an English video course and there was this code:

const Discord = require("discord.js")

module.exports.run = async (bot, message, args) => {
    if(!message.member.hasPermission(["MANAGE_MESSAGES", "ADMINISTRATOR"])) return message.channel.send("You can not use this command!")

    let argsresult;
    let mChannel = message.mentions.channels.first()
    
    message.delete()
    if(mChannel) {
        argsresult = args.slice(1).join(" ")
        mChannel.send(argsresult)
    }   else {
        argsresult = args.join(" ")
        message.channel.send(argsresult)
    }
}

But at startup nothing happens no error at all nothing I have searched everywhere please help.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question