Skip to content

Commit

Permalink
fix #2273
Browse files Browse the repository at this point in the history
  • Loading branch information
Ntalcme authored and BastLast committed Jan 12, 2025
1 parent 511a7d1 commit 55b9ce0
Showing 1 changed file with 1 addition and 60 deletions.
61 changes: 1 addition & 60 deletions Discord/src/commands/guild/GuildElderCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,9 @@ import {DiscordCollectorUtils} from "../../utils/DiscordCollectorUtils";
import {ReactionCollectorGuildElderData} from "../../../../Lib/src/packets/interaction/ReactionCollectorGuildElder";
import {
CommandGuildElderAcceptPacketRes,
CommandGuildElderAlreadyElderPacketRes,
CommandGuildElderFoundPlayerPacketRes,
CommandGuildElderHimselfPacketRes,
CommandGuildElderPacketReq,
CommandGuildElderRefusePacketRes,
CommandGuildElderSameGuildPacketRes
CommandGuildElderRefusePacketRes
} from "../../../../Lib/src/packets/commands/CommandGuildElderPacket";
import {sendErrorMessage, SendManner} from "../../utils/ErrorUtils";
import {ICommand} from "../ICommand";
import {SlashCommandBuilderGenerator} from "../SlashCommandBuilderGenerator";
import {DraftbotInteraction} from "../../messages/DraftbotInteraction";
Expand Down Expand Up @@ -49,60 +44,6 @@ export async function createGuildElderCollector(packet: ReactionCollectorCreatio
await DiscordCollectorUtils.createAcceptRefuseCollector(interaction, embed, packet, context);
}


export async function handleCommandGuildElderFoundPlayerPacketRes(packet: CommandGuildElderFoundPlayerPacketRes, context: PacketContext): Promise<void> {
const interaction = DiscordCache.getInteraction(context.discord!.interaction);
if (!interaction) {
return;
}
await sendErrorMessage(
interaction.user,
interaction,
i18n.t("commands:guildElder.playerNotFound", {lng: interaction.userLanguage}),
{sendManner: SendManner.REPLY}
);
}

export async function handleCommandGuildElderSameGuildPacketRes(packet: CommandGuildElderSameGuildPacketRes, context: PacketContext): Promise<void> {
const interaction = DiscordCache.getInteraction(context.discord!.interaction);
if (!interaction) {
return;
}
await sendErrorMessage(
interaction.user,
interaction,
i18n.t("commands:guildElder.notSameGuild", {lng: interaction.userLanguage}),
{sendManner: SendManner.REPLY}
);
}

export async function handleCommandGuildElderHimselfPacketRes(packet: CommandGuildElderHimselfPacketRes, context: PacketContext): Promise<void> {
const interaction = DiscordCache.getInteraction(context.discord!.interaction);
if (!interaction) {
return;
}
await sendErrorMessage(
interaction.user,
interaction,
i18n.t("commands:guildElder.chiefError", {lng: interaction.userLanguage}),
{sendManner: SendManner.REPLY}
);
}

export async function handleCommandGuildElderAlreadyElderPacketRes(packet: CommandGuildElderAlreadyElderPacketRes, context: PacketContext): Promise<void> {
const interaction = DiscordCache.getInteraction(context.discord!.interaction);
if (!interaction) {
return;
}
await sendErrorMessage(
interaction.user,
interaction,
i18n.t("commands:guildElder.alreadyElder", {lng: interaction.userLanguage}),
{sendManner: SendManner.REPLY}
);
}


/**
* Handle the response of the server after a guild elder,
* this packet is only sent if the promotion is refused
Expand Down

0 comments on commit 55b9ce0

Please sign in to comment.