#help

1 messages · Page 1 of 1 (latest)

hot violet
#

how?

#

also sometimes it doesnt delete the original channel

storm path
#

do you run the command twice in the same channel

hot violet
#

when i run the command first time it works

#

then i go to the new channel

#

it errors once i run it the 2nd time

#

@storm path how to fix? i never encountered such error

storm path
#

are you sure you are not sending any other message into that channel

hot violet
#

yes

storm path
#

also try awaiting the send

#

or catch them

hot violet
#

will try

storm path
#

that way we can know which one errored

hot violet
#
const name = 'clear';
module.exports = async (message, args) => {
    if (!message.member.permissions.has("MANAGE_CHANNELS")) return message.reply("you don't have the permission for that.");
    if (!message.guild.me.permissions.has("MANAGE_CHANNELS")) return message.channel.send("I don't have the permission for that.");
    
    try {
        await message.channel.clone({position: message.channel.rawPosition }).then(ch => { ch.send('Channel nuked'); })
        console.log(`${message.member.user.tag} executed command '!${name}'. Take cover!`)
    } catch (err) {
        console.log(`${message.member.user.tag} executed command '!${name}', but it didn't work!`)
    }
    await message.channel.delete();
};
``` like this? @storm path