RyansHDs
DIAdiscord.js - Imagine an app
•Created by RyansHDs on 6/30/2024 in #djs-questions
Unable to upload emoji: TypeError: terminated
Hello, when I try to upload emojis using attachment, it result as this:
The code:
The code work locally, but not in production. I have no idea what caused that issue.
Discord.js version: ^14.15.3
Node.js version: v20.15.0
Both Discord.js version and Node.js are same between local and production.
TypeError: terminated
at Fetch.onAborted (/root/DiscordBot/Holo/node_modules/discord.js/node_modules/undici/lib/web/fetch/index.js:2034:49)
at Fetch.emit (node:events:513:28)
at Fetch.terminate (/root/DiscordBot/Holo/node_modules/discord.js/node_modules/undici/lib/web/fetch/index.js:93:10)
at /root/DiscordBot/Holo/node_modules/discord.js/node_modules/undici/lib/web/fetch/index.js:506:30
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
[cause]: TypeError [ERR_INVALID_ARG_TYPE]: The "stream" argument must be an instance of Stream. Received an instance of ReadableStream
at new NodeError (node:internal/errors:400:5)
at eos (node:internal/streams/end-of-stream:66:11)
at fetchFinale (/root/DiscordBot/Holo/node_modules/discord.js/node_modules/undici/lib/web/fetch/index.js:1093:5)
at mainFetch (/root/DiscordBot/Holo/node_modules/discord.js/node_modules/undici/lib/web/fetch/index.js:760:5)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_INVALID_ARG_TYPE'
}
}
TypeError: terminated
at Fetch.onAborted (/root/DiscordBot/Holo/node_modules/discord.js/node_modules/undici/lib/web/fetch/index.js:2034:49)
at Fetch.emit (node:events:513:28)
at Fetch.terminate (/root/DiscordBot/Holo/node_modules/discord.js/node_modules/undici/lib/web/fetch/index.js:93:10)
at /root/DiscordBot/Holo/node_modules/discord.js/node_modules/undici/lib/web/fetch/index.js:506:30
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
[cause]: TypeError [ERR_INVALID_ARG_TYPE]: The "stream" argument must be an instance of Stream. Received an instance of ReadableStream
at new NodeError (node:internal/errors:400:5)
at eos (node:internal/streams/end-of-stream:66:11)
at fetchFinale (/root/DiscordBot/Holo/node_modules/discord.js/node_modules/undici/lib/web/fetch/index.js:1093:5)
at mainFetch (/root/DiscordBot/Holo/node_modules/discord.js/node_modules/undici/lib/web/fetch/index.js:760:5)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_INVALID_ARG_TYPE'
}
}
const upload = interaction.options.getAttachment('image');
const name = interaction.options.getString('name');
try {
const emoji = await interaction.guild.emojis.create({
attachment: upload.attachment,
name: name,
});
const upload = interaction.options.getAttachment('image');
const name = interaction.options.getString('name');
try {
const emoji = await interaction.guild.emojis.create({
attachment: upload.attachment,
name: name,
});
17 replies