Skip to content

Commit

Permalink
fix(deferReply): added deferReply with editReply
Browse files Browse the repository at this point in the history
  • Loading branch information
xmnlz committed Nov 17, 2023
1 parent 96d6295 commit 5e36318
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/commands/curator/eventsmode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ export class Command {
member: GuildMember,
ctx: CommandInteraction<'cached'>,
) {
await ctx.deferReply({ ephemeral: true });

const guild = await Guild.findOneBy({ id: ctx.guild.id });

const { isRolesConfigured, eventsmodeRoleId } = guild!.settingsManagement;
Expand Down Expand Up @@ -115,7 +117,7 @@ export class Command {
}),
});

await ctx.reply(
await ctx.editReply(
embedResponse({
template: `Пользователь $1 был нанят как ${bold('Eventsmode')}`,
replaceArgs: [userWithNameAndId(member.user), bold('Eventsmode')],
Expand All @@ -136,6 +138,8 @@ export class Command {
member: GuildMember,
ctx: CommandInteraction<'cached'>,
) {
await ctx.deferReply({ ephemeral: true });

const guild = await Guild.findOneBy({ id: ctx.guild.id });

const { isRolesConfigured, eventsmodeRoleId } = guild!.settingsManagement;
Expand Down Expand Up @@ -167,7 +171,7 @@ export class Command {
}),
});

await ctx.reply(
await ctx.editReply(
embedResponse({
template: `$1 был снят с должности $3`,
replaceArgs: [userWithNameAndId(member.user), bold('Eventsmode')],
Expand Down Expand Up @@ -202,6 +206,8 @@ export class Command {
staffRole: number,
ctx: CommandInteraction<'cached'>,
) {
await ctx.deferReply({ ephemeral: true });

const eventsmode = await Eventsmode.findOneBy({
userId: member.id,
guild: { id: member.guild.id },
Expand Down Expand Up @@ -233,7 +239,7 @@ export class Command {
}),
});

await ctx.reply(
await ctx.editReply(
embedResponse({
template: `$1 был поставлен на должность $2`,
replaceArgs: [userWithNameAndId(member.user), bold(getStuffRole(staffRole))],
Expand Down

0 comments on commit 5e36318

Please sign in to comment.