cleaned up functions

This commit is contained in:
DeSqBlocki
2025-02-08 15:01:26 +01:00
parent 0c6deae544
commit 7a87899bd7
+34 -14
View File
@@ -21,7 +21,8 @@ module.exports = {
} }
async function sendPositivity() { async function sendPositivity() {
// Function sends a random string of predetermined positivity, Donothon Top Donator Reward // Function sends a random string of predetermined positivity, Donothon Top Donator Reward
let positive_Messages = ["You are so very worthy of all the love and support that may come your way.", let positive_Messages = [
"You are so very worthy of all the love and support that may come your way.",
"There are many things which draw us together. In this time and place, that lovely subject is you, Hel.", "There are many things which draw us together. In this time and place, that lovely subject is you, Hel.",
"The happiness and joy you add to the world is worth more than most anything.", "The happiness and joy you add to the world is worth more than most anything.",
"You deserve every warm laugh, bright smile, and all the genuine kindness given to you.", "You deserve every warm laugh, bright smile, and all the genuine kindness given to you.",
@@ -33,30 +34,49 @@ module.exports = {
"Every day you give your best and that is so admirable. Don't let anyone tell you otherwise.", "Every day you give your best and that is so admirable. Don't let anyone tell you otherwise.",
"Your light is like that of the full moon, brightening our lives even in our darkest moments.", "Your light is like that of the full moon, brightening our lives even in our darkest moments.",
"It's okay to take a moment to catch your breath. Even machines require maintenance from time to time.", "It's okay to take a moment to catch your breath. Even machines require maintenance from time to time.",
"Watching you succeed and achieve your heart's desires gives me so much motivation and I am very grateful for it."] "Watching you succeed and achieve your heart's desires gives me so much motivation and I am very grateful for it."
]
let rdm = Math.floor(Math.random() * positive_Messages.length) let rdm = Math.floor(Math.random() * positive_Messages.length)
return tClient.say(channel, positive_Messages[rdm]) return tClient.say(channel, positive_Messages[rdm])
} }
async function sendDonationAd() { async function sendDonationAd() {
// Function to send static donate ad // Function to send static donate ad
const links = ["https://bit.ly/heltwittergoals", "https://bit.ly/donatetohel", "http://bit.ly/donothon_goals"] const links = [
tClient.say(channel, "Hel is currently celebrating her birthday with a donathon!") "https://bit.ly/heltwittergoals",
tClient.say(channel, `You can see goals and incentives here: ${links[0]}`) "https://bit.ly/donatetohel",
tClient.say(channel, `You can donate here: ${links[1]}`) "http://bit.ly/donothon_goals"
tClient.say(channel, `Terms, conditions, rules and how rewards work are found here: ${links[2]}`) ];
tClient.say(channel, `All donations and gifts are greatly appreciated, but please do so responsibly!`)
const messages = [
"Hel is currently celebrating her birthday with a donathon!",
`You can see goals and incentives here: ${links[0]}`,
`You can donate here: ${links[1]}`,
`Terms, conditions, rules and how rewards work are found here: ${links[2]}`,
"All donations and gifts are greatly appreciated, but please do so responsibly!"
];
for (const message of messages) {
await tClient.say(channel, message);
} }
}
if (self) { return } if (self) { return }
if (knownBots.has(userstate.username)) { return } if (knownBots.has(userstate.username)) { return }
if (message.toLowerCase().includes('caw')) { const reactTriggers = {
tClient.say(channel, 'CAW!') caw: 'CAW!',
} else if (message.toLowerCase().includes('kweh')) { kaw: 'KAW!',
tClient.say(channel, 'KWEH!') kweh: 'KWEH!'
} else if (message.toLowerCase().includes('kaw')) { }
tClient.say(channel, 'KAW!')
const reactRegex = /(caw|kweh|kaw)/i // Non-Strict Trigger
// const reactRegex = /\b(caw|kaw|kweh)\b/i; // Strict Trigger
if (reactRegex.test(message)) {
const match = message.match(reactRegex)[0].toLowerCase();
tClient.say(channel, reactTriggers[match]);
} }