Skip to content

Commit

Permalink
docs: update docs for 0.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Whipstickgostop committed Oct 4, 2024
1 parent d25ec4b commit 21c4a83
Show file tree
Hide file tree
Showing 9 changed files with 210 additions and 46 deletions.
10 changes: 3 additions & 7 deletions apps/docs/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
export default defineAppConfig({
// FIXME: This is a workaround for nuxt-icon typecheck errors: https://github.com/nuxt-modules/icon/issues/86
nuxtIcon: {
aliases: undefined,
class: undefined,
size: undefined,
},

ui: {
primary: 'blue',
gray: 'neutral',
card: {
background: 'dark:bg-gray-800/25 backdrop-blur'
}
},
});
2 changes: 1 addition & 1 deletion apps/docs/app/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const navigation = inject<ComputedRef<any[]>>('navigation')
</template>

<template #right>
<UDocsSearchButton size="sm" class="max-w-xs" />
<UContentSearchButton size="sm" class="max-w-xs" />
<UColorModeButton />
</template>

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/app/components/global/icon/Speakerbot.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup></script>

<template>
<IconBase src="/img/icons/speakerbot.png" />
<IconBase src="/client/img/icons/speakerbot.png" />
</template>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup></script>

<template>
<IconBase src="/img/icons/streamerbot-extensions.svg" />
<IconBase src="/client/img/icons/streamerbot-extensions.svg" />
</template>
30 changes: 22 additions & 8 deletions apps/docs/app/components/streamerbot/StreamerbotPlayground.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const {
data,
error,
connect,
disconnect
disconnect,
} = useStreamerbot({
host,
port,
Expand All @@ -36,7 +36,7 @@ const clientOptionsCode = computed(() => {
</script>

<template>
<div class="grid grid-cols-1 md:grid-cols-2 gap-2">
<div class="grid grid-cols-1 md:grid-cols-2 gap-3">
<UCard class="w-auto">
<template #header>
<h3 class="text-lg font-semibold">
Expand Down Expand Up @@ -87,10 +87,24 @@ const clientOptionsCode = computed(() => {

<UAlert v-if="error" title="WebSocket Error" :description="error" color="red" variant="soft" class="mt-3" />

<UCard v-if="status === 'OPEN'" class="mt-3">
<template #header>
<h3 class="text-lg font-semibold">Last Message Received</h3>
</template>
<pre><code>{{ data }}</code></pre>
</UCard>
<template v-if="status === 'OPEN'">
<div class="flex flex-wrap gap-1 my-3">
<UButton color="gray" @click="() => client.getInfo()">Get Info</UButton>
<UButton color="gray" @click="() => client.getEvents()">Get Events</UButton>
<UButton color="gray" @click="() => client.getActions()">Get Actions</UButton>
<UButton color="gray" @click="() => client.getBroadcaster()">Get Broadcaster</UButton>
<UButton color="gray" @click="() => client.getCredits()">Get Credits</UButton>
<UButton color="gray" @click="() => client.getActiveViewers()">Get Active Viewers</UButton>
<UButton color="gray" @click="() => client.getCodeTriggers()">Get Code Triggers</UButton>
<UButton color="gray" @click="() => client.getCommands()">Get Commands</UButton>
<UButton color="gray" @click="() => client.twitchGetEmotes()">Get Emotes (Twitch)</UButton>
<UButton color="gray" @click="() => client.youtubeGetEmotes()">Get Emotes (YouTube)</UButton>
</div>
<UCard class="mt-3">
<template #header>
<h3 class="text-lg font-semibold">Last Message Received</h3>
</template>
<pre><code>{{ data }}</code></pre>
</UCard>
</template>
</template>
6 changes: 3 additions & 3 deletions apps/docs/app/pages/[...slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ const { communityLinks, ecosystemLinks } = useLinks(page);

<hr v-if="surround?.length">

<UDocsSurround :surround="(surround as ParsedContent[])" />
<UContentSurround :surround="(surround as ParsedContent[])" />
</UPageBody>

<template #right>
<UDocsToc :links="page.body?.toc.links">
<UContentToc :links="page.body?.toc.links">
<template #bottom>
<div class="hidden lg:block space-y-6 !mt-6">
<UDivider v-if="page.body?.toc?.links?.length" type="dashed" />
Expand All @@ -61,7 +61,7 @@ const { communityLinks, ecosystemLinks } = useLinks(page);
<UPageLinks title="Ecosystem" :links="ecosystemLinks" />
</div>
</template>
</UDocsToc>
</UContentToc>
</template>
</UPage>
</template>
1 change: 1 addition & 0 deletions apps/docs/content/3.api/0.config.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ If you've modified your `WebSocket Server` settings in Streamer.bot, make sure t
- Default: `ws`
```ts
const client = new StreamerbotClient({ scheme: 'wss', host: 'sb-tunnel.my-tailnet.ts.net' });
```
::

::field{name=immediate type=Boolean}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Methods
description: Reference of all methods that can be invoked from a Streamer.bot Client instance
title: Requests
description: Reference of all requests that made to a Streamer.bot instance
---

## `getInfo`
Expand Down Expand Up @@ -37,7 +37,8 @@ const infoResponse = await client.getInfo();
"instanceId": "c1a51f77-ec2e-4051-8378-94e4e8b6044b",
"name": "Streamer.bot",
"os": "windows",
"version": "0.1.21",
"osVersion": "10.0.22631.0",
"version": "0.2.5",
"source": "websocketServer"
}
}
Expand Down Expand Up @@ -590,4 +591,162 @@ Reset the current credits system data.
```ts [Request]
const response = await client.clearCredits();
```
::

## `getCommands`
_Requires Streamer.bot v0.2.5_

Fetch a list of commands for the connected Streamer.bot instance

#### Signature
`getCommands: Promise<GetCommandsResponse>`{lang=ts}

#### Response Type
```ts [GetCommandsResponse.ts]
type GetCommandsResponse = {
status: 'ok' | 'error';
commands: Array<{
id: string;
enabled: boolean;
name: string;
group: string;
commands: Array<string>;
caseSensitive: boolean;
ignoreInternal: boolean;
ignoreBotAccount: boolean;
sources: Array<string>;
}>;
count: number;
}
```
#### Examples
::code-group
```ts [Request]
const response = await client.getCommands();
```
::

## `getMonitoredYouTubeBroadcasts`
_Requires Streamer.bot v0.2.5_

Fetch a list of currently monitored YouTube broadcasts

#### Signature
`getMonitoredYouTubeBroadcasts: Promise<GetMonitoredYouTubeBroadcastsResponse>`{lang=ts}

#### Response Type
```ts [GetMonitoredYouTubeBroadcastsResponse.ts]
type GetMonitoredYouTubeBroadcastsResponse = {
status: 'ok' | 'error';
broadcasts: Array<{
actualEndTime: string;
actualStartTime: string;
categoryId: string;
channelId: string;
description: string;
id: string;
liveChatId: string;
privacy: 'public' | 'private' | 'unlisted' | string;
publishedAt: string;
scheduledEndTime: string;
scheduledStartTime: string;
status: 'ready' | 'complete' | string;
title: string;
tags: Array<string>;
defaultLanguage: string;
defaultAudioLanguage: string;
}>;
count: number;
}
```
#### Examples
::code-group
```ts [Request]
const response = await client.getMonitoredYouTubeBroadcasts();
```
::

## `twitchGetEmotes`
_Requires Streamer.bot v0.2.5_

Fetch a list of emotes for the connected Twitch broadcaster account

#### Signature
`twitchGetEmotes: Promise<TwitchGetEmotesResponse>`{lang=ts}

#### Response Type
```ts [TwitchGetEmotesResponse.ts]
type TwitchGetEmotesResponse = {
status: 'ok' | 'error';
emotes: {
userEmotes: Array<{
type: string;
name: string;
imageUrl: string;
}>;
bttvEmotes: Array<{
type: string;
name: string;
imageUrl: string;
}>;
ffzEmotes: Array<{
type: string;
name: string;
imageUrl: string;
}>;
sevenTvEmotes: Array<{
type: string;
name: string;
imageUrl: string;
}>;
}
}
```
#### Examples
::code-group
```ts [Request]
const response = await client.twitchGetEmotes();
```
::

## `youTubeGetEmotes`
_Requires Streamer.bot v0.2.5_

Fetch a list of emotes for the connected YouTube broadcaster account

#### Signature
`youtubeGetEmotes: Promise<YouTubeGetEmotesResponse>`{lang=ts}

#### Response Type
```ts [YouTubeGetEmotesResponse.ts]
type YouTubeGetEmotesResponse = {
status: 'ok' | 'error';
emotes: {
userEmotes: Array<{
type: string;
name: string;
imageUrl: string;
}>;
bttvEmotes: Array<{
type: string;
name: string;
imageUrl: string;
}>;
sevenTvEmotes: Array<{
type: string;
name: string;
imageUrl: string;
}>;
}
}
```
#### Examples
::code-group
```ts [Request]
const response = await client.youtubeGetEmotes();
```
::
38 changes: 16 additions & 22 deletions apps/docs/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
export default defineNuxtConfig({
extends: ['@nuxt/ui-pro'],

modules: ['@nuxt/ui', '@vueuse/nuxt', 'nuxt-og-image', 'nuxt-link-checker', '@nuxt/content', '@nuxt/image'],
modules: [
'@nuxt/ui',
'@vueuse/nuxt',
'nuxt-og-image',
'nuxt-link-checker',
'@nuxt/content',
'@nuxt/image',
'@nuxt/fonts'
],

app: {
baseURL: '/client',
Expand All @@ -10,27 +18,15 @@ export default defineNuxtConfig({
},
},

imports: {
dirs: ['composables'],
},

site: {
url: 'https://streamerbot.github.io/client',
name: 'Streamer.bot WebSocket Client',
twitterCard: 'summary_large_image',
},

ui: {
global: true,
icons: ['mdi', 'heroicons', 'simple-icons', 'vscode-icons', 'logos', 'carbon', 'skill-icons'],
},

colorMode: {
preference: 'dark',
},

devtools: {
enabled: true,
fallback: 'dark',
},

content: {
Expand Down Expand Up @@ -66,14 +62,6 @@ export default defineNuxtConfig({
},
},

googleFonts: {
display: 'swap',
download: true,
families: {
'DM+Sans': [400, 500, 600, 700],
},
},

nitro: {
routeRules: {
'/get-started': { redirect: { to: '/get-started/installation', statusCode: 301 } },
Expand Down Expand Up @@ -108,4 +96,10 @@ export default defineNuxtConfig({
},

compatibilityDate: '2024-09-25',

$development: {
devtools: {
enabled: true,
},
}
});

0 comments on commit 21c4a83

Please sign in to comment.