events

package
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2026 License: 0BSD Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Type   EventType
	Data   interface{}
	RoomID string // only for EventConnected
}

Event represents a decoded TikTok Live event.

func Decode

func Decode(msgType string, payload []byte) []Event

Decode decodes a protobuf message by type string and returns one or more events. Sub-routed messages (Social, Member, Control) return 2 events: raw + convenience.

type EventType

type EventType int

EventType identifies the kind of event.

const (
	// lifecycle
	EventConnected EventType = iota
	EventReconnecting
	EventDisconnected

	// core
	EventChat
	EventGift
	EventLike
	EventMember
	EventSocial
	EventRoomUserSeq
	EventControl

	// convenience sub-routed
	EventFollow
	EventShare
	EventJoin
	EventLiveEnded

	// useful
	EventLiveIntro
	EventRoomMessage
	EventCaption
	EventGoalUpdate
	EventImDelete

	// niche
	EventRankUpdate
	EventPoll
	EventEnvelope
	EventRoomPin
	EventUnauthorizedMember
	EventLinkMicMethod
	EventLinkMicBattle
	EventLinkMicArmies
	EventLinkMessage
	EventLinkLayer
	EventLinkMicLayoutState
	EventGiftPanelUpdate
	EventInRoomBanner
	EventGuide

	// extended
	EventEmoteChat
	EventQuestionNew
	EventSubNotify
	EventBarrage
	EventHourlyRank
	EventMsgDetect
	EventLinkMicFanTicket
	EventRoomVerify
	EventOecLiveShopping
	EventGiftBroadcast
	EventRankText
	EventGiftDynamicRestriction
	EventViewerPicksUpdate

	// secondary
	EventSystemMessage
	EventLiveGameIntro
	EventAccessControl
	EventAccessRecall
	EventAlertBoxAuditResult
	EventBindingGift
	EventBoostCard
	EventBottomMessage
	EventGameRankNotify
	EventGiftPrompt
	EventLinkState
	EventLinkMicBattlePunishFinish
	EventLinkmicBattleTask
	EventMarqueeAnnouncement
	EventNotice
	EventNotify
	EventPartnershipDropsUpdate
	EventPartnershipGameOffline
	EventPartnershipPunish
	EventPerception
	EventSpeaker
	EventSubCapsule
	EventSubPinEvent
	EventSubscriptionNotify
	EventToast

	// catch-all
	EventUnknown
)

type UnknownEvent

type UnknownEvent struct {
	Method  string
	Payload []byte
}

UnknownEvent wraps an unrecognized message type with raw payload.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL