small fixes
This commit is contained in:
@@ -26,7 +26,6 @@ client.on(Events.ClientReady, (readyClient) => {
|
||||
const commands = commandRouter();
|
||||
|
||||
client.on(Events.InteractionCreate, async (interaction) => {
|
||||
// messagehandler(interaction.command)
|
||||
if (!interaction.isChatInputCommand()) return;
|
||||
|
||||
const command = commands.find((c) => c.data.name === interaction.commandName);
|
||||
|
||||
@@ -11,7 +11,8 @@ export const commands = [
|
||||
subcommand
|
||||
.setName("drop")
|
||||
.setDescription("Drops one or multiple images using the rule34 API.")
|
||||
.addStringOption((option) => option
|
||||
.addStringOption((option) =>
|
||||
option
|
||||
.setName("limit")
|
||||
.setDescription("Post limitation")
|
||||
)
|
||||
@@ -32,26 +33,19 @@ export const commands = [
|
||||
)
|
||||
),
|
||||
async execute(interaction: ChatInputCommandInteraction) {
|
||||
const limit = interaction.options.getString("limit")
|
||||
const tags = interaction.options.getString("tags")
|
||||
const page = interaction.options.getString("page")
|
||||
const pid = interaction.options.getString("pid")
|
||||
if (limit === null && tags === null && page === null && pid === null) {
|
||||
const limit = interaction.options.getString("limit");
|
||||
const tags = interaction.options.getString("tags");
|
||||
const page = interaction.options.getString("page");
|
||||
const pid = interaction.options.getString("pid");
|
||||
|
||||
await interaction.reply({
|
||||
embeds: await requestWorker({
|
||||
limit: "1"
|
||||
})
|
||||
})
|
||||
} else {
|
||||
await interaction.reply({
|
||||
embeds: await requestWorker({
|
||||
limit: limit,
|
||||
limit: limit ?? "1",
|
||||
tags: tags,
|
||||
page: page,
|
||||
pid: pid,
|
||||
}),
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@@ -13,7 +13,8 @@ export const commands = [
|
||||
.setDescription(
|
||||
"Drops one or multiple images using the yande.re API.",
|
||||
)
|
||||
.addStringOption((option) => option
|
||||
.addStringOption((option) =>
|
||||
option
|
||||
.setName("limit")
|
||||
.setDescription("Post limitation")
|
||||
)
|
||||
@@ -29,24 +30,16 @@ export const commands = [
|
||||
)
|
||||
),
|
||||
async execute(interaction: ChatInputCommandInteraction) {
|
||||
const limit = interaction.options.getString("limit")
|
||||
const tags = interaction.options.getString("tags")
|
||||
const page = interaction.options.getString("page")
|
||||
if (limit === null && tags === null && page === null) {
|
||||
const limit = interaction.options.getString("limit");
|
||||
const tags = interaction.options.getString("tags");
|
||||
const page = interaction.options.getString("page");
|
||||
await interaction.reply({
|
||||
embeds: await getPosts({
|
||||
limit: "1"
|
||||
})
|
||||
})
|
||||
} else {
|
||||
await interaction.reply({
|
||||
embeds: await getPosts({
|
||||
limit: limit,
|
||||
limit: limit ?? "1",
|
||||
tags: tags,
|
||||
page: page
|
||||
page: page,
|
||||
}),
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user