public async Task HandleTvShowRequestAsync(string tvShowName) { if (!_discordSettings.EnableDirectMessageSupport && this.Context.Guild == null) { await ReplyToUserAsync($"This command is only available within a server."); return; } else if (this.Context.Guild != null && _discordSettings.MonitoredChannels.Any() && _discordSettings.MonitoredChannels.All(c => !Context.Message.Channel.Name.Equals(c, StringComparison.InvariantCultureIgnoreCase))) { return; } await DeleteSafeAsync(this.Context.Message); var workFlow = new TvShowRequestingWorkflow(new TvShowUserRequester(this.Context.Message.Author.Id.ToString(), this.Context.Message.Author.Username), _tvShowSearcher, _tvShowRequester, this, _notificationsRepository); await workFlow.HandleTvShowRequestAsync(tvShowName); }
public Task HandleTvShowRequestAsync(string tvShowName) { if (!_discordSettings.EnableDirectMessageSupport && this.Context.Guild == null) { return(ReplyToUserAsync($"This command is only available within a server.")); } else if (this.Context.Guild != null && _discordSettings.MonitoredChannels.Any() && _discordSettings.MonitoredChannels.All(c => !Context.Message.Channel.Name.Equals(c, StringComparison.InvariantCultureIgnoreCase))) { return(Task.CompletedTask); } if (string.IsNullOrWhiteSpace(tvShowName)) { return(ReplyToUserAsync($"Here's how to use the tv command! You must type ```!tv``` followed by the name of the tv show you're looking for, like this ```!tv putnamehere```")); } var workFlow = new TvShowRequestingWorkflow(new TvShowUserRequester(this.Context.Message.Author.Id.ToString(), this.Context.Message.Author.Username), _tvShowSearcher, _tvShowRequester, this, _notificationsRepository); return(workFlow.HandleTvShowRequestAsync(tvShowName)); }