コード例 #1
0
        public async ValueTask ExecuteAsync(IConsole console)
        {
            if (VideoId.HasValue())
            {
                var v = await YtClient.VideoData(VideoId);

                Log.Information("{ChannelId},{ChannelTitle}", v.ChannelId, v.ChannelTitle);
            }
            if (ChannelId.HasValue())
            {
                var c = await YtClient.ChannelData(ChannelId);

                Log.Information("{ChannelTitle}", c.Title);
            }

            if (VideoId.NullOrEmpty() && ChannelId.NullOrEmpty())
            {
                throw new CommandException("you must provide a channel ID or video ID");
            }
        }