Advertisement
EESweetieBot

Private Message Commands

Sep 9th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. case "write":
  2.                     {
  3.                         string title = m.GetString(0); // If  you want to, use this :P
  4.                         string text = m.GetString(1); // Actual pm message
  5.                         string player = title.Split(' ')[1]; // Player who pm'd you
  6.                         if(title.Contains("> you"))
  7.                         {
  8.                             if(Regex.IsMatch(text.Substring(0, 1), @"\.|\!|\~|\$|\:"))
  9.                             {
  10.                                 var prefix = text.Substring(0, 1);
  11.                                 var cmd = text.ToLower().Split(' ');
  12.                                
  13.                                 //TODO: Add commands using "if(cmd[0].Equals(prefix + "command")) {}"
  14.  
  15.                             }
  16.                         }
  17.                     }
  18.                     break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement