diff options
Diffstat (limited to 'DiscoBot/Commands')
-rw-r--r-- | DiscoBot/Commands/Gm.cs | 26 | ||||
-rw-r--r-- | DiscoBot/Commands/MiscCommands.cs | 10 |
2 files changed, 22 insertions, 14 deletions
diff --git a/DiscoBot/Commands/Gm.cs b/DiscoBot/Commands/Gm.cs index 1ff0286..540682c 100644 --- a/DiscoBot/Commands/Gm.cs +++ b/DiscoBot/Commands/Gm.cs @@ -1,4 +1,6 @@ -namespace DiscoBot.Commands +using DiscoBot.DSA_Game.Characters; + +namespace DiscoBot.Commands { using System.Linq; using System.Threading.Tasks; @@ -79,14 +81,16 @@ [Command("gm"), Summary("Führt eine probe aus")] [Alias("GM", "as", "As", "als")] - public async Task ProbeAsync([Summary("Fernkampfwaffe")] string name, string command, string waffe = "", int erschwernis = 0) + public async Task ProbeAsync([Summary("Fernkampfwaffe")] string name, string command, string cmdText = "", int modifier = 0) { - Permissions.Test(this.Context, "Meister"); + if (!Permissions.Test(this.Context, "Meister")) return; command = command.ToLower(); string res; string temp = string.Empty; + ICharacter cha = Dsa.Chars.OrderBy(x => + SpellCorrect.CompareEasy(name, x.Name)).First(); switch (command) { case "le": @@ -95,12 +99,12 @@ LE le = new LE(); temp = string.Empty; - if (erschwernis != 0) + if (modifier != 0) { - temp = erschwernis.ToString(); + temp = modifier.ToString(); } - res = Dsa.Chars.OrderBy(x => SpellCorrect.CompareEasy(Dsa.Session.Relation[this.Context.User.Username], x.Name)).First().get_LE_Text(waffe.Trim() + temp); + res = cha.get_LE_Text(cmdText.Trim() + temp); break; case "ae": @@ -109,16 +113,16 @@ AE ae = new AE(); temp = string.Empty; - if (erschwernis != 0) + if (modifier != 0) { - temp = erschwernis.ToString(); + temp = modifier.ToString(); } - res = Dsa.Chars.OrderBy(x => SpellCorrect.CompareEasy(Dsa.Session.Relation[this.Context.User.Username], x.Name)).First().get_AE_Text(waffe.Trim() + temp); + res = cha.get_AE_Text(cmdText.Trim() + temp); break; default: - res = this.Test(name, command, waffe, erschwernis); + res = this.Test(name, command, cmdText, modifier); break; } @@ -134,7 +138,7 @@ private string Test(string name, string command, string waffe, int erschwernis = 0) { string res; - switch (command) + switch (command.ToLower()) { case "f": case "fern": diff --git a/DiscoBot/Commands/MiscCommands.cs b/DiscoBot/Commands/MiscCommands.cs index 4a91081..bef39c6 100644 --- a/DiscoBot/Commands/MiscCommands.cs +++ b/DiscoBot/Commands/MiscCommands.cs @@ -7,6 +7,7 @@ using DiscoBot.Auxiliary; using Discord; using Discord.Commands; +using Discord.WebSocket; namespace DiscoBot.Commands { @@ -34,6 +35,7 @@ namespace DiscoBot.Commands [Alias("R", "Roll", "roll", "Würfle")] public Task RollAsync([Remainder, Summary("Weapon")] string roll) { + //return this.ReplyAsync("```xl\n" + new Auxiliary.Calculator.StringSolver(roll).Solve() + "\n```"); return this.ReplyAsync("```xl\n" + RandomMisc.Roll(roll) + "\n```"); } @@ -59,10 +61,12 @@ namespace DiscoBot.Commands [Command("liebe"), Summary("Echos a message.")] [Alias("Liebe", "<3", "love")] - public Task LoveAsync() + public async Task LoveAsync() { - return this.ReplyAsync(":heart: :heart: :heart: Verteilt die Liebe!"); - //return this.ReplyAsync("!say !liebe"); + Random rand = new Random(); + var user = Context.Channel.GetUsersAsync().ToList().Result.ToList().First().Where(x=>x.Status!= UserStatus.Offline).OrderBy(x => rand.Next()).First(); + await this.ReplyAsync(":heart: :heart: :heart: Verteilt die Liebe! :heart: :heart: :heart: \n Besondere Liebe geht an " + user.Username); + //await this.ReplyAsync("!liebe"); } [Command("maul"), Summary("Echos a message.")] |