buzzk 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chat.js +3 -12
- package/package.json +1 -1
package/lib/chat.js
CHANGED
|
@@ -18,13 +18,12 @@ class chzzkChatData {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
class chzzkDonationData {
|
|
21
|
-
constructor(type, amount, id, name,
|
|
21
|
+
constructor(type, amount, id, name, message, emojis) {
|
|
22
22
|
this.type = type;
|
|
23
23
|
this.amount = amount;
|
|
24
24
|
this.author = {
|
|
25
25
|
id: id,
|
|
26
|
-
name: name
|
|
27
|
-
hasMod: hasMod
|
|
26
|
+
name: name
|
|
28
27
|
};
|
|
29
28
|
this.message = message;
|
|
30
29
|
this.emojis = emojis;
|
|
@@ -126,15 +125,7 @@ class chzzkChat {
|
|
|
126
125
|
data = JSON.parse(data);
|
|
127
126
|
console.log(data);
|
|
128
127
|
|
|
129
|
-
let
|
|
130
|
-
if (data.profile || data.profile.badges) {
|
|
131
|
-
for (let o in data.profile.badges) {
|
|
132
|
-
if (data.profile.badges[o].imageUrl == "https://ssl.pstatic.net/static/nng/glive/icon/streamer.png") hasMod = true;
|
|
133
|
-
if (data.profile.badges[o].imageUrl == "https://ssl.pstatic.net/static/nng/glive/icon/manager.png") hasMod = true;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
let donationData = new chzzkDonationData(data.donationType, data.payAmount, data.donatorChannelId, data.donatorNickname, hasMod, data.donationText, data.emojis);
|
|
128
|
+
let donationData = new chzzkDonationData(data.donationType, data.payAmount, data.donatorChannelId, data.donatorNickname, data.donationText, data.emojis);
|
|
138
129
|
return this.#callbacks.donation(donationData);
|
|
139
130
|
});
|
|
140
131
|
|