﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PCMRBot
{
    class GCUnbindCommand:IGroupCommand
    {
        int requiredPerms = 500;
        

        public List<ChatReply> RunGroupCommand(string[] args, SteamKit2.SteamFriends.ChatMsgCallback callback)
        {
            List<ChatReply> chatreply=new List<ChatReply>();
            if (args.Length < 1)
            {
                chatreply.Add(new ChatReply(callback.ChatterID, "This command requires an argument"));
                return chatreply;
            }
            try 
            {
                Program.groups[callback.ChatRoomID].commands.Remove(args[1]);
                chatreply.Add(new ChatReply(callback.ChatterID, string.Format("Unbound the trigger {0} successfully", args[1])));
     
            }
            catch (KeyNotFoundException)
            {
                chatreply.Add(new ChatReply(callback.ChatterID, string.Format("Couldn't find the trigger {0}, is it even bound?", args[1])));
            }
            return chatreply;
        }
        public int RequiredPermsForGroup
        {
            get
            {
                return requiredPerms;
            }
            set
            {
                requiredPerms = value;
            }
        }
    }
}
