public async Task HandleMovieRequestAsync(string movieName) { 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 MovieRequestingWorkflow(new MovieUserRequester(this.Context.Message.Author.Id.ToString(), this.Context.Message.Author.Username), _movieSearcher, _movieRequester, this, _notificationRequestRepository); await workFlow.HandleMovieRequestAsync(movieName); }
public Task HandleMovieRequestAsync(string movieName) { 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(movieName)) { return(ReplyToUserAsync($"Here's how to use the movie command! You must type ```!movie``` followed by the name of the movie you're looking for, like this ```!movie putnamehere```")); } var workFlow = new MovieRequestingWorkflow(new MovieUserRequester(this.Context.Message.Author.Id.ToString(), this.Context.Message.Author.Username), _movieSearcher, _movieRequester, this, _notificationRequestRepository); return(workFlow.HandleMovieRequestAsync(movieName)); }