Object literal may only specify known properties, and 'name' does not exist in type 'ToAPIApplicatio

unknown error
10 Replies
čamdžić
čamdžićOP4mo ago
No description
čamdžić
čamdžićOP4mo ago
? WTF xD
čamdžić
čamdžićOP4mo ago
No description
čamdžić
čamdžićOP4mo ago
import { ApplicationCommandOptionType, ChannelType } from "discord.js";
import { ApplyOptions } from "@sapphire/decorators";
import { Command } from "@sapphire/framework";
import { reviewSystem } from "#lib/constants";

@ApplyOptions<Command.Options>({
description: "Post your review",
runIn: ChannelType.GuildText
})
export class ReviewCommand extends Command {
override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand({
name: this.name,
description: this.description,
options: [
{
description: "Member to review",
type: ApplicationCommandOptionType.User,
required: true
},
{
name: "category",
description: "Category of the review",
type: ApplicationCommandOptionType.String,
choices: reviewSystem.categories.map((category) => ({
name: category.label,
value: category.id
})),
required: true
}
]
});
}

override async chatInputRun(
interaction: Command.ChatInputCommandInteraction<"cached">
) {
await interaction.deferReply({ ephemeral: true });
}
}
import { ApplicationCommandOptionType, ChannelType } from "discord.js";
import { ApplyOptions } from "@sapphire/decorators";
import { Command } from "@sapphire/framework";
import { reviewSystem } from "#lib/constants";

@ApplyOptions<Command.Options>({
description: "Post your review",
runIn: ChannelType.GuildText
})
export class ReviewCommand extends Command {
override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand({
name: this.name,
description: this.description,
options: [
{
description: "Member to review",
type: ApplicationCommandOptionType.User,
required: true
},
{
name: "category",
description: "Category of the review",
type: ApplicationCommandOptionType.String,
choices: reviewSystem.categories.map((category) => ({
name: category.label,
value: category.id
})),
required: true
}
]
});
}

override async chatInputRun(
interaction: Command.ChatInputCommandInteraction<"cached">
) {
await interaction.deferReply({ ephemeral: true });
}
}
Favna
Favna4mo ago
Any particular reason why you're not using builders?
čamdžić
čamdžićOP4mo ago
nvm i fixed it but now
čamdžić
čamdžićOP4mo ago
No description
čamdžić
čamdžićOP4mo ago
i have more interaction handlers
@ApplyOptions<InteractionHandler.Options>({
interactionHandlerType: InteractionHandlerTypes.Button
})
export class RRButton extends InteractionHandler {
override parse(interaction: ButtonInteraction<"cached">) {
if (!interaction.customId.startsWith("rr")) return this.none();

return this.some();
}
@ApplyOptions<InteractionHandler.Options>({
interactionHandlerType: InteractionHandlerTypes.Button
})
export class RRButton extends InteractionHandler {
override parse(interaction: ButtonInteraction<"cached">) {
if (!interaction.customId.startsWith("rr")) return this.none();

return this.some();
}
this is rr-button.ts
@ApplyOptions<InteractionHandler.Options>({
interactionHandlerType: InteractionHandlerTypes.Button
})
export class ReviewButton extends InteractionHandler {
override parse(interaction: ButtonInteraction<"cached">) {
if (!interaction.customId.startsWith("review-control")) return this.none();

return this.some();
}
@ApplyOptions<InteractionHandler.Options>({
interactionHandlerType: InteractionHandlerTypes.Button
})
export class ReviewButton extends InteractionHandler {
override parse(interaction: ButtonInteraction<"cached">) {
if (!interaction.customId.startsWith("review-control")) return this.none();

return this.some();
}
and this is review-button.ts
čamdžić
čamdžićOP4mo ago
No description
čamdžić
čamdžićOP4mo ago
and when i click on button that starts with review-control i get this (that is from rrbutton)
Want results from more Discord servers?
Add your server