Skip to content

Commit

Permalink
fixed button listener
Browse files Browse the repository at this point in the history
  • Loading branch information
GhomKrosmonaute committed Jan 19, 2025
1 parent d0f28f6 commit f41d148
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/buttons/pagination.native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default new Button<{

return interaction.reply({
content: "This paginator is no longer available",
ephemeral: true,
flags: discord.MessageFlags.Ephemeral,

Check failure on line 18 in src/buttons/pagination.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (npm)

Cannot find name 'discord'.

Check failure on line 18 in src/buttons/pagination.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (yarn)

Cannot find name 'discord'.

Check failure on line 18 in src/buttons/pagination.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (pnpm)

Cannot find name 'discord'.

Check failure on line 18 in src/buttons/pagination.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (npm)

Cannot find name 'discord'.

Check failure on line 18 in src/buttons/pagination.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (yarn)

Cannot find name 'discord'.

Check failure on line 18 in src/buttons/pagination.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (pnpm)

Cannot find name 'discord'.
})
},
})
9 changes: 5 additions & 4 deletions src/listeners/button.interactionCreate.native.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// system file, please don't modify it

import discord from "discord.js"
import * as button from "#core/button"
import { Listener } from "#core/listener"
import logger from "#core/logger"
Expand All @@ -23,15 +24,15 @@ export default new Listener({
"error",
"This button is no longer available",
)),
ephemeral: true,
flags: discord.MessageFlags.Ephemeral,
})

const error = await button.prepareButton(interaction as any, btn)

if (error)
return interaction.reply({
...error,
ephemeral: true,
flags: discord.MessageFlags.Ephemeral,
})

try {
Expand All @@ -42,15 +43,15 @@ export default new Listener({

return interaction.reply({
...(await util.getSystemMessage("error", error)),
ephemeral: true,
flags: discord.MessageFlags.Ephemeral,
})
} else {
return interaction.reply({
...(await util.getSystemMessage(
"error",
"An unknown error while executing the button",
)),
ephemeral: true,
flags: discord.MessageFlags.Ephemeral,
})
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/listeners/slash.interactionCreate.native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ export default new Listener({
if (interaction.replied || interaction.deferred) {
interaction[interaction.replied ? "followUp" : "editReply"]({
...errorMessage,
ephemeral: true,
flags: discord.MessageFlags.Ephemeral,

Check failure on line 64 in src/listeners/slash.interactionCreate.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (npm)

Cannot find name 'discord'.

Check failure on line 64 in src/listeners/slash.interactionCreate.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (yarn)

Cannot find name 'discord'.

Check failure on line 64 in src/listeners/slash.interactionCreate.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (pnpm)

Cannot find name 'discord'.

Check failure on line 64 in src/listeners/slash.interactionCreate.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (npm)

Cannot find name 'discord'.

Check failure on line 64 in src/listeners/slash.interactionCreate.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (yarn)

Cannot find name 'discord'.

Check failure on line 64 in src/listeners/slash.interactionCreate.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (pnpm)

Cannot find name 'discord'.
})
} else {
interaction
.reply({
...errorMessage,
ephemeral: true,
flags: discord.MessageFlags.Ephemeral,

Check failure on line 70 in src/listeners/slash.interactionCreate.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (npm)

Cannot find name 'discord'.

Check failure on line 70 in src/listeners/slash.interactionCreate.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (yarn)

Cannot find name 'discord'.

Check failure on line 70 in src/listeners/slash.interactionCreate.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (pnpm)

Cannot find name 'discord'.

Check failure on line 70 in src/listeners/slash.interactionCreate.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (npm)

Cannot find name 'discord'.

Check failure on line 70 in src/listeners/slash.interactionCreate.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (yarn)

Cannot find name 'discord'.

Check failure on line 70 in src/listeners/slash.interactionCreate.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (pnpm)

Cannot find name 'discord'.
})
.catch((error) => {
logger.error(error, cmd!.filepath!, true)
Expand Down
2 changes: 1 addition & 1 deletion src/slash/ping.native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default new SlashCommand({
run(interaction) {
return interaction.reply({
content: `Pong! \`${client.ws.ping}ms\``,
ephemeral: true,
flags: discord.MessageFlags.Ephemeral,

Check failure on line 10 in src/slash/ping.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (npm)

Cannot find name 'discord'.

Check failure on line 10 in src/slash/ping.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (yarn)

Cannot find name 'discord'.

Check failure on line 10 in src/slash/ping.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (pnpm)

Cannot find name 'discord'.

Check failure on line 10 in src/slash/ping.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (npm)

Cannot find name 'discord'.

Check failure on line 10 in src/slash/ping.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (yarn)

Cannot find name 'discord'.

Check failure on line 10 in src/slash/ping.native.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v22 (pnpm)

Cannot find name 'discord'.
})
},
})

0 comments on commit f41d148

Please sign in to comment.