diff --git a/src/assets/messageParser.ts b/src/assets/messageParser.ts index e1a4230..90c3651 100644 --- a/src/assets/messageParser.ts +++ b/src/assets/messageParser.ts @@ -102,7 +102,7 @@ export function parseRawMessage(rawMessage: string, allBadges: Badge[]): Message } } -function parseRawBadges(rb: string, allBadges: Badge[]): Badge[] { +export function parseRawBadges(rb: string, allBadges: Badge[]): Badge[] { const badges = rb.split(',') const formatedBadges = badges.map((badgeWithVersion: string) => { const [setId, version] = badgeWithVersion.split('/') diff --git a/src/components/VodChat.vue b/src/components/VodChat.vue new file mode 100644 index 0000000..a573f5c --- /dev/null +++ b/src/components/VodChat.vue @@ -0,0 +1,143 @@ + + + + + + + + {{ $t('chat.connecting', { username: channelName }) }} + + + + + + + + + + + + + + + {{ message.messager.name }}: {{ message.message }} + + + + + + + diff --git a/src/types/Chat.ts b/src/types/Chat.ts index d42e560..714e77e 100644 --- a/src/types/Chat.ts +++ b/src/types/Chat.ts @@ -1,3 +1,5 @@ +import type { Badge } from "@/assets/types" + export interface TwitchChatOptions { login: { username: string @@ -31,5 +33,5 @@ export interface VodMessage { colorHex: string } offset: number - badges: VodMessageBadge[] + badges: Badge[] } diff --git a/src/types/VOD.ts b/src/types/VOD.ts index 85d66fa..fa3582a 100644 --- a/src/types/VOD.ts +++ b/src/types/VOD.ts @@ -1,3 +1,4 @@ +import type { Badge } from '@/assets/types' import type { StreamerData } from './Streamer' export interface MinifiedCategory { @@ -47,5 +48,5 @@ export interface VodComment { messager: MinifiedStreamer offset: number cursor: string - badges: VodCommentBadge[] + badges: Badge[] } diff --git a/src/views/VodView.vue b/src/views/VodView.vue index 0520d4a..03ca0e0 100644 --- a/src/views/VodView.vue +++ b/src/views/VodView.vue @@ -3,7 +3,7 @@ import { ref, inject } from 'vue' import { useRoute } from 'vue-router' import VideoPlayer from '@/components/VideoPlayer.vue' -import TwitchChat from '@/components/TwitchChat.vue' +import VodChat from '@/components/VodChat.vue' import ErrorMessage from '@/components/ErrorMessage.vue' import FollowButton from '@/components/FollowButton.vue' import LoadingScreen from '@/components/LoadingScreen.vue' @@ -16,6 +16,7 @@ import type { Video } from '@/types' import { truncate, abbreviate, getEndpoint } from '@/mixins' import { getSetting } from '@/settingsManager' + interface ChatComponent { updateVodComments: (time: number) => void } @@ -59,7 +60,7 @@ export default { }, components: { VideoPlayer, - TwitchChat, + VodChat, ErrorMessage, FollowButton, LoadingScreen, @@ -158,11 +159,11 @@ export default { - + >
+ {{ $t('chat.connecting', { username: channelName }) }} +
+ + {{ message.messager.name }}: {{ message.message }} +