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,11 +1,21 @@
|
||||
import { ref, readonly, computed } from 'vue'
|
||||
|
||||
interface BotCustomization {
|
||||
archetype?: string
|
||||
primaryColor?: string
|
||||
secondaryColor?: string
|
||||
forceVisor?: boolean
|
||||
forceMohawk?: boolean
|
||||
forceHorns?: boolean
|
||||
}
|
||||
|
||||
interface BotData {
|
||||
id: string
|
||||
name: string
|
||||
avatarSeed: string
|
||||
archetype: string
|
||||
profilePicUrl: string | null
|
||||
customization: BotCustomization | null
|
||||
eloRating: number
|
||||
wins: number
|
||||
losses: number
|
||||
@@ -122,6 +132,7 @@ export function useNostr() {
|
||||
avatarSeed: data.name,
|
||||
archetype: data.archetype,
|
||||
profilePicUrl: profilePicUrl.value,
|
||||
customization: data.customization || null,
|
||||
eloRating: 1200,
|
||||
wins: 0,
|
||||
losses: 0,
|
||||
@@ -134,6 +145,30 @@ export function useNostr() {
|
||||
return bot.value
|
||||
}
|
||||
|
||||
async function updateCustomization(customization: BotCustomization): Promise<void> {
|
||||
if (!pubkey.value) throw new Error('Not logged in')
|
||||
|
||||
const res = await fetch('/api/auth/update', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ pubkey: pubkey.value, customization }),
|
||||
})
|
||||
|
||||
if (!res.ok) {
|
||||
const data = await res.json()
|
||||
throw new Error(data.error || 'Update failed')
|
||||
}
|
||||
|
||||
if (bot.value) {
|
||||
bot.value = {
|
||||
...bot.value,
|
||||
customization: { ...(bot.value.customization || {}), ...customization },
|
||||
archetype: customization.archetype || bot.value.archetype,
|
||||
}
|
||||
store('bf_bot', bot.value)
|
||||
}
|
||||
}
|
||||
|
||||
function logout() {
|
||||
pubkey.value = null
|
||||
bot.value = null
|
||||
@@ -152,6 +187,7 @@ export function useNostr() {
|
||||
hasExtension,
|
||||
login,
|
||||
registerBot,
|
||||
updateCustomization,
|
||||
logout,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user