Skip to content

Help With Splitting #216

@mnafricano

Description

@mnafricano

I have some code and it says:

if (data.text.split(" ")[0] == "mail") {
    var mailto = data.text.split(" ")[1];
    var message = data.text.split(" ")[2];
    bot.getUserId(mailto, function (data) {
        mailto = data.userid;
        bot.pm(message, mailto);
    });
}

Now, when I run this, it only sends the first word of my message, how can I make this say everything that is equal to and greater than 2? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions