PossiblySebo
SIASapphire - Imagine a framework
•Created by PossiblySebo on 8/26/2024 in #discordjs-support
Help with message deletion
I am currently implementing message deletion logging into my bot to replace another bot that doesn't log attachments upon deletion. I assume that the DAPI passes attachment information along with the rest of the Message object when messages are deleted. However, referencing the attachment via URL wouldn't work because, well, you can't reference a url that doesn't exist anymore. Is there a way to retrieve the raw image data or get a Stream from the Attachment object that is returned with Message#attachments.first()?
8 replies
SIASapphire - Imagine a framework
•Created by PossiblySebo on 8/24/2024 in #discordjs-support
How does one check if a specific user was mentioned in a message?
I was thinking it would be something along the lines of MessageMentions#members.has('UserID'), is this correct?
3 replies
SIASapphire - Imagine a framework
•Created by PossiblySebo on 6/30/2024 in #sapphire-support
Question about slash command user fields
If I were to create a User option for a slash command using the following code:
https://i.imgur.com/KaIRMiJ.png
Would I be able to retrieve this user as a GuildMember instead of a User by using this code?
https://i.imgur.com/eNAGsl8.png
My use case is pure laziness, I don't feel like fetching the User as a GuildMember and want to see if I can simply have the framework fetch them as a GuildMember from the get-go instead of having to fetch their user ID as a GuildMember.
6 replies
SIASapphire - Imagine a framework
•Created by PossiblySebo on 12/4/2023 in #sapphire-support
Type issues with .addChoices()
I am attempting to add choices to a string option, and this error is a little confusing. See what I mean:
The error: Argument of type '{ name: string; value: string; }[]' is not assignable to parameter of type 'APIApplicationCommandOptionChoice<string>'.
Type '{ name: string; value: string; }[]' is missing the following properties from type 'APIApplicationCommandOptionChoice<string>': name, value
10 replies