Skip to content

Conversation

@BAKAOLC
Copy link
Owner

@BAKAOLC BAKAOLC commented Sep 21, 2025

No description provided.

Copilot AI review requested due to automatic review settings September 21, 2025 12:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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; }
Copy link

Copilot AI Sep 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
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();
Copy link

Copilot AI Sep 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
return sb.ToString();
return stringBuilder.ToString();

Copilot uses AI. Check for mistakes.
@BAKAOLC BAKAOLC merged commit e88f852 into main Sep 21, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants