public UserEventArgs(SlackUser user)
 {
     m_User = user;
 }
 public void RemoveRegisteredUser(SlackUser slackUser)
 {
     for (int i = 0; i < m_RegisteredUsers.Count; ++i)
     {
         if(m_RegisteredUsers[i].ID == slackUser.ID)
         {
             m_RegisteredUsers.RemoveAt(i);
             if (UserUnregistered != null)
                 UserUnregistered(this, new UserEventArgs(slackUser));
             return;
         }
     }
         throw new UserNotPresentException();
 }
        public void SendDirectMessage(SlackUser user, string message)
        {
            BotMessage botMessage = new BotMessage();
            botMessage.ChatHub = new SlackChatHub();
            botMessage.ChatHub.Type = SlackChatHubType.DM;
            botMessage.ChatHub.ID = user.ID;
            botMessage.ChatHub.Name = user.ID;
            botMessage.Text = message;

            m_Bot.Say(botMessage);
        }
 public void AddRegisteredUser(SlackUser slackUser)
 {
     if (m_RegisteredUsers.Where(p => slackUser.ID == p.ID).Count() == 0)
     {
         m_RegisteredUsers.Add(slackUser);
         if (UserRegistered != null)
             UserRegistered(this, new UserEventArgs(slackUser));
     }
     else
         throw new DuplicateUserException();
 }