Exemplo n.º 1
0
 public void Invite(SkypeCommander.Command cmd)
 {
     if (SkypeCommands.IsMod(cmd.SenderMember))
     {
         cmd.Chat.AddMembers(new UserCollection {
             SkypeCommands.GetUser(cmd.ArgumentsText)
         });
     }
 }
Exemplo n.º 2
0
        public void ListInactive(SkypeCommander.Command cmd)
        {
            int days = 0;

            int.TryParse(cmd.ArgumentsText, out days);

            if (days == 0)
            {
                days = 7;
            }

            var ulist = cmd.Chat.Messages.OfType <SKYPE4COMLib.ChatMessage>()
                        .Where(o => o.Timestamp >= DateTime.Now.AddDays(-days))
                        .DistinctBy(o => o.FromHandle)
                        .Select(o => SkypeCommands.GetUser(o.FromHandle));

            cmd.ReplyChat("Inactive users for past {0} days\n{1}"
                          , days
                          , String.Join(Environment.NewLine, cmd.ChatMembers.Where(o => !ulist.Any(u => u.Handle == o.Handle)).Select(o => SkypeCommands.GetUser(o.Handle).GetDisplayName())));
        }
Exemplo n.º 3
0
        public void ForkActive(SkypeCommander.Command cmd)
        {
            var latestMessages = cmd.Chat.Messages.OfType <SKYPE4COMLib.ChatMessage>()
                                 .Take(500)
                                 .Where(o => o.Timestamp > DateTime.Now.AddMinutes(-15))
                                 .DistinctBy(o => o.FromHandle);

            UserCollection users = new UserCollection();
            var            ulist = latestMessages.Select(o => SkypeCommands.GetUser(o.FromHandle))
                                   .Where(o => o.Handle != SkypeCommands.Skype.CurrentUserHandle)
                                   .ToList();

            var userCollection = new UserCollection();

            ulist.ForEach(u => userCollection.Add(u));

            var chat = SkypeCommands.Skype.CreateChatMultiple(userCollection);

            if (chat != null)
            {
                chat.SendMessage(String.Format("Chat created {0} with {1} members", DateTime.Now.ToShortTimeString(), ulist.Count));
            }
        }