[ ERROR: ]: source.on is not a function

                    let channelID = row.find(function (r) { return r.channeltype === 'welcome' }).channelid;
                    let channel = await bot.channels.cache.get(channelID)

                    const buffer = await canvas.toBuffer();
                    console.log('Buffer size:', buffer.length);

                    const attachment = new AttachmentBuilder(buffer, { name: 'welcome.png', description: 'welcome' });
                    console.log(buffer)
                    if (channel) {
                        try {
                            await channel.send({
                                content: `<@${guildMember.user.id}>`,
                                files: [attachment]
                            });
                        } catch (e) {
                            projectphil.logger({ string: e.message, type: 'error', location: __filename });
                        }
                    }
`
Was this page helpful?