// 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");
             }           

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.