3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-14 05:45:02 +00:00

fix: plugin dependencies and cleanup

This commit is contained in:
Obliie 2023-07-15 22:05:30 +01:00
parent 771ed76f64
commit 24b11800f5
No known key found for this signature in database
GPG key ID: 9189A18F0D5B547E
8 changed files with 20 additions and 55 deletions

View file

@ -47,7 +47,7 @@ async function banAction(
const durationMs = duration ? convertDelayStringToMS(duration)! : undefined;
const result = await modactions.banUserId(target, reason, { caseArgs }, durationMs);
if (result.status === "failed") {
await interaction.editReply({ content: "ERROR: Failed to ban user", embeds: [], components: [] });
await interaction.editReply({ content: "Error: Failed to ban user", embeds: [], components: [] });
return;
}
@ -66,22 +66,18 @@ export async function launchBanActionModal(
target: string,
) {
const modal = new ModalBuilder().setCustomId("ban").setTitle("Ban");
const durationIn = new TextInputBuilder()
.setCustomId("duration")
.setLabel("Duration (Optional)")
.setRequired(false)
.setStyle(TextInputStyle.Short);
const reasonIn = new TextInputBuilder()
.setCustomId("reason")
.setLabel("Reason (Optional)")
.setRequired(false)
.setStyle(TextInputStyle.Paragraph);
const durationRow = new ActionRowBuilder<TextInputBuilder>().addComponents(durationIn);
const reasonRow = new ActionRowBuilder<TextInputBuilder>().addComponents(reasonIn);
modal.addComponents(durationRow, reasonRow);
await interaction.showModal(modal);

View file

@ -43,11 +43,8 @@ export async function launchCleanActionModal(
target: string,
) {
const modal = new ModalBuilder().setCustomId("clean").setTitle("Clean");
const amountIn = new TextInputBuilder().setCustomId("amount").setLabel("Amount").setStyle(TextInputStyle.Short);
const amountRow = new ActionRowBuilder<TextInputBuilder>().addComponents(amountIn);
modal.addComponents(amountRow);
await interaction.showModal(modal);
@ -57,7 +54,7 @@ export async function launchCleanActionModal(
const amount = submitted.fields.getTextInputValue("amount");
if (isNaN(Number(amount))) {
interaction.editReply({ content: `ERROR: Amount ${amount} is invalid`, embeds: [], components: [] });
interaction.editReply({ content: `Error: Amount '${amount}' is invalid`, embeds: [], components: [] });
return;
}

View file

@ -77,22 +77,18 @@ export async function launchMuteActionModal(
target: string,
) {
const modal = new ModalBuilder().setCustomId("mute").setTitle("Mute");
const durationIn = new TextInputBuilder()
.setCustomId("duration")
.setLabel("Duration (Optional)")
.setRequired(false)
.setStyle(TextInputStyle.Short);
const reasonIn = new TextInputBuilder()
.setCustomId("reason")
.setLabel("Reason (Optional)")
.setRequired(false)
.setStyle(TextInputStyle.Paragraph);
const durationRow = new ActionRowBuilder<TextInputBuilder>().addComponents(durationIn);
const reasonRow = new ActionRowBuilder<TextInputBuilder>().addComponents(reasonIn);
modal.addComponents(durationRow, reasonRow);
await interaction.showModal(modal);

View file

@ -36,7 +36,7 @@ async function noteAction(
const targetMember = await pluginData.guild.members.fetch(target);
if (!canActOn(pluginData, executingMember, targetMember)) {
await interaction.editReply({ content: "Cannot mute: insufficient permissions", embeds: [], components: [] });
await interaction.editReply({ content: "Cannot note: insufficient permissions", embeds: [], components: [] });
return;
}
@ -69,11 +69,8 @@ export async function launchNoteActionModal(
target: string,
) {
const modal = new ModalBuilder().setCustomId("note").setTitle("Note");
const reasonIn = new TextInputBuilder().setCustomId("reason").setLabel("Note").setStyle(TextInputStyle.Paragraph);
const reasonRow = new ActionRowBuilder<TextInputBuilder>().addComponents(reasonIn);
modal.addComponents(reasonRow);
await interaction.showModal(modal);

View file

@ -34,7 +34,7 @@ async function warnAction(
const targetMember = await pluginData.guild.members.fetch(target);
if (!canActOn(pluginData, executingMember, targetMember)) {
await interaction.editReply({ content: "Cannot mute: insufficient permissions", embeds: [], components: [] });
await interaction.editReply({ content: "Cannot warn: insufficient permissions", embeds: [], components: [] });
return;
}
@ -44,7 +44,7 @@ async function warnAction(
const result = await modactions.warnMember(targetMember, reason, { caseArgs });
if (result.status === "failed") {
await interaction.editReply({ content: "Failed to warn user", embeds: [], components: [] });
await interaction.editReply({ content: "Error: Failed to warn user", embeds: [], components: [] });
return;
}
@ -61,11 +61,8 @@ export async function launchWarnActionModal(
target: string,
) {
const modal = new ModalBuilder().setCustomId("warn").setTitle("Warn");
const reasonIn = new TextInputBuilder().setCustomId("reason").setLabel("Reason").setStyle(TextInputStyle.Paragraph);
const reasonRow = new ActionRowBuilder<TextInputBuilder>().addComponents(reasonIn);
modal.addComponents(reasonRow);
await interaction.showModal(modal);