feat: comedy overhaul start, profile page, bot setup docs, auth improvements
Rewrites announcer commentary (HYPE_LINES, DEEP_INTROS, ROUND_HYPE) with modern edgy humor. Adds BOT_SETUP.md, bot SDK, customization engine, profile page character display, persistent auth, rate limit tweaks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
4a35e1e0b5
commit
559782c8ce
@@ -1,5 +1,7 @@
|
||||
import type { Context, Next } from 'hono'
|
||||
|
||||
const isDev = process.env.NODE_ENV !== 'production'
|
||||
|
||||
const hitCounts = new Map<string, { count: number; resetAt: number }>()
|
||||
|
||||
// Cleanup stale entries every 5 minutes
|
||||
@@ -12,6 +14,8 @@ setInterval(() => {
|
||||
|
||||
export function rateLimit(windowMs: number, maxHits: number) {
|
||||
return async (c: Context, next: Next) => {
|
||||
if (isDev) return next()
|
||||
|
||||
const key = c.req.header('x-forwarded-for') || c.req.header('cf-connecting-ip') || 'unknown'
|
||||
const now = Date.now()
|
||||
const entry = hitCounts.get(key)
|
||||
@@ -34,6 +38,8 @@ const botHitCounts = new Map<string, number>()
|
||||
|
||||
export function botRateLimit(cooldownMs: number) {
|
||||
return async (c: Context, next: Next) => {
|
||||
if (isDev) return next()
|
||||
|
||||
const botId = c.req.param('botId')
|
||||
if (!botId) return next()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user