diff options
author | Kobert-P <kassiaK@yahoo.de> | 2018-06-07 11:21:55 +0200 |
---|---|---|
committer | Kobert-P <kassiaK@yahoo.de> | 2018-06-07 11:21:55 +0200 |
commit | 5b87516befe2e4fd0d2f4b372747836d2abf0c8c (patch) | |
tree | 3287f86d862a26b401992bdf9eb2752c8bc517b3 /DiscoBot/Commands/Gm.cs | |
parent | a8ec8940142303504f51c99384c6f86ee8fd7b2d (diff) |
Multiline help description
Diffstat (limited to 'DiscoBot/Commands/Gm.cs')
-rw-r--r-- | DiscoBot/Commands/Gm.cs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/DiscoBot/Commands/Gm.cs b/DiscoBot/Commands/Gm.cs index 57e985b..b0d9def 100644 --- a/DiscoBot/Commands/Gm.cs +++ b/DiscoBot/Commands/Gm.cs @@ -17,7 +17,15 @@ { string res; string name; - if ((givenName[0].ToLower().Equals("bin") || givenName[0].ToLower().Equals("am")) && givenName.Length > 1) + + if (givenName.Length == 0) + { + res = " \nDu bist " + Dsa.Relation[this.Context.User.Username] + "!\n \n"; + + return this.ReplyAsync("```xl\n" + res + "\n```"); + } + + if (givenName.Length > 1 && (givenName[0].ToLower().Equals("bin") || givenName[0].ToLower().Equals("am")) ) { name = givenName.Skip(1).Aggregate((s, c) => s + c); // (Skip(1)) don't use the first element; Aggregate: take source s and do operation s = s+c for all elements } @@ -28,8 +36,12 @@ var character = Dsa.Chars.OrderBy(x => SpellCorrect.CompareEasy(name, x.Name)).First(); // usage of compareEasy - Dsa.Relation[this.Context.User.Username] = character.Name; - res = " \nWillkommen " + character.Name + "!\n \n"; + + + + Dsa.Relation[this.Context.User.Username] = character.Name; + res = " \nWillkommen " + character.Name + "!\n \n"; + return this.ReplyAsync("```xl\n" + res + "\n```"); } |