frankvHoof93 / TikTokLiveSharp

Port of TikTok live library for C#
https://vanhoof.dev
Other
139 stars 27 forks source link

Gifting Amount[QUESTION] #55

Closed joepryan24 closed 7 months ago

joepryan24 commented 7 months ago

Hello,

gift.Gift.DiamondAmount prints the value of the gift given. I am trying to figure out how to print the complete amount. For example if a combo is gifted in 1 coins, it still prints one coin instead of the full amount after the combo.

I have read a previous thread on here however it did not answer my question on how I can get the final combo amount and print it to string.

If someone could point me in the right direction, I would be very greatful.

frankvHoof93 commented 7 months ago

gift.Gift (TikTokLiveSharp.Events.Objects.Gift) provides the meta-data for the gift-type that was in the TikTokGift-Event. If you want the total DiamondCost for all gifts in the streak, you can simply take the Amount in the TikTokGift, and multiply that with the DiamondCost for 1 instance of that gift.

int totalCost = gift.Amount * gift.Gift.DiamondCost;