some1chan
Explore posts from serversSIASapphire - Imagine a framework
•Created by chillihero on 2/18/2023 in #sapphire-support
Will using the new plugin-utilities-store enable HMR for this Helper files?
heya, im using @sapphire/plugin-utilities right now and HMR doesnt seem to be working. The utilities do import, however, and otherwise for other pieces like commands, HMR works. Anyone else experiencing this issue?
8 replies
SIASapphire - Imagine a framework
•Created by some1chan on 9/12/2023 in #sapphire-support
Why in line 79 for src/preconditions/ClientPermissions.ts is there `PermissionsBitField | null`?
ah, that makes sense. thanks for the reply!
32 replies
SIASapphire - Imagine a framework
•Created by some1chan on 9/12/2023 in #sapphire-support
Why in line 79 for src/preconditions/ClientPermissions.ts is there `PermissionsBitField | null`?
what's the edge cases?
32 replies
SIASapphire - Imagine a framework
•Created by some1chan on 9/12/2023 in #sapphire-support
Why in line 79 for src/preconditions/ClientPermissions.ts is there `PermissionsBitField | null`?
oh fun
32 replies
SIASapphire - Imagine a framework
•Created by some1chan on 9/12/2023 in #sapphire-support
Why in line 79 for src/preconditions/ClientPermissions.ts is there `PermissionsBitField | null`?
i'm guessing guild will always be cached, solely because of d.js's typings, since
guild
in channel.guild
after !channel.isDMBased()
can't be null. I could be easily wrong, as i don't know d.js's internals at all32 replies
SIASapphire - Imagine a framework
•Created by some1chan on 9/12/2023 in #sapphire-support
Why in line 79 for src/preconditions/ClientPermissions.ts is there `PermissionsBitField | null`?
32 replies
SIASapphire - Imagine a framework
•Created by some1chan on 9/12/2023 in #sapphire-support
Why in line 79 for src/preconditions/ClientPermissions.ts is there `PermissionsBitField | null`?
null
typing is not needed then. Even if channel is a partial, and guild is unavailable, it'd be a DM channel judging by types. Might be worth refactoring later, unless a contributor who actually knows the codebase says otherwise.32 replies
SIASapphire - Imagine a framework
•Created by some1chan on 9/12/2023 in #sapphire-support
Why in line 79 for src/preconditions/ClientPermissions.ts is there `PermissionsBitField | null`?
oh hey yeah, i can guarantee channel being a non-partial also! i think that's the best solution there
32 replies
SIASapphire - Imagine a framework
•Created by some1chan on 9/12/2023 in #sapphire-support
Why in line 79 for src/preconditions/ClientPermissions.ts is there `PermissionsBitField | null`?
inCachedGuild()
doesn't seem to work due to the Message
typing, hmm32 replies
SIASapphire - Imagine a framework
•Created by some1chan on 9/12/2023 in #sapphire-support
Why in line 79 for src/preconditions/ClientPermissions.ts is there `PermissionsBitField | null`?
in that case, how can we be in a guild and have the guild be null?
32 replies
SIASapphire - Imagine a framework
•Created by some1chan on 9/12/2023 in #sapphire-support
Why in line 79 for src/preconditions/ClientPermissions.ts is there `PermissionsBitField | null`?
im getting undefined because of
messageOrInteraction.guild?
, yep32 replies
SIASapphire - Imagine a framework
•Created by some1chan on 9/12/2023 in #sapphire-support
Why in line 79 for src/preconditions/ClientPermissions.ts is there `PermissionsBitField | null`?
oh wait a sec
32 replies
SIASapphire - Imagine a framework
•Created by some1chan on 9/12/2023 in #sapphire-support
Why in line 79 for src/preconditions/ClientPermissions.ts is there `PermissionsBitField | null`?
I was about to post this:
in my edit, i spun off...exceptpermissions
into a new variablenewPermissions
. This is so I could dochannel.permissionsFor(messageOrInteraction.applicationId);
without the potentialnull
output affecting the type of the functiongetPermissionsForChannel()
, which I understand to be unnecessary. I thinkgetPermissionsForChannel()
can just be of typePermissionsBitField
and notPermissionsBitField | null
. If this was ever turned null by theapplicationId
fetch, I believe it'd make sure it'd always not be null, due tofetchMe()
, presumably becausefetchMe()
would never benull
permissions
is still technically nullable, because if fetchMe()
for some reason can be undefined
. I'm not 100% sure on how that'd be the case, but I presume that makes the | null
function typing make sense. Did I get that right? (also, the reason on why it'd be undefined
would be great. best guess is that somehow d.js has http bot support or something)32 replies
SIASapphire - Imagine a framework
•Created by some1chan on 9/12/2023 in #sapphire-support
Why in line 79 for src/preconditions/ClientPermissions.ts is there `PermissionsBitField | null`?
My potential code, in which I'm naively unaware if I'm about to make a mistake:
32 replies
SIASapphire - Imagine a framework
•Created by some1chan on 9/12/2023 in #sapphire-support
Why in line 79 for src/preconditions/ClientPermissions.ts is there `PermissionsBitField | null`?
32 replies
SIASapphire - Imagine a framework
•Created by some1chan on 8/24/2023 in #sapphire-support
Did the latest @sapphire/[email protected] update break things?
also fyi; i can't seem to mark this as the answer, as the Apps context menu isn't there. is that intended if I don't want to have the posts on answer overflow?
34 replies
SIASapphire - Imagine a framework
•Created by some1chan on 8/24/2023 in #sapphire-support
Did the latest @sapphire/[email protected] update break things?
nvm, it did work! probably forgot to rerun with
"resolveJsonModule": true
i believe34 replies
SIASapphire - Imagine a framework
•Created by some1chan on 8/24/2023 in #sapphire-support
Did the latest @sapphire/[email protected] update break things?
oh wait a sec
34 replies
SIASapphire - Imagine a framework
•Created by some1chan on 8/24/2023 in #sapphire-support
Did the latest @sapphire/[email protected] update break things?
seems to not have done anything, which puzzles me. just to double check, this would be correct?
34 replies
SIASapphire - Imagine a framework
•Created by some1chan on 8/24/2023 in #sapphire-support
Did the latest @sapphire/[email protected] update break things?
at least for plugin-i18next, this seems to have worked! It also seems to have broken the hack I forgot I used to get typings for SentryOptions in '@kaname-png/plugin-sentry'
it looked somewhat like this:
34 replies