0
// teachers I have problems with this code, when I sent !q the bot sent all questions and all choices, Please I want someone edit this bot when I sent !q sends only the first question, and when I sent !q again sends the second question . notice * I want the same command and not different * 


if (data.ToLower().StartsWith("!q"))              
             {
                 con.SendRoomTextMessage(targetid, "What is the most expensive metals in the world?");
                 con.SendRoomTextMessage(targetid, "A - Gold \nB - iron \nC - radium .");
             }
             else if (data.ToLower().StartsWith("radium") == true)
             {
                 con.SendRoomTextMessage(targetid, "true answer :d");
             }
             else 
             {
                 con.SendRoomTextMessage(targetid, "False answer :p");
             }
if (data.ToLower().StartsWith("!q"))
             {
                 con.SendRoomTextMessage(targetid, "What is the universal language ?");
                 con.SendRoomTextMessage(targetid, "A - English \nB - Arabic \nC - French .");
             }
             else if (data.ToLower().StartsWith("engilsh") == true)
             {
                 con.SendRoomTextMessage(targetid, "true answer :d");
             }
             else 
             {
                 con.SendRoomTextMessage(targetid, "False answer :p");
             }           
2
Contributors
1
Reply
16
Views
3 Years
Discussion Span
Last Post by saad749
0

You have to update your condition. Currently you are checking on if the message is !q you are sending all the questions as the conditions are all true. You might like to use a Queue; and make this decisions a bit Dynamic than now.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.