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