Added some help text
This commit is contained in:
parent
6af6bc9629
commit
1cb3f981d5
|
@ -12,6 +12,7 @@ namespace DeukBot4.MessageHandlers.CommandHandler
|
|||
public override string Name => "General";
|
||||
|
||||
[Command("info", PermissionLevel.Everyone)]
|
||||
[CommandHelp("Gives basic info on the bot", "Gives basic info on the bot")]
|
||||
public async Task Info(CommandRequest request)
|
||||
{
|
||||
var embed = new EmbedBuilder
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using DeukBot4.Database.ServerSettings;
|
||||
using DeukBot4.MessageHandlers.CommandHandler.RequestStructure;
|
||||
|
@ -106,6 +105,13 @@ namespace DeukBot4.MessageHandlers.CommandHandler
|
|||
[Command("mute", PermissionLevel.Helper)]
|
||||
[CommandParameters(ParameterMatcher.ParameterType.User, ParameterMatcher.ParameterType.Timespan)]
|
||||
[CommandParameters(ParameterMatcher.ParameterType.User, ParameterMatcher.ParameterType.Number)]
|
||||
[CommandHelp("Silences a user for a set amount of time",
|
||||
"Allows you to mute a user for a set amount of time.\n." +
|
||||
"Usage:\n" +
|
||||
"``mute {User Mention} {amount of minutes to silence}``\n" +
|
||||
"``mute {User ID} {amount of minutes to silence}``\n" +
|
||||
"``mute {User Mention} {Timespan (amount + time indicator: i.e. 5s, 10m, 3h, 1d)}``\n" +
|
||||
"``mute {User ID} {Timespan (amount + time indicator: i.e. 5s, 10m, 3h, 1d)}``\n")]
|
||||
[BlockUsageInPm]
|
||||
public async Task SilenceUser(CommandRequest request)
|
||||
{
|
||||
|
@ -140,16 +146,16 @@ namespace DeukBot4.MessageHandlers.CommandHandler
|
|||
await user.AddRoleAsync(silencedRole);
|
||||
|
||||
TimeSpan span;
|
||||
if (request.Parameters[1].Type == ParameterMatcher.ParameterType.Number)
|
||||
switch (request.Parameters[1].Type)
|
||||
{
|
||||
case ParameterMatcher.ParameterType.Number:
|
||||
var minutes = request.Parameters[1].AsInt();
|
||||
if (!minutes.HasValue)
|
||||
return;
|
||||
|
||||
span = TimeSpan.FromMinutes(minutes.Value);
|
||||
}
|
||||
else if (request.Parameters[1].Type == ParameterMatcher.ParameterType.Timespan)
|
||||
{
|
||||
break;
|
||||
case ParameterMatcher.ParameterType.Timespan:
|
||||
var sp = TimespanParser.Parse(request.Parameters[1].AsString());
|
||||
if (sp.HasValue)
|
||||
{
|
||||
|
@ -157,12 +163,11 @@ namespace DeukBot4.MessageHandlers.CommandHandler
|
|||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("this");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue