Ejemplo n.º 1
0
        public async Task <RuntimeResult> PMDefault([Remainder] string message)
        {
            try
            {
                if (_messagingService.MassDMInProgress)
                {
                    throw new Exception("Mass DM operation is in progress, please wait for it to finish");
                }
                var urls = await _trackerService.GetTrackerUrlsDefault(
                    Context.Guild.Id,
                    Context.User.Id,
                    message);

                var pms = urls.Select(kv => new PrivateMessage(kv.Key, FormatMessage(kv.Value))).ToArray();
                await _messagingService.MassDM(Context.Channel, pms);

                return(CommandResult.FromSuccess());
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, ex.Message);
                return(CommandResult.FromError(ex.Message));
            }
        }