mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-23 14:38:07 +00:00
feat: add LiveChatAutoModMessage (#177)
This commit is contained in:
24
src/parser/classes/livechat/items/LiveChatAutoModMessage.ts
Normal file
24
src/parser/classes/livechat/items/LiveChatAutoModMessage.ts
Normal file
@@ -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;
|
||||
@@ -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<string, YTNodeConstructor> = {
|
||||
AddBannerToLiveChatCommand,
|
||||
AddChatItemAction,
|
||||
AddLiveChatTickerItemAction,
|
||||
LiveChatAutoModMessage,
|
||||
LiveChatBanner,
|
||||
LiveChatBannerHeader,
|
||||
LiveChatBannerPoll,
|
||||
|
||||
Reference in New Issue
Block a user