Initial split of the modules
This commit is contained in:
24
NadekoBot.Core/Common/Attributes/Usage.cs
Normal file
24
NadekoBot.Core/Common/Attributes/Usage.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
using Discord.Commands;
|
||||
using NadekoBot.Services.Impl;
|
||||
using System.Linq;
|
||||
using Discord;
|
||||
|
||||
namespace NadekoBot.Common.Attributes
|
||||
{
|
||||
public class Usage : RemarksAttribute
|
||||
{
|
||||
public Usage([CallerMemberName] string memberName="") : base(Usage.GetUsage(memberName))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static string GetUsage(string memberName)
|
||||
{
|
||||
var usage = Localization.LoadCommand(memberName.ToLowerInvariant()).Usage;
|
||||
return string.Join(" or ", usage
|
||||
.Select(x => Format.Code(x)));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user