You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Remainder.cs 537 B

12345678910111213141516171819
  1. // Input:
  2. // !echo Coffee Cake
  3. // Output:
  4. // Coffee Cake
  5. [Command("echo")]
  6. public Task EchoRemainderAsync([Remainder]string text) => ReplyAsync(text);
  7. // Output:
  8. // CommandError.BadArgCount
  9. [Command("echo-hassle")]
  10. public Task EchoAsync(string text) => ReplyAsync(text);
  11. // The message would be seen as having 5 parameters, while the method
  12. // only accepts one. Wrapping the message in quotes solves this.
  13. // This way, the system knows the entire message is to be parsed as a
  14. // single String.
  15. // e.g.
  16. // !echo "Coffee Cake"