This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 48
DefaultProcessor_
taizan-hokuto edited this page Jul 24, 2020
·
10 revisions
pytchatでは、processorパラメータに何も指定しない場合、このDefaultProcessorによって加工されたチャットデータが返されます。
chat = LiveChat("xxxxxxxxxxx") #video_id
#chat = LiveChat("xxxxxxxxxxx", processor = DefaultProcessor()) と同義。
while chat.is_alive():
data = chat.get() #get processed data.
items = data.items
for c in items:
print(f"{c.datetime} [{c.author.name}]-{c.message} -{c.amountString}")
data.tick()
description | return value |
---|---|
チャットデータのリストを取得します。 | チャットデータのリスト |
description |
---|
次のチャットが表示されるまで待ちます. |
description |
---|
(LiveChatAsync使用時のみ有効)次のチャットが表示されるまで待ちます。この関数はawaitをつけて呼び出さなければなりません。 |
name | type | remarks |
---|---|---|
type | str | "superChat","textMessage","superSticker","newSponsor" |
id | str | チャットの個別ID |
message | str | カスタム絵文字は ":(テキスト):"のように表示されます。 |
messageEx | str | メッセージおよびカスタム絵文字のリスト。カスタム絵文字は画像URLとして表示されます。 |
timestamp | int | チャット投稿時刻(unixタイムスタンプ、ミリ秒) |
datetime | str | 例: "2019-10-10 12:34:56" |
elapsedTime | str | 経過時間 (例 "1:02:27") *リプレイモードのみ対応 |
amountValue | float | スパチャの金額部分(例: 1,234.0) |
amountString | str | スパチャの通貨+金額表示(例 "$ 1,234") |
currency | str | ISO 4217 通貨記号 (例: "USD") |
bgColor | int | メッセージの背景色(RGB) |
author | object | チャット投稿者データ。下記参照。 |
colors | object | スーパーチャット・スパーステッカーの色データ。下記参照 |
チャット投稿者データ
name | type | remarks |
---|---|---|
name | str | 投稿者名 |
channelId | str | 投稿者のユーザーチャンネルID. |
channelUrl | str | 投稿者のユーザーチャンネルURL |
imageUrl | str | 投稿者のプロフィール画像URL |
badgeUrl | str | メンバーのバッジ画像URL |
isVerified | bool | 確認済み |
isChatOwner | bool | 配信者本人 |
isChatSponsor | bool | メンバーシップ加入者(※スパチャデータの場合、メンバーか否かにかかわらず常にFalse) |
isChatModerator | bool | モデレータ |
色データ
name | type | remarks |
---|---|---|
headerBackgroundColor | int (ARGB) | type:`superChat`でのみ利用可能 |
headerTextColor | int (ARGB) | type:`superChat`でのみ利用可能 |
bodyBackgroundColor | int (ARGB) | type:`superChat`でのみ利用可能。`bgColor`と同じ値を返します。 |
bodyTextColor | int (ARGB) | type:`superChat`でのみ利用可能 |
timestampColor | int (ARGB) | type:`superChat`でのみ利用可能 |
authorNameTextColor | int (ARGB) | type:`superChat` と `superSticker`でのみ利用可能 |
backgroundColor | int (ARGB) | type:`superSticker`でのみ利用可能。`bgColor`と同じ値を返します。 |
moneyChipBackgroundColor | int (ARGB) | type:`superSticker`でのみ利用可能。 |
moneyChipTextColor | int (ARGB) | type:`superSticker`でのみ利用可能 |