UNPKG

@qixils/tiktok-live-connector

Version:

Node.js module to receive live stream chat events like comments and gifts from TikTok LIVE

2 lines 6.72 kB
export const tiktokSchemaData: "syntax = \"proto3\";\npackage TikTok;\n\n// Data structure from im/fetch/ response\nmessage WebcastResponse {\n repeated Message messages = 1;\n string cursor = 2;\n int32 fetchInterval = 3;\n int64 serverTimestamp = 4;\n string internalExt = 5;\n int32 fetchType = 6; // ws (1) or polling (2)\n WebsocketParam wsParam = 7;\n int32 heartbeatDuration = 8;\n bool needAck = 9;\n string wsUrl = 10;\n}\n\nmessage Message {\n string type = 1;\n bytes binary = 2;\n}\n\nmessage WebsocketParam {\n string name = 1;\n string value = 2;\n}\n\n// Message types depending on Message.tyoe\nmessage WebcastControlMessage {\n int32 action = 2;\n}\n\n// Statistics like viewer count\nmessage WebcastRoomUserSeqMessage {\n repeated TopUser topViewers = 2;\n int32 viewerCount = 3;\n}\n\nmessage TopUser {\n uint64 coinCount = 1;\n User user = 2;\n}\n\nmessage WebcastChatMessage {\n WebcastMessageEvent event = 1;\n User user = 2;\n string comment = 3;\n repeated WebcastSubEmote emotes = 13;\n}\n\n// Chat Emotes (Subscriber)\nmessage WebcastEmoteChatMessage {\n User user = 2;\n EmoteDetails emote = 3;\n}\n\nmessage WebcastSubEmote {\n int32 placeInComment = 1; //starting at 0, you insert the emote itself into the comment at that place\n EmoteDetails emote = 2;\n}\n\nmessage WebcastMemberMessage {\n WebcastMessageEvent event = 1;\n User user = 2;\n int32 actionId = 10;\n}\n\nmessage WebcastGiftMessage {\n WebcastMessageEvent event = 1;\n int32 giftId = 2;\n int32 repeatCount = 5;\n User user = 7;\n int32 repeatEnd = 9;\n uint64 groupId = 11;\n WebcastGiftMessageGiftDetails giftDetails = 15;\n string monitorExtra = 22;\n WebcastGiftMessageGiftExtra giftExtra = 23;\n}\n\nmessage WebcastGiftMessageGiftDetails {\n WebcastGiftMessageGiftImage giftImage = 1;\n string giftName = 16;\n string describe = 2;\n int32 giftType = 11;\n int32 diamondCount = 12;\n}\n\n// Taken from https://github.com/Davincible/gotiktoklive/blob/da4630622bc586629a53faae64e8c53509af29de/proto/tiktok.proto#L57\nmessage WebcastGiftMessageGiftExtra {\n uint64 timestamp = 6;\n uint64 receiverUserId = 8;\n}\n\nmessage WebcastGiftMessageGiftImage {\n string giftPictureUrl = 1;\n}\n\n\n// Battle start\nmessage WebcastLinkMicBattle {\n repeated WebcastLinkMicBattleItems battleUsers = 10;\n}\n\nmessage WebcastLinkMicBattleItems {\n WebcastLinkMicBattleGroup battleGroup = 2;\n}\n\nmessage WebcastLinkMicBattleGroup {\n LinkUser user = 1;\n}\n\n\n// Battle status\nmessage WebcastLinkMicArmies {\n repeated WebcastLinkMicArmiesItems battleItems = 3;\n int32 battleStatus = 7;\n}\n\nmessage WebcastLinkMicArmiesItems {\n uint64 hostUserId = 1;\n repeated WebcastLinkMicArmiesGroup battleGroups = 2;\n}\n\nmessage WebcastLinkMicArmiesGroup {\n repeated User users = 1;\n int32 points = 2;\n}\n\n\n// Follow & share event\nmessage WebcastSocialMessage {\n WebcastMessageEvent event = 1;\n User user = 2;\n}\n\n// Like event (is only sent from time to time, not with every like)\nmessage WebcastLikeMessage {\n WebcastMessageEvent event = 1;\n User user = 5;\n int32 likeCount = 2;\n int32 totalLikeCount = 3;\n}\n\n// New question event\nmessage WebcastQuestionNewMessage {\n QuestionDetails questionDetails = 2;\n}\n\nmessage QuestionDetails {\n string questionText = 2;\n User user = 5;\n}\n\nmessage WebcastMessageEvent {\n uint64 msgId = 2;\n uint64 createTime = 4;\n WebcastMessageEventDetails eventDetails = 8;\n}\n\n// Contains UI information\nmessage WebcastMessageEventDetails {\n string displayType = 1;\n string label = 2;\n}\n\n// Source: Co-opted https://github.com/zerodytrash/TikTok-Livestream-Chat-Connector/issues/19#issuecomment-1074150342\nmessage WebcastLiveIntroMessage {\n uint64 id = 2;\n string description = 4;\n User user = 5;\n}\n\nmessage SystemMessage {\n string description = 2;\n}\n\nmessage WebcastInRoomBannerMessage {\n string data = 2;\n}\n\nmessage RankItem {\n string colour = 1;\n uint64 id = 4;\n}\n\nmessage WeeklyRanking {\n string type = 1;\n string label = 2;\n RankItem rank = 3;\n}\n\nmessage RankContainer {\n WeeklyRanking rankings = 4;\n}\n\nmessage WebcastHourlyRankMessage {\n RankContainer data = 2;\n}\n\nmessage EmoteDetails {\n string emoteId = 1;\n EmoteImage image = 2;\n}\n\nmessage EmoteImage {\n string imageUrl = 1;\n}\n\n// Envelope (treasure boxes)\n// Taken from https://github.com/ThanoFish/TikTok-Live-Connector/blob/9b215b96792adfddfb638344b152fa9efa581b4c/src/proto/tiktokSchema.proto\nmessage WebcastEnvelopeMessage {\n TreasureBoxData treasureBoxData = 2;\n TreasureBoxUser treasureBoxUser = 1;\n}\n\nmessage TreasureBoxUser {\n TreasureBoxUser2 user2 = 8;\n}\n\nmessage TreasureBoxUser2 {\n repeated TreasureBoxUser3 user3 = 4;\n}\n\nmessage TreasureBoxUser3 {\n TreasureBoxUser4 user4 = 21;\n}\n\nmessage TreasureBoxUser4 {\n User user = 1;\n}\n\nmessage TreasureBoxData {\n uint32 coins = 5;\n uint32 canOpen = 6;\n uint64 timestamp = 7;\n}\n\n// New Subscriber message\nmessage WebcastSubNotifyMessage {\n WebcastMessageEvent event = 1;\n User user = 2;\n int32 exhibitionType = 3;\n int32 subMonth = 4;\n int32 subscribeType = 5;\n int32 oldSubscribeStatus = 6;\n int32 subscribingStatus = 8;\n}\n\n// ==================================\n// Generic stuff\n\nmessage User {\n uint64 userId = 1;\n string nickname = 3;\n ProfilePicture profilePicture = 9;\n string uniqueId = 38;\n string secUid = 46;\n repeated UserBadgesAttributes badges = 64;\n uint64 createTime = 16;\n string bioDescription = 5;\n FollowInfo followInfo = 22;\n}\n\nmessage FollowInfo {\n int32 followingCount = 1;\n int32 followerCount = 2;\n int32 followStatus = 3;\n int32 pushStatus = 4;\n}\n\nmessage LinkUser {\n uint64 userId = 1;\n string nickname = 2;\n ProfilePicture profilePicture = 3;\n string uniqueId = 4;\n}\n\nmessage ProfilePicture {\n repeated string urls = 1;\n}\n\n\nmessage UserBadgesAttributes {\n int32 badgeSceneType = 3;\n repeated UserImageBadge imageBadges = 20;\n repeated UserBadge badges = 21;\n PrivilegeLogExtra privilegeLogExtra = 12;\n}\n\nmessage PrivilegeLogExtra {\n string privilegeId = 2;\n string level = 5;\n}\n\nmessage UserBadge {\n string type = 2;\n string name = 3;\n}\n\nmessage UserImageBadge {\n int32 displayType = 1;\n UserImageBadgeImage image = 2;\n}\n\nmessage UserImageBadgeImage {\n string url = 1;\n}\n\n// Websocket incoming message structure\nmessage WebcastWebsocketMessage {\n uint64 id = 2;\n string type = 7;\n bytes binary = 8;\n}\n\n// Websocket acknowledgment message\nmessage WebcastWebsocketAck {\n uint64 id = 2;\n string type = 7;\n}"; //# sourceMappingURL=tiktokSchema.d.ts.map