Skip to content Skip to sidebar Skip to footer

Discord.js - Cannot Read Property Of Undefined Inside Execute() Method

I'm making a simple snipe command which views last deleted messages. The problem is I receive the following error when the command is used: 'TypeError: Cannot read property 'get' o

Solution 1:

Make sure, the order of the arguments is the same in both files. If you pass them like command.execute(message, args, client), the method should use the same order: execute(message, args, client) {....

try {
    command.execute(message, args, client);
} catch (error) {
    ...
module.exports = {
    name: 'snipe',
    description: 'snipes the deleted message/image',
    execute(message, args, client) {
        ...
    }
}

Post a Comment for "Discord.js - Cannot Read Property Of Undefined Inside Execute() Method"