Deadlystrike
Deadlystrike
SIASapphire - Imagine a Framework
Created by Deadlystrike on 4/20/2025 in #sapphire-support
client permissions failing to resolve in channel
12 replies
SIASapphire - Imagine a Framework
Created by Deadlystrike on 4/20/2025 in #sapphire-support
client permissions failing to resolve in channel
Yeah, this was an issue I ran into when switching from our custom commando-fork to saphire which was on 4.2.0 at the time, Vlad snipped that bug so fast and issued 4.2.1 which has served us well for almost 2 years. It looks like the fix got removed a bit over a year later during some refactoring and updates.
12 replies
SIASapphire - Imagine a Framework
Created by Deadlystrike on 4/20/2025 in #sapphire-support
client permissions failing to resolve in channel
I'll get that started now.
12 replies
SIASapphire - Imagine a Framework
Created by Deadlystrike on 4/20/2025 in #sapphire-support
client permissions failing to resolve in channel
Assuming this is a regression in https://github.com/sapphiredev/framework/pull/616/files I patched in
if (utilities.isNullish(permissions)) {
const me = await messageOrInteraction.guild?.members.fetchMe();
if (me) {
permissions = channel.permissionsFor(me);
}
}
if (utilities.isNullish(permissions)) {
const me = await messageOrInteraction.guild?.members.fetchMe();
if (me) {
permissions = channel.permissionsFor(me);
}
}
Resulting in:
async getPermissionsForChannel(channel, messageOrInteraction) {
let permissions = this.dmChannelPermissions;
if (messageOrInteraction.inGuild() && !channel.isDMBased()) {
if (utilities.isNullish(messageOrInteraction.applicationId)) {
const me = await messageOrInteraction.guild?.members.fetchMe();
if (me) {
permissions = channel.permissionsFor(me);
}
} else {
permissions = channel.permissionsFor(messageOrInteraction.applicationId);
if (utilities.isNullish(permissions)) {
const me = await messageOrInteraction.guild?.members.fetchMe();
if (me) {
permissions = channel.permissionsFor(me);
}
}
}
}
return permissions;
}
async getPermissionsForChannel(channel, messageOrInteraction) {
let permissions = this.dmChannelPermissions;
if (messageOrInteraction.inGuild() && !channel.isDMBased()) {
if (utilities.isNullish(messageOrInteraction.applicationId)) {
const me = await messageOrInteraction.guild?.members.fetchMe();
if (me) {
permissions = channel.permissionsFor(me);
}
} else {
permissions = channel.permissionsFor(messageOrInteraction.applicationId);
if (utilities.isNullish(permissions)) {
const me = await messageOrInteraction.guild?.members.fetchMe();
if (me) {
permissions = channel.permissionsFor(me);
}
}
}
}
return permissions;
}
and no more error.
12 replies
SIASapphire - Imagine a Framework
Created by Deadlystrike on 4/20/2025 in #sapphire-support
client permissions failing to resolve in channel
Everything should be up-to-date, I went scorched earth on it. Deleted my lock and node_modules ran npm-check-updates and forced all to latest and re-ran npm i Digging deeper in the ClientPermissions.cjs
async getPermissionsForChannel(channel, messageOrInteraction) {
let permissions = this.dmChannelPermissions;
if (messageOrInteraction.inGuild() && !channel.isDMBased()) {
if (utilities.isNullish(messageOrInteraction.applicationId)) {
const me = await messageOrInteraction.guild?.members.fetchMe();
if (me) {
permissions = channel.permissionsFor(me);
}
} else {
permissions = channel.permissionsFor(messageOrInteraction.applicationId);
}
}
return permissions;
}
async getPermissionsForChannel(channel, messageOrInteraction) {
let permissions = this.dmChannelPermissions;
if (messageOrInteraction.inGuild() && !channel.isDMBased()) {
if (utilities.isNullish(messageOrInteraction.applicationId)) {
const me = await messageOrInteraction.guild?.members.fetchMe();
if (me) {
permissions = channel.permissionsFor(me);
}
} else {
permissions = channel.permissionsFor(messageOrInteraction.applicationId);
}
}
return permissions;
}
permissions = channel.permissionsFor(messageOrInteraction.applicationId);
permissions = channel.permissionsFor(messageOrInteraction.applicationId);
is what is evaluating, and its returning null
12 replies
SIASapphire - Imagine a Framework
Created by Deadlystrike on 3/8/2023 in #sapphire-support
requiredClientPermissions check always rejecting
Looking good so far, re-enabled the requiredClientPermissions checks and the command went through just fine, kicked the bot and re-invited with removed permissions and it threw a I am missing the following permissions to run this command: Manage Roles as i would expect.
37 replies
SIASapphire - Imagine a Framework
Created by Deadlystrike on 3/8/2023 in #sapphire-support
requiredClientPermissions check always rejecting
🫡 building the branch now to test
37 replies
SIASapphire - Imagine a Framework
Created by Deadlystrike on 3/8/2023 in #sapphire-support
requiredClientPermissions check always rejecting
Dev Bot: 8/1/2016 Production Bot: 7/15/2016
37 replies
SIASapphire - Imagine a Framework
Created by Deadlystrike on 3/8/2023 in #sapphire-support
requiredClientPermissions check always rejecting
they are diff
37 replies
SIASapphire - Imagine a Framework
Created by Deadlystrike on 3/8/2023 in #sapphire-support
requiredClientPermissions check always rejecting
I do believe that I saw my client users id and the app id was different but let me recheck
37 replies
SIASapphire - Imagine a Framework
Created by Deadlystrike on 3/8/2023 in #sapphire-support
requiredClientPermissions check always rejecting
The bot has been in my server for years, no clue how I invited it. For sanity sake I kicked it and re-invited it with a fresh invite link with all permissions selected &permissions=1099511627775&scope=bot - Additionaly upon joining I gave it an existing role that has admin perms in addition to the managed role it already had. Same output: 'I was unable to resolve my permissions in the chat input command invocation channel.'
37 replies