feat: slash ping pong command#86
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughDiscord ボットをメッセージベースのハンドラから app_commands ベースのスラッシュコマンドへ移行。 Changes
Sequence Diagram(s)sequenceDiagram
participant User as "User"
participant Discord as "Discord API"
participant Client as "MeshibanClient"
participant Tree as "CommandTree"
User->>Discord: /ping (interaction)
Discord->>Client: Deliver Interaction
Client->>Tree: dispatch(interaction)
Tree->>Client: invoke ping handler
Client->>Discord: respond("pong!")
Note over Discord,User: User sees "pong!"
sequenceDiagram
participant CLI as "CLI (--sync-only)"
participant Client as "MeshibanClient"
participant Discord as "Discord API"
CLI->>Client: start with --sync-only
Client->>Discord: tree.sync()
Discord-->>Client: ack sync
Client->>CLI: exit process
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main.py`:
- Around line 13-16: 現在 on_ready() 内で await tree.sync()
を呼んでいますが、再接続時にも実行されてしまいレート制限を誘発するため、tree.sync() を on_ready から削除して、Bot クラスの
setup_hook メソッド(例: async def setup_hook(self): await
tree.sync())に移動して起動時に一度だけ実行されるようにしてください。また on_ready の中から tree.sync()
呼び出しを削除し、もし既存のカスタム Bot クラスがあればそのクラスで setup_hook をオーバーライドして同期を行うようにしてください。
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main.py`:
- Around line 34-36: The ping command handler returns "pong!" but Issue `#62`
expects an exact "pong" response; update the string passed to
interaction.response.send_message in the ping function to "pong" (change the
literal in the async def ping handler where interaction.response.send_message is
called) so the response matches the required exact text.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6be945da-224b-4afd-8edc-4cdd64391b70
📒 Files selected for processing (2)
.mise.tomlsrc/main.py

close #62
Summary
タイトル通り
Changes
既存の
ping pong apiをslash command化した。Notes
正しく動きます。
