From 57d1c46ad01399a32245404165497cd68e9911b5 Mon Sep 17 00:00:00 2001 From: ZerGo0 <18653821+ZerGo0@users.noreply.github.com> Date: Sun, 13 Jul 2025 11:28:03 +0200 Subject: [PATCH 1/3] feat: allow chatters to set their own username paint if setting is enabled --- src/lib/api/zergo0.ts | 27 +++- .../ui/useractions/ActionsButtonModal.svelte | 22 +++ .../actions/UsernamePaintModal.svelte | 134 ++++++++++++++++++ src/lib/types.ts | 7 +- 4 files changed, 188 insertions(+), 2 deletions(-) create mode 100644 src/lib/components/ui/useractions/actions/UsernamePaintModal.svelte diff --git a/src/lib/api/zergo0.ts b/src/lib/api/zergo0.ts index ab50938..1a088b5 100644 --- a/src/lib/api/zergo0.ts +++ b/src/lib/api/zergo0.ts @@ -3,7 +3,8 @@ import type { ZerGo0Badge, ZerGo0Emote, ZerGo0Response, - ZerGo0UsernamePaint + ZerGo0UsernamePaint, + ZerGo0UsernamePaintSettings } from '../types'; import { Cache } from '../utils/cache'; import { deduplicatedFetch } from '../utils/requestDeduplicator'; @@ -160,6 +161,30 @@ class Zergo0Api { this.usernamePaintCache.set(username, paintPromise); return paintPromise; } + + async getUsernamePaintSettings(creatorId: string): Promise { + try { + const resp = await deduplicatedFetch( + `https://zergo0_bot.zergo0.dev/ftv/username-paint/usersettings?creatorId=${creatorId}` + ); + if (!resp.ok) { + console.warn('Username paint settings request failed', resp); + return false; + } + + const json = (await resp.json()) as ZerGo0Response; + if (!json || !json.success) { + console.warn('Could not parse username paint settings response'); + return false; + } + + // Check if allow_chatters_set_paint is enabled + return json.response.allow_chatters_set_paint === 'true'; + } catch (error) { + console.warn('Username paint settings request failed', error); + return false; + } + } } export const zergo0Api = new Zergo0Api(); diff --git a/src/lib/components/ui/useractions/ActionsButtonModal.svelte b/src/lib/components/ui/useractions/ActionsButtonModal.svelte index bc9213f..4ab266a 100644 --- a/src/lib/components/ui/useractions/ActionsButtonModal.svelte +++ b/src/lib/components/ui/useractions/ActionsButtonModal.svelte @@ -1,12 +1,14 @@ @@ -49,6 +65,10 @@ {/if} + + {#if hasUsernamePaintPermission} + + {/if} {/snippet} @@ -59,4 +79,6 @@ {:else if action === ActionType.Giveaway} +{:else if action === ActionType.UsernamePaint} + {/if} diff --git a/src/lib/components/ui/useractions/actions/UsernamePaintModal.svelte b/src/lib/components/ui/useractions/actions/UsernamePaintModal.svelte new file mode 100644 index 0000000..c3cbbbe --- /dev/null +++ b/src/lib/components/ui/useractions/actions/UsernamePaintModal.svelte @@ -0,0 +1,134 @@ + + + + {#snippet header()} +

Set Username Paint

+ {/snippet} + + {#snippet body()} +
+
+ + +
+ +
+ +
+
+ + {previewText} + {#if selectedDesign.gif} + Username paint effect + {/if} + +
+
+
+ +
+ + +
+ +
+ + {#if error} +

{error}

+ {/if} + +
+ + +
+
+ {/snippet} +
diff --git a/src/lib/types.ts b/src/lib/types.ts index 30fa8a7..3b4fc15 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -28,7 +28,8 @@ export enum ActionType { None = 'none', Changelog = 'changelog', ChatPoll = 'chatPoll', - Giveaway = 'giveaway' + Giveaway = 'giveaway', + UsernamePaint = 'usernamePaint' } export type FanslyResponse = { @@ -717,3 +718,7 @@ export interface ZerGo0Badge { export interface ZerGo0UsernamePaint { usernamePaintId: number; } + +export interface ZerGo0UsernamePaintSettings { + allow_chatters_set_paint: string; +} From e89ad3c304a186be9c006ae61fdd474b5d901c2c Mon Sep 17 00:00:00 2001 From: ZerGo0 <18653821+ZerGo0@users.noreply.github.com> Date: Sun, 13 Jul 2025 11:29:48 +0200 Subject: [PATCH 2/3] chore: updated changelog --- changelog.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog.ts b/changelog.ts index e7f9de4..2ef9dfd 100644 --- a/changelog.ts +++ b/changelog.ts @@ -7,6 +7,8 @@ export const changelog: Changelog[] = [ changes: ` - added support for Fansly stream titles and uptimes in feed suggestions list - added emote suggestions to chat input +- added "Set Username Paint" button to user actions modal + - chatters can now set their username paint if the creator has enabled it and is a ZerGo0_Bot subscriber - fixed emotes not showing up in chat when using new lines ` }, From 09ae58f1af8b564c28a8a70d7f04123d0a318add Mon Sep 17 00:00:00 2001 From: ZerGo0 <18653821+ZerGo0@users.noreply.github.com> Date: Sun, 13 Jul 2025 11:34:21 +0200 Subject: [PATCH 3/3] ref: moved button to second position --- .../ui/useractions/ActionsButtonModal.svelte | 10 ++++------ .../ui/useractions/actions/UsernamePaintModal.svelte | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/lib/components/ui/useractions/ActionsButtonModal.svelte b/src/lib/components/ui/useractions/ActionsButtonModal.svelte index 4ab266a..36ed57f 100644 --- a/src/lib/components/ui/useractions/ActionsButtonModal.svelte +++ b/src/lib/components/ui/useractions/ActionsButtonModal.svelte @@ -1,7 +1,7 @@