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 548 B

1234567891011121314151617181920
  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 multiple parameters,
  12. // while the method only accepts one.
  13. // Wrapping the message in quotes solves this.
  14. // This way, the system knows the entire message is to be parsed as a
  15. // single String.
  16. // e.g.
  17. // !echo "Coffee Cake"