Closed 1xChloe closed 1 week ago
Could you describe it more clearly?
Could you describe it more clearly?
When trying to get the selfbot to send a regular message in a guild, if the account doesn't have the permission to send files/attachments it will error saying missing permissions, even if there is no file attached.
When trying to get the selfbot to send a regular message in a guild, if the account doesn't have the permission to send files/attachments it will error saying missing permissions, even if there is no file attached.
Could you write a small piece of code and share the error message with me?
My bad, updated code and the error (You can run this with eval and it'll crash)
let tempSend = msg.channel.send("Test Message")
function sendResponse(msg, response, sentMsg) {
let hasFile = false;
if (
msg.client.user.premiumType === 2
? response.length > 4000
: response.length > 2000
)
hasFile = true;
if (hasFile) {
await sentMsg.edit({
files: [{ attachment: Buffer.from(response), name: "my_response.txt" }],
content: `Whoopsies! The character count exceeded ${
msg.client.user.premiumType === 2 ? "4000" : "2000"
}, so here's a file with my response instead!`,
});
} else {
console.log("Here");
await sentMsg.edit(response);
}
};
sendResponse(msg, "This is the update", tempSend)
/home/container/node_modules/discord.js-selfbot-v13/src/rest/RequestHandler.js:415
throw new DiscordAPIError(data, res.status, request);
^
DiscordAPIError: Missing Permissions
at RequestHandler.execute (/home/container/node_modules/discord.js-selfbot-v13/src/rest/RequestHandler.js:415:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async RequestHandler.push (/home/container/node_modules/discord.js-selfbot-v13/src/rest/RequestHandler.js:63:14)
at async MessageManager.edit (/home/container/node_modules/discord.js-selfbot-v13/src/managers/MessageManager.js:151:15) {
method: 'patch',
path: '/channels/1276647787253076022/messages/1276649177346084895',
code: 50013,
httpStatus: 403,
requestData: {
json: {
activity: undefined,
content: 'Error: ```js\nDiscordAPIError: Missing Permissions```',
tts: false,
nonce: undefined,
embeds: undefined,
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: { parse: [ 'users', 'roles' ], replied_user: false },
flags: 0,
message_reference: undefined,
attachments: [],
sticker_ids: undefined,
thread_name: undefined,
poll: undefined
},
files: [],
headers: undefined
},
retries: 0,
captcha: null
}
Node.js v19.9.0
[nodemon] app crashed - waiting for file changes before starting...
msg.client.user.premiumType
is not readable. it's client.user.premiumType
(if you didn't define it)content: response, files: []
if !hasFile
yes here got logged, and it works, msg.client.user is the same as client.user when logged.
@1xChloe Based on the error message, this is an error from the Discord API, not a library error. You should check the necessary permissions (as recommended) and the code.
Which package has the bugs?
The core library
Issue description
How I structure my message payload (yes I've debugged to make sure its just a single string) then running a simple
msg.reply
in a server channel without file perms, even if the return is just a string will cause it to error saying Missing PermissionsCode sample
Package version
3.3.0
Node.js version
19
Operating system
Linux Debian
Priority this issue should have
Medium (should be fixed soon)
Checklist
Additional Information
No response