diff options
Diffstat (limited to 'DiscoBot/Auxiliary')
-rw-r--r-- | DiscoBot/Auxiliary/CommandInfo.cs | 5 | ||||
-rw-r--r-- | DiscoBot/Auxiliary/Extensions.cs | 32 |
2 files changed, 36 insertions, 1 deletions
diff --git a/DiscoBot/Auxiliary/CommandInfo.cs b/DiscoBot/Auxiliary/CommandInfo.cs index 90fbbc7..dfed417 100644 --- a/DiscoBot/Auxiliary/CommandInfo.cs +++ b/DiscoBot/Auxiliary/CommandInfo.cs @@ -8,10 +8,11 @@ namespace DiscoBot.Auxiliary { public struct CommandInfo { - public CommandInfo(string name, string[] description, string scope) + public CommandInfo(string name, string brief, string[] description, string scope) { this.Name = name; this.Scope = scope; + this.Brief = brief; this.Description = description; } @@ -19,6 +20,8 @@ namespace DiscoBot.Auxiliary public string Scope { get; } + public string Brief { get; } + public string[] Description { get; } public string GetDescription() diff --git a/DiscoBot/Auxiliary/Extensions.cs b/DiscoBot/Auxiliary/Extensions.cs new file mode 100644 index 0000000..a1d58fa --- /dev/null +++ b/DiscoBot/Auxiliary/Extensions.cs @@ -0,0 +1,32 @@ +namespace DiscoBot.Auxiliary +{ + public static class StringExtension + { + //This mehod extends string. It adds spaces until a fixed length is reached. + //If the original string is already longer, it is returner unmodified. + public static string AddSpaces(this string str, int length) + { + string temp = str; + for(int i = str.Length; i < length; i++) + { + temp += " "; + } + return temp; + } + + + + //This mehod extends string. + //It adds spaces at the HEAD of a string until a fixed length is reached. + //If the original string is already longer, it is returner unmodified. + public static string AddSpacesAtHead(this string str, int length) + { + string temp = ""; + for (int i = str.Length; i < length; i++) + { + temp += " "; + } + return temp + str; + } + } +} |