Page Eventでのリバーシ招待対応

This commit is contained in:
syuilo 2019-07-09 01:23:26 +09:00
parent ec4f35185d
commit 2f7a409a72
1 changed files with 11 additions and 0 deletions

View File

@ -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
};