Helloo! It seems that I am unable to create a precondition that is async, whenever I try to write one with async. I get
The inferred type of 'chatInputRun' cannot be named without a reference to '.pnpm/@sapphire+result@2.6.4/node_modules/@sapphire/result'. This is likely not portable. A type annotation is necessary.
The inferred type of 'chatInputRun' cannot be named without a reference to '.pnpm/@sapphire+result@2.6.4/node_modules/@sapphire/result'. This is likely not portable. A type annotation is necessary.
Here is the code in question:
public override async chatInputRun(interaction: Interaction) { const guildPlayer = this.container.queue.get(interaction.guildId!); if (!guildPlayer) return this.ok(); const { music: { djs } } = await this.container.settings.getUserSetting(guildPlayer.owner); if (guildPlayer.owner !== interaction.user.id && !djs?.includes(interaction.user.id)) { return this.error({ message: 'The owner of this music session does not have you as a DJ. Have them add you using `/dj add`!', identifier: 'PermissionsMissing' }); } return this.ok(); }
public override async chatInputRun(interaction: Interaction) { const guildPlayer = this.container.queue.get(interaction.guildId!); if (!guildPlayer) return this.ok(); const { music: { djs } } = await this.container.settings.getUserSetting(guildPlayer.owner); if (guildPlayer.owner !== interaction.user.id && !djs?.includes(interaction.user.id)) { return this.error({ message: 'The owner of this music session does not have you as a DJ. Have them add you using `/dj add`!', identifier: 'PermissionsMissing' }); } return this.ok(); }