MOMOKA

機能概要

Feature overview

ボット本体(webpage / ダッシュボードを除く)の構成と主要機能の流れです。図は拡大・縮小・ドラッグ移動できます。コード解説は DeepWiki、コマンド一覧は コマンド、個人情報の扱いは プライバシー を参照してください。

Architecture and major feature flows of the bot host (excluding this website and the dashboard). Diagrams support zoom, pan, and drag. See DeepWiki for code-oriented docs, Commands for the command list, and Privacy for data handling.

全体構成 Architecture

Discord 経由で PLANA / ARONA が動き、設定は SQLite、会話は主にメモリ、機能ごとに外部 API やローカル処理へ振り分けます。

PLANA / ARONA talk to Discord; settings live in SQLite, chat history mostly in memory, and features call external APIs or local engines as needed.

flowchart TB
  U["Discord ユーザー"] --> D["Discord"]
  D <--> BOT["MOMOKA ホスト<br/>PLANA / ARONA"]
  BOT --> MEM["メモリ<br/>会話・再生状態"]
  BOT --> DB[("SQLite<br/>ギルド設定")]
  BOT --> TMP["一時ファイル"]
  BOT --> LOCAL["ローカル<br/>TTS / 画像生成"]
  BOT -->|"本文・画像"| LLM["AI プロバイダ"]
  BOT -->|"クエリ"| SEARCH["Web 検索"]
  BOT -->|"URL"| MEDIA["yt-dlp 先"]
  TMP --> CF["Cloudflare Tunnel"]
  CF --> D
  BOT --> TW["Twitch"]
  BOT --> EQ["地震 API"]
  BOT --> GAME["戦績 API"]
  BOT -->|"Fix URL"| D
  D -.-> FIX["Link Fix プロキシ"]
  BOT --> IMG["画像 API"]
利用者 → Discord → ホスト → メモリ / SQLite / 外部サービス
flowchart TB
  U["Discord user"] --> D["Discord"]
  D <--> BOT["MOMOKA host<br/>PLANA / ARONA"]
  BOT --> MEM["Memory<br/>chat / playback"]
  BOT --> DB[("SQLite<br/>guild settings")]
  BOT --> TMP["Temp files"]
  BOT --> LOCAL["Local<br/>TTS / image gen"]
  BOT -->|"text / images"| LLM["AI providers"]
  BOT -->|"queries"| SEARCH["Web search"]
  BOT -->|"URLs"| MEDIA["yt-dlp targets"]
  TMP --> CF["Cloudflare Tunnel"]
  CF --> D
  BOT --> TW["Twitch"]
  BOT --> EQ["Earthquake API"]
  BOT --> GAME["Stats APIs"]
  BOT -->|"Fix URLs"| D
  D -.-> FIX["Link Fix proxies"]
  BOT --> IMG["Image APIs"]
User → Discord → host → memory / SQLite / external services

デュアルボット Dual bots

MOMOKA はプロジェクト名です。公開ボットは PLANA(主)と ARONA(任意のコンパニオン)で、1 プロセスで両方を動かします。TTS・画像・通知・戦績・Link Fix・メディア DL は PLANA 専用です。

MOMOKA is the project name. Public bots are PLANA (primary) and optional ARONA (companion), running in one process. TTS, images, notifications, trackers, Link Fix, and media download are PLANA-only.

flowchart LR
  U["ユーザー"] --> P["PLANA<br/>全機能"]
  U -.->|"任意"| A["ARONA<br/>LLM / 音楽"]
  A -->|"TTS 等は誘導"| P
  P --> H["同一ホストプロセス"]
  A --> H
まず PLANA を招待。ARONA は /help や /invite から追加
flowchart LR
  U["User"] --> P["PLANA<br/>full feature set"]
  U -.->|"optional"| A["ARONA<br/>LLM / music"]
  A -->|"redirects TTS etc."| P
  P --> H["Same host process"]
  A --> H
Invite PLANA first; add ARONA via /help or /invite

AI チャット AI chat

メンション・リプライ・/chat・DM で応答します。Agent ルーター自身も LLM API を呼び出して会話 / コーディング / コマンドへ振り分け、その後の応答生成でも(必要なら Web 検索や画像理解を挟みつつ)再び LLM API を使います。履歴はメモリ上(再起動で消える)です。

