diff options
author | natrixaeria <janng@gmx.de> | 2019-05-19 17:40:59 +0200 |
---|---|---|
committer | natrixaeria <janng@gmx.de> | 2019-05-19 17:40:59 +0200 |
commit | 1509b5ef3d7e9e71d9294e234ec0e39f2d831998 (patch) | |
tree | 78300ffff230958101b422a4e6026925b287822f /DiscoBot/Commands/FileHandler.cs | |
parent | c3bb858bb54dc8c64bbd48054c2c58dc0073f09c (diff) | |
parent | c4d046858e0822b7c2c540ac2368b2c0e88e7a26 (diff) |
Merge branch 'scribble' of https://github.com/TrueDoctor/DiscoBot into scribble
Diffstat (limited to 'DiscoBot/Commands/FileHandler.cs')
-rw-r--r-- | DiscoBot/Commands/FileHandler.cs | 38 |
1 files changed, 9 insertions, 29 deletions
diff --git a/DiscoBot/Commands/FileHandler.cs b/DiscoBot/Commands/FileHandler.cs index 0b87b15..17928c8 100644 --- a/DiscoBot/Commands/FileHandler.cs +++ b/DiscoBot/Commands/FileHandler.cs @@ -1,45 +1,25 @@ -namespace DiscoBot.Commands -{ - using System; - using System.Linq; - using System.Net; - using System.Threading.Tasks; - - using DiscoBot.DSA_Game; - using DiscoBot.DSA_Game.Characters; - - using Discord.Commands; - using DSALib; +using System; +using System.Linq; +using System.Threading.Tasks; +using Discord.Commands; +namespace DiscoBot.Commands +{ public class FileHandler : ModuleBase { //[Command("send"), Summary("fügt Helden hinzu")] public async Task AddChar() { - var msg = this.Context.Message; - if (msg.Attachments == null) - { - throw new ArgumentException("Es wurde keine Datei angehängt"); - } + var msg = Context.Message; + if (msg.Attachments == null) throw new ArgumentException("Es wurde keine Datei angehängt"); var attachments = msg.Attachments.ToList(); if (!attachments.Any(x => x.Filename.EndsWith(".xml"))) - { throw new ArgumentException("Es wurde kein xml Held mitgeschickt"); - } foreach (var attachment in attachments.Where(x => x.Filename.EndsWith(".xml"))) - { - using (var client = new WebClient()) - { - client.DownloadFile(attachment.Url, "helden\\" + attachment.Filename); - } - - Dsa.Chars.Add(new Character("helden\\" + attachment.Filename)); - (Dsa.Chars.Last() as Character)?.Talente.Select(x => new Talent(x.Name, x.Probe, 0)) - .Where(c => !Dsa.Talente.Exists(v => v.Name.Equals(c.Name))).ToList().ForEach(v => Dsa.Talente.Add(v)); - } + throw new NotImplementedException("send File to Server"); } } }
\ No newline at end of file |