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.

command.cs 657 B

12345678910
  1. //Since we have setup our CommandChar to be '~', we will run this command by typing ~greet
  2. commands.CreateCommand("greet") //create command greet
  3. .Alias(new string[] { "gr", "hi" }) //add 2 aliases, so it can be run with ~gr and ~hi
  4. .Description("Greets a person.") //add description, it will be shown when ~help is used
  5. .Parameter("GreetedPerson", ParameterType.Required) //as an argument, we have a person we want to greet
  6. .Do(async e =>
  7. {
  8. await client.SendMessage(e.Channel, e.User.Name + " greets " + e.GetArg("GreetedPerson"));
  9. //sends a message to channel with the given text
  10. });