Replies via mention, reply, /chat, or DM. The Agent router itself calls an LLM API to classify conversation / coding / command modes, then the reply path may call the LLM again (optionally with web search or vision). History stays in memory (cleared on restart).

flowchart LR
  M["メンション / DM /chat"] --> R["Agent ルーター"]
  R -->|"分類"| L1["LLM API"]
  L1 --> R
  R --> C["会話"]
  R --> K["コーディング"]
  R --> X["コマンド"]
  C --> S{"検索?"}
  S -->|Yes| W["Web 検索"]
  S --> L2["LLM API"]
  W --> L2
  K --> L2
  X --> L2
  L2 --> MEM["メモリ履歴"]
  L2 --> D["Discord 応答"]
入力 → Agent(LLM で分類)→(検索)→ LLM 応答 → Discord
flowchart LR
  M["Mention / DM /chat"] --> R["Agent router"]
  R -->|"classify"| L1["LLM API"]
  L1 --> R
  R --> C["Conversation"]
  R --> K["Coding"]
  R --> X["Command"]
  C --> S{"Search?"}
  S -->|Yes| W["Web search"]
  S --> L2["LLM API"]
  W --> L2
  K --> L2
  X --> L2
  L2 --> MEM["In-memory history"]
  L2 --> D["Discord reply"]
Input → Agent (LLM classify) → (search) → LLM reply → Discord

音楽再生 Music

両ボットで VC 再生が可能です(同一 VC への同時接続は不可)。YouTube / Spotify ページ / ニコニコなど yt-dlp 対応ソースから取得し、キュー・ループなどに対応します。グレースフル再起動時は再生状態を SQLite に一時保存します。

Both bots can play in voice channels (not the same VC at once). Sources go through yt-dlp (YouTube, Spotify pages, Niconico, etc.) with queue and loop support. On graceful restart, playback state may be snapshotted in SQLite.

flowchart LR
  U["再生コマンド"] --> B["ボット"]
  B --> Y["yt-dlp"]
  Y --> SRC["動画サイト"]
  B --> VC["Discord VC"]
  B --> Q["メモリ上のキュー"]
  B -.->|"再起動時"| DB[("SQLite セッション")]
コマンド → yt-dlp → VC 再生
flowchart LR
  U["Play command"] --> B["Bot"]
  B --> Y["yt-dlp"]
  Y --> SRC["Media sites"]
  B --> VC["Discord VC"]
  B --> Q["In-memory queue"]
  B -.->|"on restart"| DB[("SQLite session")]
Command → yt-dlp → VC playback

読み上げ(TTS) Text-to-speech

PLANA 専用。チャンネルのメッセージをローカルの Style-Bert-VITS2 で読み上げ、音楽と同一 VC で重ねられます。声・自動参加ユーザーなどはギルド設定として SQLite に保存します。

PLANA-only. Channel messages are spoken with local Style-Bert-VITS2 and can mix with music in the same VC. Voice and auto-join users are stored as guild settings in SQLite.

flowchart LR
  MSG["テキストチャンネル"] --> P["PLANA"]
  P --> DB[("SQLite 設定")]
  P --> TTS["ローカル TTS"]
  TTS --> VC["Discord VC"]
メッセージ → ローカル TTS → VC
flowchart LR
  MSG["Text channel"] --> P["PLANA"]
  P --> DB[("SQLite settings")]
  P --> TTS["Local TTS"]
  TTS --> VC["Discord VC"]
Message → local TTS → VC

画像生成 Image generation

PLANA 専用。原則ホスト上の diffusers エンジンで生成します(外部 API 不要)。任意で Forge 等のローカル API も利用できます。猫・Danbooru 等の画像コマンドは別途外部 API を呼びます。

PLANA-only. Images are usually generated by the on-host diffusers engine (no cloud API required). Optional local Forge-style APIs are supported. Separate image commands may call Cat API / Danbooru, etc.

flowchart LR
  U["画像コマンド"] --> P["PLANA"]
  P --> GEN["ローカル生成<br/>diffusers 等"]
  P --> API["画像 API<br/>任意コマンド"]
  GEN --> D["Discord 投稿"]
  API --> D
コマンド → ローカル生成または外部 API → Discord
flowchart LR
  U["Image command"] --> P["PLANA"]
  P --> GEN["Local gen<br/>diffusers etc."]
  P --> API["Image APIs<br/>some commands"]
  GEN --> D["Discord post"]
  API --> D
