From 2f7a409a72a926736600f97085589b552ff7606e Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 9 Jul 2019 01:23:26 +0900 Subject: [PATCH] =?UTF-8?q?Page=20Event=E3=81=A7=E3=81=AE=E3=83=AA?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B7=E6=8B=9B=E5=BE=85=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/reversi/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/modules/reversi/index.ts b/src/modules/reversi/index.ts index 5b0d62a..6314ec1 100644 --- a/src/modules/reversi/index.ts +++ b/src/modules/reversi/index.ts @@ -27,6 +27,17 @@ export default class extends Module { // マッチしたとき this.reversiConnection.on('matched', msg => this.onReversiGameStart(msg)); + if (config.reversiEnabled) { + const mainStream = this.ai.connection.useSharedConnection('main'); + mainStream.on('pageEvent', msg => { + if (msg.event === 'inviteReversi') { + this.ai.api('games/reversi/match', { + userId: msg.user.id + }); + } + }); + } + return { mentionHook: this.mentionHook };