diff --git a/src/api/bot/core.ts b/src/api/bot/core.ts
index ca5f5b89eb202ea414e79573541a7247ef6976bd..207de716197f1f6a88a2c9b774882d6d71f5db2b 100644
--- a/src/api/bot/core.ts
+++ b/src/api/bot/core.ts
@@ -287,8 +287,15 @@ class OthelloContext extends Context {
 
 	public async q(query: string): Promise<string> {
 		this.othello.setByNumber('black', parseInt(query, 10));
+		const s = this.othello.toString() + '\n\n...(AI)...\n\n';
 		othelloAi('white', this.othello);
-		return this.othello.toPatternString('black');
+		if (this.othello.getPattern('black').length === 0) {
+			this.bot.clearContext();
+			return '~終了~';
+		} else {
+			this.emit('updated');
+			return s + this.othello.toPatternString('black');
+		}
 	}
 
 	public export() {
diff --git a/src/common/othello.ts b/src/common/othello.ts
index ef11514dff4001a2b0d39ee1dbec5fe983f92b36..0b377ff5d33a290e565f2a58c6b94a0fd8cbf78d 100644
--- a/src/common/othello.ts
+++ b/src/common/othello.ts
@@ -275,4 +275,6 @@ export function ai(color: string, othello: Othello) {
 			}
 		}
 	}
+
+	think();
 }