separated commands from message event and added state control to them
This commit is contained in:
@@ -21,49 +21,7 @@ module.exports = {
|
||||
})
|
||||
}
|
||||
}
|
||||
async function sendPositivity() {
|
||||
// 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.",
|
||||
"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.",
|
||||
"You deserve every warm laugh, bright smile, and all the genuine kindness given to you.",
|
||||
"There are few things as precious as your time. Thank you for sharing with us.",
|
||||
"Your feelings are valid and you are not less than for having them.",
|
||||
"I've seen all the work you do and I'm so very proud of you.",
|
||||
"You are dearly cherished and I want to thank you for being so wonderfully you.",
|
||||
"You. Are. Worthy. Enough. And I will tell you as many times as it takes for you to believe it.",
|
||||
"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.",
|
||||
"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."
|
||||
]
|
||||
|
||||
let rdm = Math.floor(Math.random() * positive_Messages.length)
|
||||
return tClient.say(channel, positive_Messages[rdm])
|
||||
}
|
||||
async function sendDonationAd() {
|
||||
// Function to send static donate ad
|
||||
const links = [
|
||||
"https://bit.ly/heltwittergoals",
|
||||
"https://bit.ly/donatetohel",
|
||||
"http://bit.ly/donothon_goals"
|
||||
];
|
||||
|
||||
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 (knownBots.has(userstate.username)) { return }
|
||||
|
||||
@@ -87,16 +45,16 @@ module.exports = {
|
||||
const cmd = args[0]
|
||||
switch (cmd) {
|
||||
case "mode":
|
||||
if (userstate.badges.moderator != 1 && userstate.badges.broadcaster != 1) { break } // return stops all further operations, so you should just break out of switch
|
||||
let regex = /^(on|off)$/
|
||||
if (!args[1].match(regex)) { break }
|
||||
updateChatMode(await getIDByName(channel.substring(1)), args[1])
|
||||
dClient.emit('Command/mode', channel, userstate, message, self, args[1])
|
||||
break;
|
||||
case "donate":
|
||||
sendDonationAd()
|
||||
dClient.emit('Command/donate', channel, userstate, message, self)
|
||||
break;
|
||||
case "positivity":
|
||||
sendPositivity()
|
||||
dClient.emit('Command/positivity', channel, userstate, message, self)
|
||||
break;
|
||||
case "commands":
|
||||
dClient.emit('Command/commands', channel, userstate, message, self, args[1], args[2])
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user