diff options
Diffstat (limited to 'DiscordBot/Commands/FileHandler.cs')
-rw-r--r-- | DiscordBot/Commands/FileHandler.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/DiscordBot/Commands/FileHandler.cs b/DiscordBot/Commands/FileHandler.cs new file mode 100644 index 0000000..e3cd82d --- /dev/null +++ b/DiscordBot/Commands/FileHandler.cs @@ -0,0 +1,24 @@ +using System; +using System.Linq; +using Discord.Commands; + +namespace DiscordBot.Commands +{ + public class FileHandler : ModuleBase + { + //[Command("send"), Summary("fügt Helden hinzu")] + public void AddChar() + { + 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"))) + throw new NotImplementedException("send File to Server"); + } + } +}
\ No newline at end of file |