EE Bot Basic Chat Command

//OK go into your public variables, and put:

    public string str;

//Now, go to case "say" (and put this stuff):

    case "say":
    this.str = m.GetString(1).ToLower();
    //Our command here | You can do .StartsWith, .Contains, .EndsWith, or simply ==, depending on which one you need
    if (str.StartsWith("!help"))
    {
        // assuming our "Connection" is con
        con.Send("say", "[Bot] Commands go here!");
    }
    return;

the basics are:

if (str.StartsWith("commandhere"))
{
    con.Send("say", "Response here");
}

No comments:

Post a Comment