Skip to content

Commit

Permalink
Update Rumble types
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencrader committed Jan 6, 2025
1 parent efe110c commit 4be9444
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions src/types/rumble-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,25 @@ export type RumbleNotification = {
text: string
}

export type RumbleGiftPurchaseNotification = {
/**
* Type of gift
*/
gift_type: string
/**
* Number of gifts sent
*/
total_gifts: number
/**
* Id of the creator the gift is for (the streamer)
*/
creator_user_id: number
/**
* Channel for the gift
*/
creator_channel_id?: string
}

/**
*
*/
Expand All @@ -80,6 +99,10 @@ export type RumbleChannel = {
* Username for channel
*/
username: string
/**
* Optional path to channel image
*/
"image.1"?: string
}

/**
Expand All @@ -100,12 +123,18 @@ export type RumbleMessage = {
user_id: string
/**
* Text of message
*
* Gifted subscription has empty text
*/
text: string
/**
* Array of message blocks
*/
blocks: Array<RumbleBlock>
/**
* Channel chat is from
*/
channel_id: number
/**
* Optional paid Rant information
*/
Expand All @@ -114,6 +143,7 @@ export type RumbleMessage = {
* Optional notification information (ex: monthly subscriber)
*/
notification?: RumbleNotification
gift_purchase_notification?: RumbleGiftPurchaseNotification
}

/**
Expand Down Expand Up @@ -259,6 +289,26 @@ export type RumbleSubscription = {
enable: boolean
}

export type RumbleGift = {
/**
* Id of gift level
*/
id: string
/**
* Amount of gift in cents (NOTE: doesn't align with what the user pays)
*/
amount_cents: number
/**
* Number of subscriptions that will be gifted
*/
total_gifts: number
}

export type RumbleGifts = {
type: string
products: RumbleGift[]
}

/**
* Rumble config object
*/
Expand All @@ -279,6 +329,10 @@ export type RumbleConfig = {
* Subscription data
*/
subscription: RumbleSubscription
/**
* Gift information
*/
gifts: RumbleGifts
}

/**
Expand Down Expand Up @@ -311,6 +365,14 @@ export type RumbleInitData = RumbleDataBase & {
* The Rumble chat configuration data
*/
config: RumbleConfig
/**
* Unsure what this is or the correct type. Just know it can be null
*/
ad_read?: boolean
/**
* Indicates user is a moderator of the channel?
*/
can_moderate: boolean
}

/**
Expand Down

0 comments on commit 4be9444

Please sign in to comment.