更新OpenApi类以支持Baidu和Pixiv API,添加获取日历和用户信息的功能,同时更新相关依赖项和修复部分代码逻辑。#25
更新OpenApi类以支持Baidu和Pixiv API,添加获取日历和用户信息的功能,同时更新相关依赖项和修复部分代码逻辑。#25
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the OpenApi classes to support Baidu and Pixiv APIs, adding functionality to retrieve calendar and user information. The changes include refactoring the OpenApi class to use instance-based methods instead of static methods, updating package dependencies to newer versions, and improving code maintainability.
- Refactored OpenApi class from static to instance-based pattern with dependency injection support
- Added comprehensive Pixiv API integration for user and illustration data retrieval
- Updated package dependencies to newer versions including Discord.Net, Microsoft.Extensions, and other core libraries
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| RitsukageBotForDiscord.csproj | Updates all package references to newer versions |
| Program.cs | Updates OpenApi initialization to use instance-based pattern |
| TimeInteractions.cs | Updates calendar API calls to use OpenApi instance |
| AutoBroadcastTimeScheduleTask.cs | Updates calendar API calls to use OpenApi instance |
| ImageInteractions.cs | Improves component interaction code with pattern matching |
| AiInteractions.Preprocessing.cs | Adds Pixiv preprocessing actions and updates API calls |
| PixivUserData.cs | Defines data structures for Pixiv user information |
| PixivIllustData.cs | Defines comprehensive data structures for Pixiv illustration data |
| OpenApi.Pixiv.cs | Implements Pixiv API methods for user and illustration retrieval |
| OpenApi.cs | Refactors to instance-based pattern with dependency injection |
| BaiduCalendarData.cs | Updates namespace for better organization |
| OpenApi.Baidu.cs | Updates to use instance-based pattern and new namespace |
| RitsukageBotForDiscord.sln.DotSettings | Adds new dictionary words for spelling checker |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| /// </summary> | ||
| public IFusionCache? CacheProvider { get; private set; } | ||
|
|
||
| public ILogger<OpenApi> Logger { get; private set; } |
There was a problem hiding this comment.
The Logger property is not initialized and will be null until SetLogger is called, which could cause null reference exceptions if methods try to use it before initialization.
| stringBuilder.AppendLine($"Tags: {string.Join(", ", illust.Tags)}"); | ||
| stringBuilder.AppendLine($"Created At: {illust.CreateDate:yyyy-MM-dd HH:mm:ss}"); | ||
| stringBuilder.AppendLine($"Page Count: {illust.PageCount}"); | ||
| return sb.ToString(); |
There was a problem hiding this comment.
This line should return stringBuilder.ToString() instead of sb.ToString(). The variable stringBuilder is used in the loop, but sb is returned, which contains the main illustration info instead of the other artwork info.
| return sb.ToString(); | |
| return stringBuilder.ToString(); |
No description provided.