Jump to content
McKay Development

Toxic

Member
  • Posts

    4
  • Joined

  • Last visited

Posts posted by Toxic

  1.  

    if(steamID == '76561197.....' || steamID == '76561.....'){

     

     

    In case if you want the bot accept user command and admin command, you can try this example, or using switch-case:

    var admin = "76561..."; //this is admin Steam ID
    
    client.on('friendMessage', function (steamID, message) {
    	if((steamID == admin) && (message== "!command1")){
    		client.chatMessage(steamID, 'admin command 1');
    	}
            else if((steamID == admin) && (message== "!command2")){
    		client.chatMessage(steamID, 'admin command 2');
    	}
            else if(message== "!user1"){
    		client.chatMessage(steamID, 'user command 1');
    	}
            else if(message== "!help"){
    		client.chatMessage(steamID, '!help command');
    	}
            else {
    		client.chatMessage(steamID, 'command not found, use !help');
    	}
    });
    

    Thanks works perfectly now

  2. I need some help with my bot.. so here is my problem..

     

    I tried making an if statement like this: 

    client.on('friendMessage', function (steamID, message) {
    	if(steamID == '765611......'){
    		client.chatMessage(steamID, 'Working...');
    	} else {
    		client.chatMessage(steamID, 'You are not my master!');
    	}
    });
    

    But everytime i send the bot something it sends "Working..." but i want it to only respond with a command like !help or !test

     

    Any help or suggestions would be helpful.

×
×
  • Create New...