feat: add LiveChatAutoModMessage (#177)

This commit is contained in:
Akazawa Daisuke
2022-09-10 03:29:36 +09:00
committed by GitHub
parent c9856a8359
commit e00be25bf4
2 changed files with 26 additions and 0 deletions

View 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;

View File

@@ -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,