Commands which have no command strings should no longer throw an exception
This commit is contained in:
parent
bdc6974451
commit
038f17c3a4
@ -2,9 +2,6 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
using Discord.Commands;
|
||||
using NadekoBot.Services.Impl;
|
||||
|
||||
//todo what if it doesn't exist
|
||||
|
||||
namespace NadekoBot.Common.Attributes
|
||||
{
|
||||
public class Aliases : AliasAttribute
|
||||
|
@ -90,11 +90,6 @@ namespace NadekoBot.Services.Impl
|
||||
ulong.TryParse(data[nameof(ClientId)], out ulong clId);
|
||||
ClientId = clId;
|
||||
|
||||
//var scId = data[nameof(SoundCloudClientId)];
|
||||
//SoundCloudClientId = scId;
|
||||
//SoundCloudClientId = string.IsNullOrWhiteSpace(scId)
|
||||
// ?
|
||||
// : scId;
|
||||
CarbonKey = data[nameof(CarbonKey)];
|
||||
var dbSection = data.GetSection("db");
|
||||
Db = new DBConfig(string.IsNullOrWhiteSpace(dbSection["Type"])
|
||||
|
@ -131,6 +131,15 @@ namespace NadekoBot.Services.Impl
|
||||
public static CommandData LoadCommand(string key)
|
||||
{
|
||||
_commandData.TryGetValue(key, out var toReturn);
|
||||
|
||||
if (toReturn == null)
|
||||
return new CommandData
|
||||
{
|
||||
Cmd = key,
|
||||
Desc = key,
|
||||
Usage = key,
|
||||
};
|
||||
|
||||
return toReturn;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user