summaryrefslogtreecommitdiff
path: root/DiscoBot/Commands/FileHandler.cs
diff options
context:
space:
mode:
authorDennis Kobert <d-kobert@web.de>2019-05-19 16:03:38 +0200
committerDennis Kobert <d-kobert@web.de>2019-05-19 16:03:38 +0200
commitf89f308c525e9deebc6d2cf6416e27dfe1a299dc (patch)
tree7097ef871ead0245efda696198443eab8e443d3a /DiscoBot/Commands/FileHandler.cs
parentf3983341be939235c1a6cd522b3bb5cc318a6d1a (diff)
Cleanup DiscoBot Project
Diffstat (limited to 'DiscoBot/Commands/FileHandler.cs')
-rw-r--r--DiscoBot/Commands/FileHandler.cs38
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