Пример #1
0
 protected void OnCommandCompleted(CommandCompletedEventArgs e)
 {
     if (CommandCompleted != null)
         CommandCompleted(this, e);
 }
Пример #2
0
        protected override CommandCompletedEventArgs Worker(IrcEventArgs e)
        {
            User user = userService.GetAuthenticatedUser(e.Data.From);

            string nick = "";
            string message = "";

            if (e.Data.MessageArray.Count() > 1)
            {
                nick = e.Data.MessageArray[1];
            }
            else
            {
                if (user != null)
                {
                    nick = userService.GetUserSetting(user.ID, SystemName + ".username");
                }
                else
                {
                    nick = userService.GetUserSetting(null, SystemName + "." + e.Data.Nick);
                    if (string.IsNullOrWhiteSpace(nick))
                        nick = e.Data.Nick;
                }
            }

            if (!string.IsNullOrWhiteSpace(nick))
            {
                log.Info("Fetching now playing information for user \"" + nick + "\"");
                message = FetchNowPlayingInfo(nick);
                if (CloseCall())
                    message += " -- " + e.Data.Nick;
            }

            CommandCompletedEventArgs completedArgs = new CommandCompletedEventArgs(e.Data.Channel, new List<string> { message });

            return completedArgs;
        }
Пример #3
0
 private void OnCommandComplete(object sender, CommandCompletedEventArgs e)
 {
     if (e != null
         && !string.IsNullOrWhiteSpace(e.Destination)
         && e.MessageLines.Count > 0)
     {
         foreach (string line in e.MessageLines.Where(x => !string.IsNullOrWhiteSpace(x)))
             irc.SendMessage(e.SendType, e.Destination, line);
     }
 }