[ 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 });
}
}
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 });
}
}
`
58 Replies
d.js toolkit
d.js toolkit3mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
treble/luna
treble/luna3mo ago
Show the full error
Night Ghost
Night Ghost3mo ago
[ ERROR: ]: TypeError: source.on is not a function
at Function.create (C:\Users\mrpev\Desktop\[Project Phil]\PhilMultiBot\node_modules\delayed-stream\lib\delayed_stream.js:33:10)
at FormData.append (C:\Users\mrpev\Desktop\[Project Phil]\PhilMultiBot\node_modules\combined-stream\lib\combined_stream.js:45:37)
at FormData.append (C:\Users\mrpev\Desktop\[Project Phil]\PhilMultiBot\node_modules\form-data\lib\form_data.js:75:3)
at _REST.resolveRequest (C:\Users\mrpev\Desktop\[Project Phil]\PhilMultiBot\node_modules\@discordjs\rest\dist\index.js:1374:20)
at _REST.queueRequest (C:\Users\mrpev\Desktop\[Project Phil]\PhilMultiBot\node_modules\@discordjs\rest\dist\index.js:1312:46)
at _REST.request (C:\Users\mrpev\Desktop\[Project Phil]\PhilMultiBot\node_modules\@discordjs\rest\dist\index.js:1278:33)
at _REST.post (C:\Users\mrpev\Desktop\[Project Phil]\PhilMultiBot\node_modules\@discordjs\rest\dist\index.js:1252:17)
at TextChannel.send (C:\Users\mrpev\Desktop\[Project Phil]\PhilMultiBot\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:177:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Query.<anonymous> (C:\Users\mrpev\Desktop\[Project Phil]\PhilMultiBot\src\events\guildMemberAdd.js:213:29)
[ ERROR: ]: TypeError: source.on is not a function
at Function.create (C:\Users\mrpev\Desktop\[Project Phil]\PhilMultiBot\node_modules\delayed-stream\lib\delayed_stream.js:33:10)
at FormData.append (C:\Users\mrpev\Desktop\[Project Phil]\PhilMultiBot\node_modules\combined-stream\lib\combined_stream.js:45:37)
at FormData.append (C:\Users\mrpev\Desktop\[Project Phil]\PhilMultiBot\node_modules\form-data\lib\form_data.js:75:3)
at _REST.resolveRequest (C:\Users\mrpev\Desktop\[Project Phil]\PhilMultiBot\node_modules\@discordjs\rest\dist\index.js:1374:20)
at _REST.queueRequest (C:\Users\mrpev\Desktop\[Project Phil]\PhilMultiBot\node_modules\@discordjs\rest\dist\index.js:1312:46)
at _REST.request (C:\Users\mrpev\Desktop\[Project Phil]\PhilMultiBot\node_modules\@discordjs\rest\dist\index.js:1278:33)
at _REST.post (C:\Users\mrpev\Desktop\[Project Phil]\PhilMultiBot\node_modules\@discordjs\rest\dist\index.js:1252:17)
at TextChannel.send (C:\Users\mrpev\Desktop\[Project Phil]\PhilMultiBot\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:177:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Query.<anonymous> (C:\Users\mrpev\Desktop\[Project Phil]\PhilMultiBot\src\events\guildMemberAdd.js:213:29)
treble/luna
treble/luna3mo ago
what is line 21 of guildMemberAdd
Night Ghost
Night Ghost3mo ago
No description
Night Ghost
Night Ghost3mo ago
and it does return the buffer
Night Ghost
Night Ghost3mo ago
No description
treble/luna
treble/luna3mo ago
Seems like an issue with your con.query then, #other-js-ts
Night Ghost
Night Ghost3mo ago
you mean 213? not 21
treble/luna
treble/luna3mo ago
ah yeah 213
Night Ghost
Night Ghost3mo ago
No description
Night Ghost
Night Ghost3mo ago
that what the hole thing is
treble/luna
treble/luna3mo ago
i honestly have no clue, ive never seen this error before
Night Ghost
Night Ghost3mo ago
ty for trying to help i wait to see if any else can help thanks so much
Want results from more Discord servers?
Add your server