Skip to content

Commit 08ab8db

Browse files
authored
Merge pull request #2 from Potat-Industries/feat/channel-emote-stat-route
feat: add channel emote stats route
2 parents 41dc3d9 + 1fd3c16 commit 08ab8db

File tree

7 files changed

+436
-0
lines changed

7 files changed

+436
-0
lines changed

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
23.6.1

src/lib/types.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
export enum Platforms {
2+
TWITCH = 'TWITCH',
3+
DISCORD = 'DISCORD',
4+
SPOTIFY = 'SPOTIFY',
5+
LASTFM = 'LASTFM',
6+
KICK = 'KICK',
7+
YOUTUBE = 'YOUTUBE',
8+
STV = 'STV',
9+
BTTV = 'BTTV',
10+
FFZ = 'FFZ',
11+
ANILIST = 'ANILIST',
12+
MAL = 'MAL',
13+
MONKEY_TYPE = 'MONKEYTYPE',
14+
STEAM = 'STEAM'
15+
}
16+
17+
export type EmoteProviders =
18+
| Platforms.BTTV
19+
| Platforms.FFZ
20+
| Platforms.STV
21+
| Platforms.TWITCH
22+
| Platforms.KICK
23+
| Platforms.DISCORD
24+
| 'EMOJI';
25+
26+
export interface EmoteMetricUse {
27+
readonly emote_id: string;
28+
readonly emote_name: string;
29+
readonly emote_alias?: string;
30+
readonly provider: EmoteProviders;
31+
readonly count: string;
32+
readonly url: string;
33+
}

src/lib/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export const fetchBackend = async <T = unknown>(
127127
options?: ExtendedOptions
128128
): Promise<ParsedRes<GenericResponse<T>>> => {
129129
const result = await makeRequest<GenericResponse<T>>(
130+
/** @todo load from env */
130131
`https://api.potat.app/${url}`,
131132
options
132133
);

src/routes/channel/[login]/tabs.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Settings from './tabs/settings.svelte';
44
import CustomCommands from './tabs/custom-commands.svelte';
55
import ModActions from './tabs/mod-actions.svelte';
66
import EmoteActions from './tabs/emote-history.svelte';
7+
import EmoteStats from './tabs/emote-stats.svelte';
78

89
export const tabs: TabConfig[] = [
910
{
@@ -12,6 +13,12 @@ export const tabs: TabConfig[] = [
1213
icon: Settings2,
1314
component: EmoteActions,
1415
},
16+
{
17+
id: 'emote-stats',
18+
label: 'Emote Stats',
19+
icon: Settings2,
20+
component: EmoteStats,
21+
},
1522
{
1623
id: 'custom-commands',
1724
label: 'Custom Commands',

0 commit comments

Comments
 (0)