fix build
All checks were successful
commit-tag / commit-tag-image (map[context:./migrations file:./migrations/Dockerfile name:migrations]) (push) Successful in 16s
commit-tag / commit-tag-image (map[context:./ts file:./ts/Dockerfile name:ts]) (push) Successful in 1m47s

This commit is contained in:
a 2025-07-12 22:37:32 -05:00
parent 5b40473b5e
commit 8dce848d3a
No known key found for this signature in database
GPG Key ID: 2F22877AA4DFDADB
2 changed files with 11 additions and 15 deletions

View File

@ -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'
) )
} }

View File

@ -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
} }
} }