Skip to content

Commit

Permalink
fix(changelog): handle reply for public changelog event (#1597)
Browse files Browse the repository at this point in the history
  • Loading branch information
quanghuynguyen1902 authored Jan 25, 2024
1 parent c0e66e6 commit bdc210c
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions src/commands/changelog/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,7 @@ export async function handleConfirmPublicChangelog(i: ButtonInteraction) {

const author = getAuthor(i)
if (author.id != NEKO_SAN_ID) {
await i.reply({
embeds: [
composeEmbedMessage(null, {
author: ["Invalid Owner", getEmojiURL(emojis.REVOKE)],
description: `Only <@${NEKO_SAN_ID}> can publish the new changelog`,
}),
],
})
return
}

const data = await mochiAPI.publicChangelog(changelogName, true)
Expand Down Expand Up @@ -113,14 +106,7 @@ export async function handleConfirmPublicChangelog(i: ButtonInteraction) {
export async function handleCancelPublicChangelog(i: ButtonInteraction) {
const author = getAuthor(i)
if (author.id != NEKO_SAN_ID) {
await i.reply({
embeds: [
composeEmbedMessage(null, {
author: ["Invalid Owner", getEmojiURL(emojis.REVOKE)],
description: `Only <@${NEKO_SAN_ID}> can cancel to public the new changelog`,
}),
],
})
return
}

const { message } = <{ message: Message }>i
Expand All @@ -129,7 +115,7 @@ export async function handleCancelPublicChangelog(i: ButtonInteraction) {
embeds: [
composeEmbedMessage(message, {
author: ["Unpublished Changelog", getEmojiURL(emojis.REVOKE)],
description: `You have canceled to public the new changelog`,
description: `You haven't published the new changelog`,
}),
],
components: [],
Expand Down

0 comments on commit bdc210c

Please sign in to comment.