Skip to content

[anime] Add #tsgbot-games support & ChannelLimitedBot integration#1129

Closed
Copilot wants to merge 4 commits intomasterfrom
copilot/update-anime-bot-functionality
Closed

[anime] Add #tsgbot-games support & ChannelLimitedBot integration#1129
Copilot wants to merge 4 commits intomasterfrom
copilot/update-anime-bot-functionality

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 7, 2026

Migrates anime bot to use ChannelLimitedBot pattern for multi-channel support (#sandbox + #tsgbot-games) with progress notifications, following established patterns from #1109, #1122, #1124.

Changes

  • TypeScript migration: anime/index.jsindex.ts, anime/anison.jsanison.ts
  • Bot classes: AnimeQuizBot and AnimeSongQuizBot extend ChannelLimitedBot
    • Override allowedChannels with [CHANNEL_SANDBOX, CHANNEL_GAMES]
    • Implement onWakeWord() with Deferred<string | null> for async quiz initialization
    • Use deleteProgressMessage() on quiz completion
  • State management: Migrated closure-based state to class properties with typed interfaces
  • Test coverage: Basic initialization test with mocked Google Sheets API

Pattern

class AnimeQuizBot extends ChannelLimitedBot {
  protected override readonly wakeWordRegex = /^(?:(?:easy|normal|hard|extreme)?|@anime)/u;
  protected override readonly allowedChannels = [process.env.CHANNEL_SANDBOX!, process.env.CHANNEL_GAMES!];
  
  protected override onWakeWord(message: GenericMessageEvent, channel: string): Promise<string | null> {
    const quizMessageDeferred = new Deferred<string | null>();
    // Start quiz, resolve deferred with message timestamp
    return quizMessageDeferred.promise;
  }
}

All existing features preserved: difficulty modes, @anime lookup, achievement unlocks, timed hint system.

Original prompt

This section details on the original issue you should resolve

<issue_title>[anime] #tsgbot-games 対応 & ChannelLimitedBotクラスを導入</issue_title>
<issue_description>Issue #1099 の対応の一環として、 anime BOTの改修を行う。

Slackの #tsgbot-games チャンネルからの起動に対応できるようにする。また、 lib/channelLimitedBot.ts で定義されたChannelLimitedBotクラスを利用し、起動チャンネルの指定と進行中のゲームの通知を導入する。

改修にあたっては、すでに行われた以下の3つのBOTの同様の修正の修正内容を必ず参照し、これらのスタイルを可能な限り踏襲する。

crossword bot

character-quiz bot

achievement-quiz bot

Comments on the Issue (you are @copilot in this section)


💡 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.

Copilot AI and others added 3 commits January 7, 2026 16:01
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>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jan 7, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
25.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copilot AI changed the title [WIP] Update anime bot to support #tsgbot-games channel [anime] Add #tsgbot-games support & ChannelLimitedBot integration Jan 7, 2026
Copilot AI requested a review from hakatashi January 7, 2026 16:19
@hakatashi hakatashi closed this Jan 18, 2026
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.

[anime] #tsgbot-games 対応 & ChannelLimitedBotクラスを導入

2 participants