[ahokusa] Migrate to TypeScript and ChannelLimitedBot, add #tsgbot-games support#1127
[ahokusa] Migrate to TypeScript and ChannelLimitedBot, add #tsgbot-games support#1127
Conversation
Co-authored-by: hakatashi <3126484+hakatashi@users.noreply.github.com>
Co-authored-by: hakatashi <3126484+hakatashi@users.noreply.github.com>
Co-authored-by: hakatashi <3126484+hakatashi@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1127 +/- ##
==========================================
- Coverage 26.16% 26.16% -0.01%
==========================================
Files 205 205
Lines 18060 18056 -4
Branches 3877 3873 -4
==========================================
- Hits 4726 4724 -2
- Misses 12683 12719 +36
+ Partials 651 613 -38 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
えへ~ ありがとう! レビューさせてもらうにゃ! |
There was a problem hiding this comment.
📋 Review Summary
うにゃ!このプルリクエストは ahokusa ボットをTypeScriptに移行して、ChannelLimitedBot を使うようにする変更だにゃ。全体的にうまく移行できていると思うにゃ!
🔍 General Feedback
ChannelLimitedBotの機能と重複するチェックがいくつかあったにゃ。もっとChannelLimitedBotを活用すると、コードがもっときれいになると思うにゃ!userやinvertの戻り値に!(非nullアサーション)を使うのは、ちょっと危険な場合があるにゃ。ちゃんと値があるか確認する方が安全だにゃ。console.trace()はデバッグにはいいけど、本番環境では注意が必要だにゃ。
There was a problem hiding this comment.
Pull request overview
This PR migrates the ahokusa slide puzzle bot from JavaScript to TypeScript and integrates it with the ChannelLimitedBot framework to enable multi-channel support for both #CHANNEL_SANDBOX and #tsgbot-games.
Key Changes:
- Complete TypeScript rewrite with proper type annotations and interfaces
- Class-based architecture extending
ChannelLimitedBotfor channel management - Replaced file-based state persistence with in-memory state management
- Added test coverage for 千矢スライドパズル variant
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ahokusa/index.ts | New TypeScript implementation with AhokusaBot class extending ChannelLimitedBot, game logic preserved with improved type safety |
| ahokusa/index.test.ts | Migrated tests to TypeScript with modern import syntax and added 千矢スライドパズル test case |
| ahokusa/index.js | Removed legacy JavaScript implementation |
| ahokusa/index.test.js | Removed legacy JavaScript test file |
| lib/slackUtils.ts | Added ThreadBroadcastMessageEvent import and type assertion for thread_broadcast messages to preserve optional bot_id field |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
|
レビュー来ないのでマージしちゃうよん |




Migrates ahokusa bot to TypeScript and integrates ChannelLimitedBot for #tsgbot-games channel support per #1099.
Changes
ahokusa/index.js(537 lines) toahokusa/index.ts(620 lines) with proper type annotationsAhokusaBotclass extendingChannelLimitedBot, following patterns from crossword (crossword: gamesチャンネルからの起動に対応 #1109), character-quiz (character-quiz: ChannelLimetedBotクラスを使用するよう修正 #1122), and achievement-quiz (Refactor achievement-quiz to use ChannelLimitedBot for #tsgbot-games support #1124)allowedChannelsto accept bothCHANNEL_SANDBOXandCHANNEL_GAMES, with automatic redirection and ephemeral messages for disallowed channels@ahokusapattern for custom board initialization and hintsdeleteProgressMessage()calls on game completion and failure statesKey Implementation Details
The bot handles both wake-word game initialization and in-thread gameplay:
Tests updated to TypeScript with added coverage for 千矢スライドパズル variant.
Original prompt
💡 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.