diff --git a/src/parser/classes/livechat/items/LiveChatAutoModMessage.ts b/src/parser/classes/livechat/items/LiveChatAutoModMessage.ts new file mode 100644 index 00000000..8518cff3 --- /dev/null +++ b/src/parser/classes/livechat/items/LiveChatAutoModMessage.ts @@ -0,0 +1,24 @@ +import Text from '../../misc/Text'; +import Parser from '../../../index'; +import { YTNode } from '../../../helpers'; + +class LiveChatAutoModMessage extends YTNode { + static type = 'LiveChatAutoModMessage'; + + auto_moderated_item; + header_text: Text; + + timestamp: number; + id: string; + + constructor(data: any) { + super(); + + this.auto_moderated_item = Parser.parse(data.autoModeratedItem); + this.header_text = new Text(data.headerText); + this.timestamp = Math.floor(parseInt(data.timestampUsec) / 1000); + this.id = data.id; + } +} + +export default LiveChatAutoModMessage; \ No newline at end of file diff --git a/src/parser/map.ts b/src/parser/map.ts index 7b88ede7..903cb1cd 100644 --- a/src/parser/map.ts +++ b/src/parser/map.ts @@ -88,6 +88,7 @@ import { default as LiveChat } from './classes/LiveChat'; import { default as AddBannerToLiveChatCommand } from './classes/livechat/AddBannerToLiveChatCommand'; import { default as AddChatItemAction } from './classes/livechat/AddChatItemAction'; import { default as AddLiveChatTickerItemAction } from './classes/livechat/AddLiveChatTickerItemAction'; +import { default as LiveChatAutoModMessage } from './classes/livechat/items/LiveChatAutoModMessage'; import { default as LiveChatBanner } from './classes/livechat/items/LiveChatBanner'; import { default as LiveChatBannerHeader } from './classes/livechat/items/LiveChatBannerHeader'; import { default as LiveChatBannerPoll } from './classes/livechat/items/LiveChatBannerPoll'; @@ -353,6 +354,7 @@ const map: Record = { AddBannerToLiveChatCommand, AddChatItemAction, AddLiveChatTickerItemAction, + LiveChatAutoModMessage, LiveChatBanner, LiveChatBannerHeader, LiveChatBannerPoll,