0

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

Zsolt Meszaros
  • 21,961
  • 19
  • 54
  • 57
Tz055
  • 1
  • 1
  • It doesn't seem like discord.js so removed that tag. Any reason you're using this instead of the well-documented discord.js package though? What is `i`? An `interaction`? Where do you call `execute`? – Zsolt Meszaros Feb 21 '23 at 17:09

1 Answers1

0

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 ;)

app
  • 1