Add files via upload
This commit is contained in:
BIN
images/3k7a2BA.png
Normal file
BIN
images/3k7a2BA.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.2 KiB |
@@ -313,6 +313,6 @@
|
|||||||
|
|
||||||
|
|
||||||
<script src="https://unpkg.com/@streamerbot/client/dist/streamerbot-client.js"></script>
|
<script src="https://unpkg.com/@streamerbot/client/dist/streamerbot-client.js"></script>
|
||||||
<script src="js/settings.js?v=0.0.1"></script>
|
<script src="js/settings.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
125
js/app-mockup.js
125
js/app-mockup.js
@@ -219,6 +219,10 @@ function generateMockEvent() {
|
|||||||
|
|
||||||
'patreon-membership', 'tipeeestream-tip',
|
'patreon-membership', 'tipeeestream-tip',
|
||||||
|
|
||||||
|
'kofi-donation', 'kofi-sub', 'kofi-resub', 'kofi-order',
|
||||||
|
|
||||||
|
'fourthwall-donation', 'fourthwall-sub', 'fourthwall-order',
|
||||||
|
|
||||||
'streamlabs-tip', 'streamelements-tip',
|
'streamlabs-tip', 'streamelements-tip',
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -770,6 +774,127 @@ function generateMockEvent() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
case 'kofi-donation' :
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
from: user.name,
|
||||||
|
amount: Math.floor(Math.random() * 2000) + 1,
|
||||||
|
currency: 'USD',
|
||||||
|
message: messagetext
|
||||||
|
};
|
||||||
|
|
||||||
|
kofiDonationMessage(data);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
case 'kofi-sub' :
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
from: user.name,
|
||||||
|
amount: Math.floor(Math.random() * 2000) + 1,
|
||||||
|
currency: 'USD',
|
||||||
|
message: messagetext
|
||||||
|
};
|
||||||
|
|
||||||
|
kofiSubMessage(data);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'kofi-resub' :
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
from: user.name,
|
||||||
|
amount: Math.floor(Math.random() * 2000) + 1,
|
||||||
|
currency: 'USD',
|
||||||
|
tier: parseInt(Math.floor(Math.random() * 3) + 1),
|
||||||
|
message: messagetext
|
||||||
|
};
|
||||||
|
|
||||||
|
kofiReSubMessage(data);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'kofi-order' :
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
from: user.name,
|
||||||
|
amount: Math.floor(Math.random() * 200) + 1,
|
||||||
|
items: badgeschosen,
|
||||||
|
currency: 'USD',
|
||||||
|
message: messagetext
|
||||||
|
};
|
||||||
|
|
||||||
|
kofiOrderMessage(data);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
case 'fourthwall-donation' :
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
username: user.name,
|
||||||
|
amount: Math.floor(Math.random() * 2000) + 1,
|
||||||
|
currency: 'USD',
|
||||||
|
message: messagetext
|
||||||
|
};
|
||||||
|
|
||||||
|
fourthwallDonationMessage(data);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
case 'fourthwall-sub' :
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
nickname: user.name,
|
||||||
|
amount: Math.floor(Math.random() * 2000) + 1,
|
||||||
|
currency: 'USD'
|
||||||
|
};
|
||||||
|
|
||||||
|
fourthwallSubMessage(data);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
case 'fourthwall-order' :
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
username: user.name,
|
||||||
|
total: Math.floor(Math.random() * 200) + 1,
|
||||||
|
variants: [
|
||||||
|
{
|
||||||
|
name: 'Fake Product',
|
||||||
|
image: 'images/3k7a2BA.png'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
currency: 'USD',
|
||||||
|
statmessageus: messagetext
|
||||||
|
};
|
||||||
|
|
||||||
|
fourthwallOrderMessage(data);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
case 'streamlabs-tip' :
|
case 'streamlabs-tip' :
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
|
@@ -1,20 +1,53 @@
|
|||||||
const showShopifyOrders = getURLParam("showShopifyOrders", true);
|
const showFourthwallDonations = getURLParam("showFourthwallDonations", true);
|
||||||
|
|
||||||
const shopifyMessageHandlers = {
|
const showFourthwallOrders = getURLParam("showFourthwallOrders", true);
|
||||||
'Shopify.OrderPaid': (response) => {
|
const showFourthwallShowImage = getURLParam("showFourthwallShowImage", true);
|
||||||
console.debug('Shopify Order Paid', response.data);
|
const showFourthwallBigImage = getURLParam("showFourthwallBigImage", true);
|
||||||
//shopifyOrderPaidMessage(response.data);
|
|
||||||
|
const showFourthwallSubscriptions = getURLParam("showFourthwallSubscriptions", true);
|
||||||
|
|
||||||
|
const showFourthwallGiftPurchase = getURLParam("showFourthwallGiftPurchase", true);
|
||||||
|
const showFourthwallShowGiftImage = getURLParam("showFourthwallShowGiftImage", true);
|
||||||
|
const showFourthwallBigGiftImage = getURLParam("showFourthwallBigGiftImage", true);
|
||||||
|
|
||||||
|
const showFourthwallGiftDraw = getURLParam("showFourthwallGiftDraw", true);
|
||||||
|
const fourthWallGiftDrawCommand = getURLParam("fourthWallGiftDrawCommand", "!enter");
|
||||||
|
|
||||||
|
const fourthwallMessageHandlers = {
|
||||||
|
'Fourthwall.Donation': (response) => {
|
||||||
|
console.debug('Fourthwall Donation', response.data);
|
||||||
|
fourthwallDonationMessage(response.data);
|
||||||
|
},
|
||||||
|
'Fourthwall.OrderPlaced': (response) => {
|
||||||
|
console.debug('Fourthwall Order', response.data);
|
||||||
|
fourthwallOrderMessage(response.data);
|
||||||
|
},
|
||||||
|
'Fourthwall.SubscriptionPurchased': (response) => {
|
||||||
|
console.debug('Fourthwall Sub', response.data);
|
||||||
|
fourthwallSubMessage(response.data);
|
||||||
|
},
|
||||||
|
'Fourthwall.GiftPurchase': (response) => {
|
||||||
|
console.debug('Fourthwall Gift', response.data);
|
||||||
|
fourthwallGiftMessage(response.data);
|
||||||
|
},
|
||||||
|
'Fourthwall.GiftDrawStarted': (response) => {
|
||||||
|
console.debug('Fourthwall Gift Draw Start', response.data);
|
||||||
|
fourthwallGiftDrawStartMessage(response.data);
|
||||||
|
},
|
||||||
|
'Fourthwall.GiftDrawEnded': (response) => {
|
||||||
|
console.debug('Fourthwall Gift Draw Start', response.data);
|
||||||
|
fourthwallGiftDrawEndMessage(response.data);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
for (const [event, handler] of Object.entries(shopifyMessageHandlers)) {
|
for (const [event, handler] of Object.entries(fourthwallMessageHandlers)) {
|
||||||
streamerBotClient.on(event, handler);
|
streamerBotClient.on(event, handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async function shopifyOrderPaidMessage(data) {
|
async function fourthwallDonationMessage(data) {
|
||||||
|
|
||||||
if (showShopifyOrders == false) return;
|
if (showFourthwallDonations == false) return;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
username : userName,
|
username : userName,
|
||||||
@@ -181,7 +214,7 @@ async function fourthwallGiftMessage(data) {
|
|||||||
}),
|
}),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const classes = ['gift'];
|
const classes = ['order'];
|
||||||
if (showFourthwallBigGiftImage == true) {
|
if (showFourthwallBigGiftImage == true) {
|
||||||
classes.push('giantimage');
|
classes.push('giantimage');
|
||||||
}
|
}
|
||||||
@@ -210,6 +243,7 @@ async function fourthwallGiftDrawStartMessage(data) {
|
|||||||
durationSeconds
|
durationSeconds
|
||||||
} = data;
|
} = data;
|
||||||
|
|
||||||
|
var userName = '';
|
||||||
const userID = createRandomString(40);
|
const userID = createRandomString(40);
|
||||||
const messageID = createRandomString(40);
|
const messageID = createRandomString(40);
|
||||||
|
|
||||||
@@ -217,7 +251,8 @@ async function fourthwallGiftDrawStartMessage(data) {
|
|||||||
'',
|
'',
|
||||||
currentLang.fourthwall.drawstart({
|
currentLang.fourthwall.drawstart({
|
||||||
gift: itemName,
|
gift: itemName,
|
||||||
command: fourthWallGiftDrawCommand
|
command: fourthWallGiftDrawCommand,
|
||||||
|
time: durationSeconds
|
||||||
}),
|
}),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -240,18 +275,17 @@ async function fourthwallGiftDrawEndMessage(data) {
|
|||||||
if (showFourthwallGiftDraw == false) return;
|
if (showFourthwallGiftDraw == false) return;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: {
|
|
||||||
gifts
|
gifts
|
||||||
}
|
|
||||||
} = data;
|
} = data;
|
||||||
|
|
||||||
|
var userName = '';
|
||||||
const userID = createRandomString(40);
|
const userID = createRandomString(40);
|
||||||
const messageID = createRandomString(40);
|
const messageID = createRandomString(40);
|
||||||
|
|
||||||
const [avatar, message] = await Promise.all([
|
const [avatar, message] = await Promise.all([
|
||||||
'',
|
'',
|
||||||
currentLang.fourthwall.drawend({
|
currentLang.fourthwall.drawend({
|
||||||
winners: getWinnersList(gifts)
|
winners: await getWinnersList(gifts)
|
||||||
}),
|
}),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@@ -110,6 +110,8 @@ async function kofiReSubMessage(data) {
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
from : userName,
|
from : userName,
|
||||||
|
amount,
|
||||||
|
currency,
|
||||||
tier,
|
tier,
|
||||||
message: text
|
message: text
|
||||||
} = data;
|
} = data;
|
||||||
@@ -117,9 +119,12 @@ async function kofiReSubMessage(data) {
|
|||||||
const userID = createRandomString(40);
|
const userID = createRandomString(40);
|
||||||
const messageID = createRandomString(40);
|
const messageID = createRandomString(40);
|
||||||
|
|
||||||
|
var money = formatCurrency(amount,currency);
|
||||||
|
|
||||||
const [avatar, message] = await Promise.all([
|
const [avatar, message] = await Promise.all([
|
||||||
'',
|
'',
|
||||||
currentLang.kofi.resub({
|
currentLang.kofi.resub({
|
||||||
|
money: money,
|
||||||
tier: tier,
|
tier: tier,
|
||||||
message: text
|
message: text
|
||||||
}),
|
}),
|
||||||
@@ -147,7 +152,6 @@ async function kofiOrderMessage(data) {
|
|||||||
from : userName,
|
from : userName,
|
||||||
amount,
|
amount,
|
||||||
currency,
|
currency,
|
||||||
message: text,
|
|
||||||
items
|
items
|
||||||
} = data;
|
} = data;
|
||||||
|
|
||||||
|
@@ -106,8 +106,8 @@ const en = {
|
|||||||
|
|
||||||
kofi : {
|
kofi : {
|
||||||
donation : ({ money, message }) => ` donated 🪙 <strong>${money}</strong>${message ? '<br>'+message : ''}`,
|
donation : ({ money, message }) => ` donated 🪙 <strong>${money}</strong>${message ? '<br>'+message : ''}`,
|
||||||
sub : ({ money, tier, message }) => ` subscribed <strong>${money}</strong>${tier ? '(Tier '+tier+')' : ''}${message ? '<br>'+message : ''}`,
|
sub : ({ money, tier, message }) => ` subscribed <strong>(${money}) ${tier ? '(Tier '+tier+')' : ''}</strong>${message ? '<br>'+message : ''}`,
|
||||||
resub : ({ money, tier, message }) => ` subscribed <strong>${money}</strong>${tier ? '(Tier '+tier+')' : ''}${message ? '<br>'+message : ''}`,
|
resub : ({ money, tier, message }) => ` subscribed <strong>${money} ${tier ? '(Tier '+tier+')' : ''}</strong>${message ? '<br>'+message : ''}`,
|
||||||
order : ({ money, items }) => ` ordered <strong>${items} ${items == 1 ? 'item' : 'items'} (${money == 0 ? 'Free' : money})`,
|
order : ({ money, items }) => ` ordered <strong>${items} ${items == 1 ? 'item' : 'items'} (${money == 0 ? 'Free' : money})`,
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -149,13 +149,13 @@ const en = {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
drawstart : ({ gift, command }) => `
|
drawstart : ({ gift, command, time }) => `
|
||||||
<strong><i class="fa-solid fa-gift fa-beat"></i> Giveaway started!</strong>
|
<strong><i class="fa-solid fa-gift"></i> Giveaway started!</strong>
|
||||||
Type ${command} to have a chance to win <strong>${gift}</strong>`,
|
<br>Type <strong>${command}</strong> to have a chance to win <strong>${gift}</strong>. You have <strong>${time} seconds!</strong>`,
|
||||||
|
|
||||||
drawend : ({ winners }) => `
|
drawend : ({ winners }) => `
|
||||||
<strong>🎉 Giveaway Ended!</strong>
|
<strong>🎉 Giveaway Ended!</strong>
|
||||||
Congratulations <strong>${winners}</strong>`,
|
<br>Congratulations <strong>${winners}</strong>`,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user