fix build
This commit is contained in:
parent
5b40473b5e
commit
8dce848d3a
@ -3,17 +3,12 @@ import { c } from '#/di'
|
||||
import type { InteractionRef } from '#/discord'
|
||||
import { InteractionResponseTypes } from '@discordeno/types'
|
||||
import { Bot } from '#/discord/bot'
|
||||
import { ApplicationError } from '@temporalio/activity'
|
||||
import { ApplicationFailure } from '@temporalio/common'
|
||||
import { logger } from '#/logger'
|
||||
|
||||
const log = logger.child({ component: 'discord-activity' })
|
||||
|
||||
// Custom error class for non-retryable Discord errors
|
||||
export class DiscordInteractionExpiredError extends ApplicationError {
|
||||
constructor(message: string) {
|
||||
super(message, { nonRetryable: true })
|
||||
}
|
||||
}
|
||||
// We don't need a custom error class anymore, we'll use ApplicationFailure.nonRetryable()
|
||||
|
||||
// from https://github.com/discordeno/discordeno/blob/21.0.0/packages/bot/src/transformers/interaction.ts#L33
|
||||
export const reply_to_interaction = async (props: {
|
||||
@ -59,8 +54,9 @@ export const reply_to_interaction = async (props: {
|
||||
)
|
||||
|
||||
// Throw non-retryable error to prevent Temporal from retrying
|
||||
throw new DiscordInteractionExpiredError(
|
||||
`Discord interaction ${ref.id} has expired and cannot be responded to`
|
||||
throw ApplicationFailure.nonRetryable(
|
||||
`Discord interaction ${ref.id} has expired and cannot be responded to`,
|
||||
'DiscordInteractionExpired'
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@ -19,8 +19,8 @@ export async function handleCommandGuildInfo(payload: CommandPayload): Promise<v
|
||||
let guildId = WYNN_GUILD_ID // Default fallback
|
||||
if (discordGuildId) {
|
||||
const wynnGuild = await get_discord_guild_setting(discordGuildId, 'wynn_guild')
|
||||
if (wynnGuild?.uid) {
|
||||
guildId = wynnGuild.uid
|
||||
if (wynnGuild) {
|
||||
guildId = wynnGuild
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,8 +39,8 @@ export async function handleCommandGuildOnline(payload: CommandPayload): Promise
|
||||
let guildId = WYNN_GUILD_ID // Default fallback
|
||||
if (discordGuildId) {
|
||||
const wynnGuild = await get_discord_guild_setting(discordGuildId, 'wynn_guild')
|
||||
if (wynnGuild?.uid) {
|
||||
guildId = wynnGuild.uid
|
||||
if (wynnGuild) {
|
||||
guildId = wynnGuild
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,8 +59,8 @@ export async function handleCommandGuildLeaderboard(payload: CommandPayload): Pr
|
||||
let guildId = WYNN_GUILD_ID // Default fallback
|
||||
if (discordGuildId) {
|
||||
const wynnGuild = await get_discord_guild_setting(discordGuildId, 'wynn_guild')
|
||||
if (wynnGuild?.uid) {
|
||||
guildId = wynnGuild.uid
|
||||
if (wynnGuild) {
|
||||
guildId = wynnGuild
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user