diff options
author | uzvkl <dennis.kobert@student.kit.edu> | 2019-06-11 23:05:52 +0200 |
---|---|---|
committer | uzvkl <dennis.kobert@student.kit.edu> | 2019-06-11 23:05:52 +0200 |
commit | e6181c24124d97f2fbc932b8a68311e625463156 (patch) | |
tree | c1f097c344ca266b7941c9668590b0fd35c7870a /dsa/DiscoBot/Commands/FileHandler.cs | |
parent | 2490ad5d31fe2ac778ff9303776f0e91f47a2862 (diff) |
Move dsa related stuff to subfolder
Diffstat (limited to 'dsa/DiscoBot/Commands/FileHandler.cs')
-rw-r--r-- | dsa/DiscoBot/Commands/FileHandler.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/dsa/DiscoBot/Commands/FileHandler.cs b/dsa/DiscoBot/Commands/FileHandler.cs new file mode 100644 index 0000000..4f8a785 --- /dev/null +++ b/dsa/DiscoBot/Commands/FileHandler.cs @@ -0,0 +1,25 @@ +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 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 |