Add files via upload

This commit is contained in:
Rodrigo Emanuel
2025-04-20 09:16:23 -03:00
committed by GitHub
parent 04dd7b626f
commit 4dd3fad733
16 changed files with 3349 additions and 0 deletions

42
js/streamlabs/module.js Normal file
View File

@@ -0,0 +1,42 @@
const showStreamlabsDonations = getURLParam("showStreamlabsDonations", true);
const streamLabsHandlers = {
'Streamlabs.Donation': (response) => {
console.debug(response.data);
if (showStreamlabsDonations == false)
return;
streamLabsEventMessage(response.data);
},
};
for (const [event, handler] of Object.entries(streamLabsHandlers)) {
streamerBotClient.on(event, handler);
}
async function streamLabsEventMessage(data) {
const {
from: userName,
formattedAmount: moneyFromUser,
currency: currencyFromUser,
message: messageFromUser,
} = data;
const userID = createRandomString(40);
const messageID = createRandomString(40);
const [avatar, message] = await Promise.all([
'',
currentLang.streamlabs.tip({
money : formatCurrency(moneyFromUser,currencyFromUser),
message : messageFromUser
})
]);
const classes = 'streamlabs';
const messageData = {
classes: classes,
avatar,
badges: '',
userName,
color: '#FFF',
message,
reply: '',
};
addEventToChat(userID, messageID, 'dollar-sign', messageData);
}