Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Message Build(String Raw)
- {
- Message m = new Message();
- TokenParser parser = new TokenParser(Raw);
- if (parser.StartsWith(':'))
- {
- parser.Skip(1);
- m.Source = parser.ConsumeTo(' ');
- }
- m.Command = parser.ConsumeTo(' ');
- if (parser.Contains(' '))
- {
- m.Arguments = parser.SplitToOrEnd(new char[] { ' ' }, ':');
- }
- if (!parser.Consumed)
- {
- m.Trailing = parser.ConsumeAll();
- }
- return m;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement