-
Notifications
You must be signed in to change notification settings - Fork 12
Add ChannelLimitedBot support to bungo-quiz #1142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: hakatashi <3126484+hakatashi@users.noreply.github.com>
Co-authored-by: hakatashi <3126484+hakatashi@users.noreply.github.com>
bungo-quiz/index.ts
Outdated
| return quizMessageDeferred.promise; | ||
| } | ||
|
|
||
| constructor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot このconstructorは親クラスのconstructorと同一で、不要です
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the unnecessary constructor in 73b59f6.
bungo-quiz/index.ts
Outdated
| channel, | ||
| text: `エラー😢\n\`${errorText}\`\n--debugInfo--\n${debugInfo.join('\n')}`, | ||
| }); | ||
| quizMessageDeferred.resolve(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot この処理はquizMessageDeferredがすでに解決していない場合のみ実行してください
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added isResolved check before calling resolve(null) in 73b59f6.
Co-authored-by: hakatashi <3126484+hakatashi@users.noreply.github.com>
|
hakatashi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
えへ~ ありがとう! レビューさせてもらうにゃ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📋 Review Summary
にゃしし!ChannelLimitedBot を使ってお引越しするコードだにゃ!前のコードよりすっきりしていて、とってもいい感じだと思うにゃ!うな、こういうの好きだにゃ!
🔍 General Feedback
ChannelLimitedBotの使い方、他のボットとおんなじ感じで書けててえらいにゃ!- エラーが起きてもちゃんと考えられるようになってて、前より安心だにゃ!
Deferredを使って、クイズが始まったらメッセージを消すのも、賢いやりかただにゃ!
| hintMessages: [ | ||
| ...hints.slice(1, -1).map((text, index, arr) => { | ||
| return { channel, text: `次のヒントです!\n> ${text}` } | ||
| ...hints.slice(1, -1).map((text) => { | ||
| return { channel, text: `次のヒントです!\n> ${text}` }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟢 にゃしし!ここの {} と return は、なくても動くみたいだにゃ!こうすると、もっとスッキリすると思うにゃ!
| hintMessages: [ | |
| ...hints.slice(1, -1).map((text, index, arr) => { | |
| return { channel, text: `次のヒントです!\n> ${text}` } | |
| ...hints.slice(1, -1).map((text) => { | |
| return { channel, text: `次のヒントです!\n> ${text}` }; | |
| ...hints.slice(1, -1).map((text) => ({ | |
| channel, text: `次のヒントです!\n> ${text}`, | |
| })), |
There was a problem hiding this 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 migrates the bungo-quiz bot to use the ChannelLimitedBot framework, enabling it to work with the #tsgbot-games channel while following the same architectural pattern established in anime, character-quiz, and achievement-quiz bots.
Changes:
- Converted bungo-quiz from event-based message handling to class-based ChannelLimitedBot architecture
- Implemented Deferred pattern for tracking quiz start messages and managing progress message lifecycle
- Added proper error handling with isResolved check to prevent double-resolution of promises




Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.