client.application has a bunch of null values

Hi there, I'm very new to Sapphire so I've been going through the documentation/guide and am at the step to configure your own preconditions. Going off the example in the documentation where the bot owner id is grabbed from a configuration file. I'm trying to access mine through this.container.client.application.owner.id, however this.container.client.application has a bunch of null values. When I throw it all to my console, these are the results:
<ref *2> ClientApplication {
id: '', // omitted but is present
name: null,
description: null,
icon: null,
termsOfServiceURL: null,
privacyPolicyURL: null,
rpcOrigins: [],
cover: null,
verifyKey: null,
tags: [],
installParams: null,
integrationTypesConfig: null,
customInstallURL: null,
flags: ApplicationFlagsBitField { bitfield: 27828224 },
approximateGuildCount: null,
approximateUserInstallCount: null,
approximateUserAuthorizationCount: null,
guildId: null,
botRequireCodeGrant: null,
bot: null,
botPublic: null,
interactionsEndpointURL: null,
roleConnectionsVerificationURL: null,
eventWebhooksURL: null,
eventWebhooksStatus: null,
eventWebhooksTypes: null,
owner: null,
commands: <ref *1> ApplicationCommandManager {
permissions: ApplicationCommandPermissionsManager {
manager: [Circular *1],
guild: null,
guildId: null,
commandId: null
}
},
emojis: ApplicationEmojiManager { application: [Circular *2] },
entitlements: EntitlementManager {},
subscriptions: SubscriptionManager {}
}
<ref *2> ClientApplication {
id: '', // omitted but is present
name: null,
description: null,
icon: null,
termsOfServiceURL: null,
privacyPolicyURL: null,
rpcOrigins: [],
cover: null,
verifyKey: null,
tags: [],
installParams: null,
integrationTypesConfig: null,
customInstallURL: null,
flags: ApplicationFlagsBitField { bitfield: 27828224 },
approximateGuildCount: null,
approximateUserInstallCount: null,
approximateUserAuthorizationCount: null,
guildId: null,
botRequireCodeGrant: null,
bot: null,
botPublic: null,
interactionsEndpointURL: null,
roleConnectionsVerificationURL: null,
eventWebhooksURL: null,
eventWebhooksStatus: null,
eventWebhooksTypes: null,
owner: null,
commands: <ref *1> ApplicationCommandManager {
permissions: ApplicationCommandPermissionsManager {
manager: [Circular *1],
guild: null,
guildId: null,
commandId: null
}
},
emojis: ApplicationEmojiManager { application: [Circular *2] },
entitlements: EntitlementManager {},
subscriptions: SubscriptionManager {}
}
private async isOwner(userId: string) {
//userId is filled properly
console.log(this.container.client.application);
return userId === this.container.client.application.owner.id
? this.ok()
: this.error({ message: 'Only the bot owner can use this command!' });
}
private async isOwner(userId: string) {
//userId is filled properly
console.log(this.container.client.application);
return userId === this.container.client.application.owner.id
? this.ok()
: this.error({ message: 'Only the bot owner can use this command!' });
}
Is any extra set-up required for these values to be filled, or what's the reason they're all null values?
Solution:
Sounds like either your printing it before the bot fully connected to discord or your connection isn't working at all. Either way, this is a discordjs matter, not a sapphire matter.
Jump to solution
2 Replies
Solution
Favna
Favna4w ago
Sounds like either your printing it before the bot fully connected to discord or your connection isn't working at all. Either way, this is a discordjs matter, not a sapphire matter.
「Nao」
「Nao」OP4w ago
Cheers for the quick response, I'll keep digging :Salute:

Did you find this page helpful?