Command → local gen or external API → Discord

PLANA 専用・デフォルト無効。/linkfix で有効化すると、SNS URL の公式 embed を抑え、Fix 系プロキシ URL を silent 引用返信します。閲覧時は Fix 側が元コンテンツを取得し得ます。fxignore<URL> でスキップできます。

PLANA-only; disabled by default. After enabling via /linkfix, social URLs get original embeds suppressed and Fix proxy URLs as silent quote-replies. Fix hosts may fetch the original on preview. Skip with fxignore or <URL>.

flowchart LR
  U["SNS URL 投稿"] --> P["PLANA"]
  P --> DB[("SQLite<br/>ギルド設定")]
  P -->|"公式 embed 抑制"| D["Discord"]
  P -->|"Fix URL 返信"| D
  D -.->|"プレビュー"| F["Fix プロキシ"]
投稿検知 → 設定確認 → Fix URL 返信
flowchart LR
  U["Social URL post"] --> P["PLANA"]
  P --> DB[("SQLite<br/>guild settings")]
  P -->|"suppress embed"| D["Discord"]
  P -->|"Fix URL reply"| D
  D -.->|"preview"| F["Fix proxies"]
Detect → check settings → Fix URL reply

メディアダウンロード Media download

PLANA の /download_video / /download_audio。yt-dlp で取得したファイルをホスト上に一時保存し、Cloudflare Tunnel の期限付き URL(約 10 分)で共有します。第三者ホストへはアップロードしません。

PLANA /download_video / /download_audio. Files fetched via yt-dlp are kept temporarily on the host and shared through a Cloudflare Tunnel URL (~10 minutes). Files are not uploaded to third-party hosts.

flowchart LR
  U["/download_*"] --> P["PLANA"]
  P --> Y["yt-dlp"]
  Y --> SRC["動画サイト"]
  P --> TMP["一時ファイル"]
  TMP --> CF["Cloudflare Tunnel"]
  CF -->|"期限付き URL"| D["Discord"]
取得 → 一時保存 → Tunnel 共有
flowchart LR
  U["/download_*"] --> P["PLANA"]
  P --> Y["yt-dlp"]
  Y --> SRC["Media sites"]
  P --> TMP["Temp file"]
  TMP --> CF["Cloudflare Tunnel"]
  CF -->|"timed URL"| D["Discord"]
Fetch → temp store → Tunnel share

通知(地震 / Twitch) Notifications (earthquake / Twitch)

PLANA 専用。P2P 地震情報 API と Twitch Helix を監視し、ギルドで設定したチャンネルへ投稿します。通知先やフィルタは SQLite に保存されます。

PLANA-only. Watches the P2P earthquake API and Twitch Helix, then posts to guild-configured channels. Destinations and filters are stored in SQLite.

flowchart LR
  EQ["地震 API"] --> P["PLANA"]
  TW["Twitch API"] --> P
  P --> DB[("SQLite 設定")]
  P --> CH["通知チャンネル"]
外部イベント → 設定照合 → Discord 通知
flowchart LR
  EQ["Earthquake API"] --> P["PLANA"]
  TW["Twitch API"] --> P
  P --> DB[("SQLite settings")]
  P --> CH["Notify channel"]
External events → settings → Discord notify

ゲーム戦績 Game trackers

PLANA 専用。Valorant / Rainbow Six Siege のプレイヤー名などから外部戦績 API を照会し、結果を Discord に表示します。

PLANA-only. Looks up Valorant / Rainbow Six Siege stats via third-party APIs from player names and posts results to Discord.

flowchart LR
  U["戦績コマンド"] --> P["PLANA"]
  P -->|"プレイヤー名等"| API["戦績 API"]
  API --> P
  P --> D["Discord 表示"]
コマンド → 外部 API → 表示
flowchart LR
  U["Tracker command"] --> P["PLANA"]
  P -->|"player name etc."| API["Stats APIs"]
  API --> P
  P --> D["Discord display"]
Command → external API → display

図は現行の公開運用を要約したものです。実装詳細は DeepWiki と GitHub を優先してください。

Diagrams summarize current hosted behavior. Prefer DeepWiki and GitHub for implementation detail.

© 2026 MOMOKA · coffin299 & zer0latency

© 2026 MOMOKA · coffin299 & zer0latency