Okay, so all the code that needs to be edited from the messages sent at specific stream uptimes code to adapt it so it sends messages depending on the uptime’s minutes, is the Pastebin code:
const messages = {
'00': 'Message at 0 minute of stream uptime (ignoring hours value)',
'10': 'Message at 10 minutes of stream time (ignoring hours value)',
'25': 'Message at 25 minutes of stream time (ignoring hours value)',
'30': 'Message at 30 minutes of stream time (ignoring hours value)',
'55': 'Message at 55 minutes of stream time (ignoring hours value)'
};
const messagesTimestamps = Object.keys(messages);
const findData = (string, regex) => string.match(regex) || '0';
const keepAmount = string => string.split(' ').filter(e => isNaN(e) === false);
const normalizeAmount = string => string.padStart(2, '0');
const arrayToString = array => Array.isArray(array) ? array.join('') : array;
const minuteRegex = /\d+\s\bminute/;
const minuteData = arrayToString(findData(uptime, minuteRegex));
const minuteAmount = arrayToString(keepAmount(minuteData));
const normalizedMinuteAmount = normalizeAmount(minuteAmount);
let timestamp = [];
messagesTimestamps.forEach(e => {
if (Math.abs(parseInt(e) - parseInt(normalizedMinuteAmount)) <= 5) {
timestamp.push(e);
}
});
messages[timestamp[0]] || ' ';