Ejemplo n.º 1
0
        protected override void HandleCommand(IChatClient chatClient,
                                              CommandReceivedEventArgs eventArgs)
        {
            string blastName = eventArgs?.Arguments?.ElementAtOrDefault(0);
            var    blastType = _repository.Single(BlastTypeEntityPolicy.ByName(blastName));

            if (blastType != null)
            {
                chatClient.SendMessage(blastType.Message);
                _animationDisplayNotification.Blast(blastType.ImagePath);
            }
            else
            {
                chatClient.SendMessage(HelpText);
            }
        }
Ejemplo n.º 2
0
        protected override void HandleCommand(IChatClient chatClient,
                                              CommandReceivedEventArgs eventArgs)
        {
            string blastName = eventArgs?.Arguments?.ElementAtOrDefault(0);
            var    blastType = _repository.Single(BlastTypeEntityPolicy.ByName(blastName));

            if (blastType != null)
            {
                chatClient.SendMessage(blastType.Message);
                _animationDisplayNotification.Blast(blastType.ImagePath);
            }
            else
            {
                var availableBlastTypes = _repository.List(BlastTypeEntityPolicy.All()).Select(bt => bt.Name);
                if (availableBlastTypes.Count() > 0)
                {
                    chatClient.SendMessage(string.Format(HelpText, string.Join(", ", availableBlastTypes)));
                }
                else
                {
                    chatClient.SendMessage(string.Format(HelpText, "<No configured blast types>"));
                }
            }
        }