Skip to content

Commit

Permalink
Merge formatting
Browse files Browse the repository at this point in the history
Merge formatting into main
  • Loading branch information
github-actions[bot] authored Nov 14, 2023
2 parents a5d82e6 + 5d61847 commit ff6cfb7
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 36 deletions.
56 changes: 28 additions & 28 deletions src/buttons/replayBy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,36 +105,36 @@ const button: Button = {
.setStyle(ButtonStyle.Primary)
.setEmoji("📝"),
);

const chanDelete =
new ActionRowBuilder<MessageActionRowComponentBuilder>().addComponents(
new ButtonBuilder()
.setCustomId("replayDeleteChannels")
.setLabel(
client.translation.get(
guildDb?.language,
"Settings.button.replayDeleteChannels",
),
)
.setStyle(ButtonStyle.Danger),
);

await client.database.updateGuild(interaction.guild?.id || "", {
...guildDb,
replayBy: newType,
});
const chanDelete =
new ActionRowBuilder<MessageActionRowComponentBuilder>().addComponents(
new ButtonBuilder()
.setCustomId("replayDeleteChannels")
.setLabel(
client.translation.get(
guildDb?.language,
"Settings.button.replayDeleteChannels",
),
)
.setStyle(ButtonStyle.Danger),
);

interaction.update({
content: null,
embeds: [generalMsg],
components:
guildDb.replayType === "Channels"
? [generalButtons, chanDelete]
: [generalButtons],
options: {
ephemeral: true,
},
});
await client.database.updateGuild(interaction.guild?.id || "", {
...guildDb,
replayBy: newType,
});

interaction.update({
content: null,
embeds: [generalMsg],
components:
guildDb.replayType === "Channels"
? [generalButtons, chanDelete]
: [generalButtons],
options: {
ephemeral: true,
},
});
return;
},
};
Expand Down
2 changes: 1 addition & 1 deletion src/buttons/replayDelete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const button: Button = {
)
.setStyle(ButtonStyle.Primary)
.setEmoji("📝"),
new ButtonBuilder()
new ButtonBuilder()
.setCustomId("replayBy")
.setLabel(
client.translation.get(
Expand Down
6 changes: 5 additions & 1 deletion src/buttons/selectMenuReplay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ const button: Button = {
return;
}

if (guildDb.replayChannels.find((e: any) => e.id === (interaction as any).values[0])) {
if (
guildDb.replayChannels.find(
(e: any) => e.id === (interaction as any).values[0],
)
) {
guildDb.replayChannels = guildDb.replayChannels.filter(
(c) => c.id !== (interaction as any).values[0],
);
Expand Down
5 changes: 1 addition & 4 deletions src/commands/settings/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,7 @@ const command: ChatInputCommand = {
)}: ${
guildDb.replayChannels.length > 0
? `\n${guildDb.replayChannels
.map(
(c) =>
`<#${c.id}>: ${c.cooldown}`,
)
.map((c) => `<#${c.id}>: ${c.cooldown}`)
.join("\n")}`
: client.translation.get(
guildDb?.language,
Expand Down
4 changes: 2 additions & 2 deletions src/events/interactionCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ const event: Event = {
} else {
if (!user) {
await UserModel.create({
userID: interaction.user.id
userID: interaction.user.id,
});
}
if (
Expand Down Expand Up @@ -323,7 +323,7 @@ const event: Event = {
} else {
if (!user) {
await UserModel.create({
userID: interaction.user.id
userID: interaction.user.id,
});
}
const button = client.buttons.get((interaction as any).customId);
Expand Down

0 comments on commit ff6cfb7

Please sign in to comment.