Skip to content

Refactor main.py: use setup_hook pattern and reorder event handlers#5

Merged
Nanahuse merged 3 commits intorefactor/remove_global_variablefrom
copilot/sub-pr-4
Dec 1, 2025
Merged

Refactor main.py: use setup_hook pattern and reorder event handlers#5
Nanahuse merged 3 commits intorefactor/remove_global_variablefrom
copilot/sub-pr-4

Conversation

Copy link
Contributor

Copilot AI commented Dec 1, 2025

  • Understand the feedback: Move on_ready event handler definition to follow Discord bot patterns
  • Apply feedback: Define on_ready before cog registration and use setup_hook for cog loading
  • Verify the changes work with linting
  • Run code review
  • Run CodeQL security check
  • Add # type: ignore[assignment] to setup_hook assignment per reviewer request

Security Summary: No security vulnerabilities found.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…_hook pattern

Co-authored-by: Nanahuse <109294061+Nanahuse@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP address feedback on refactoring to introduce commands.Cog Refactor main.py: use setup_hook pattern and reorder event handlers Dec 1, 2025
Copilot AI requested a review from Nanahuse December 1, 2025 10:25
src/main.py Outdated
async def setup_hook() -> None:
await bot.add_cog(CountdownCog(logger, load_env.load_countdown_source()))

bot.setup_hook = setup_hook
Copy link
Owner

Choose a reason for hiding this comment

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

この行に # type: ignore[assignment]を追加して

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in 851deeb.

Co-authored-by: Nanahuse <109294061+Nanahuse@users.noreply.github.com>
Copilot AI requested a review from Nanahuse December 1, 2025 10:29
@Nanahuse Nanahuse marked this pull request as ready for review December 1, 2025 10:32
@Nanahuse Nanahuse merged commit 8f1898b into refactor/remove_global_variable Dec 1, 2025
2 checks passed
@Nanahuse Nanahuse deleted the copilot/sub-pr-4 branch December 1, 2025 10:34
Nanahuse added a commit that referenced this pull request Dec 1, 2025
* refactor

* Refactor main.py: use setup_hook pattern and reorder event handlers (#5)

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
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