Tz055
Tz055

Reputation: 1

Eris sending a message to a specific channel

I use Eris to write a bot for Discord. The documentation says that to send a message to the channel, you need to enter its ID, and then the message being sent, createMessage(channelID, content, file) but after applying the command, an error is issued: Invalid file object

My code looks like this:

export default {
    name: 'test',
    description: 'Pi pi poo poo',
    execute: async (i) => {
        await
        i.createMessage('535986994145263663', 'Yo');
    },
};

Maybe I missed something?

I wrote the variables in different order, but nothing happened

Upvotes: 0

Views: 245

Answers (1)

app
app

Reputation: 1

you have placed the wrong params.

export default {
    name: 'test',
    description: 'Pi pi poo poo',
    execute: async (i) => {
        await i.createMessage('Yo');
    },
};

it seems like you have assumed that interaction.createMessage takes the exact same params as client.createMessage which is not true.
happy coding ;)

Upvotes: 0

Related Questions