Creating Split Messages in Follower Alert?

PhantomBot Version: 3.0.0
OS Version: Mac OS X 10.13.4 (x86_64)
Java Version: Java 1.8.0_211
Browser and Version (for Panel Support): not for panel support
Stock PhantomBot: Yes

Let us know what help you need:

Hello, Not sure if posting under correct section, but i did not want to post for feature request as im just asking for recommendation on how to write the correct code to make split message for the Follow Alert, similar to the request in
Multiple Sub responses?
I tried to edit the response provided here
Multiple Sub responses?
but i was unable to make it work correctly so i reverted my handlers back to stock so they are not edited.

If you can please help with the code i need to make Split Message responses available for my follower alerts i would greatly appreciate it.

What i would like it to do is when someone follows the alert would trigger and send multiple messages
#1 - Thank you for the follow (name)
#2 - !socials
#3 - !youtube

Thank you for assistance

Hi,

for split messages in follow alerts, you can edit the file “scripts/handlers/followHandler.js”.

Starting at line 52 there is function named “runFollows”. To get split messages, replace this function with this version:

/*
 * @function runFollows
 */
function runFollows() {
    if (!followQueue.isEmpty() && (lastFollow + (followDelay * 1e3)) < $.systemTime()) {
        var followMessage = followQueue.poll();
        if (followMessage.match('\n')) {
            var splitMessage = followMessage.split('\n');
            for (var i = 0; i < splitMessage.length && i <= 4; i++) {
                $.say(splitMessage[i]);
            }
        } else {
            $.say(followMessage);
        }
        lastFollow = $.systemTime();
    }
}
1 Like

Thank you for responding, I’ll test that out as soon as I’m at my computer and will mark if resolved or if i have any issues.

that did solve my issue, once again thank you!!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.