summaryrefslogtreecommitdiff
path: root/DiscoBot/Commands/FileHandler.cs
blob: 4f8a785f7d5b02397c93fc06507e85b5e27de233 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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");
        }
    }
}