With my discord bot in c#, i tried to send an help message of command if there is 0 paramater sent. Command: !onserver >> Send help message
Thank you for your help.
commands.CreateCommand("onserver")
.Parameter("server", ParameterType.Required)
.Hide()
.Do(async (e) =>
{
int server = Convert.ToInt32(e.GetArg("server"));
if (e.GetArg("server").Length == 0) //Show command help
{
await e.Channel.SendMessage("Help message blablabla");
}
if (server > 0)
{
await e.Channel.SendMessage($"Utilisateur lanceur: {e.Message.User}");
await e.Channel.SendMessage($"Serveur choisi: {server}");
}
});
try:
int server = Convert.ToInt32(e.Args[0]);