예제 #1
0
 public void Execute(Message message, string onoff, int temp, ACPower level)
 {
     if (onoff.Equals("on") || onoff.Equals("off"))
     {
         LastUsedAttr = new ACAttr(onoff.Equals("on"), temp, level);
         if (ACManager.SendAC(LastUsedAttr.temp, LastUsedAttr.power, LastUsedAttr.level))
         {
             message.Reply("Transmitted!");
         }
         else
         {
             message.Reply("An error occurred while transmitting!");
         }
     }
     else
     {
         message.Reply("Usage: /ac [on/off] {temp} {low/med/high/auto/turbo}");
     }
 }
예제 #2
0
 public void Execute(Message message, string onoff)
 {
     if (onoff.Equals("on") || onoff.Equals("off"))
     {
         ACAttr att = new ACAttr(LastUsedAttr, onoff.Equals("on"));
         if (ACManager.SendAC(att.temp, att.power, att.level))
         {
             message.Reply("Transmitted!");
         }
         else
         {
             message.Reply("An error occurred while transmitting!");
         }
     }
     else
     {
         message.Reply("Usage: /ac [on/off]");
     }
 }