diff --git a/functions/api/game-appeals/precheck.ts b/functions/api/game-appeals/precheck.ts index f60aae7..e0e13ce 100644 --- a/functions/api/game-appeals/precheck.ts +++ b/functions/api/game-appeals/precheck.ts @@ -6,7 +6,9 @@ export default async function ( user: number, ): Promise<{ can_appeal?: boolean; error?: string; reason?: string }> { if ( - await context.env.D1.prepare("SELECT * FROM game_appeals WHERE open = 1 AND user = ?;") + await context.env.D1.prepare( + "SELECT * FROM game_appeals WHERE open = 1 AND user = ?;", + ) .bind(user) .first() ) @@ -43,6 +45,9 @@ export default async function ( }; } + // Legacy bans + if (!userLogs.length) return { can_appeal: true, reason: "" }; + userLogs.sort((a, b) => parseInt(a.entity.properties.executed_at.integerValue) > parseInt(b.entity.properties.executed_at.integerValue)