数当てゲームはメッセージでのみに

This commit is contained in:
syuilo 2018-08-12 23:25:47 +09:00
parent 24af1d80ae
commit c4610894fb
2 changed files with 28 additions and 16 deletions

View file

@ -30,9 +30,16 @@ export default class GuessingGameModule implements IModule {
isEnded: false isEnded: false
}); });
if (!msg.isMessage) {
if (exist != null) { if (exist != null) {
msg.reply(serifs.GUESSINGGAME_ARLEADY_STARTED); msg.reply(serifs.GUESSINGGAME_ARLEADY_STARTED);
} else { } else {
msg.reply(serifs.GUESSINGGAME_PLZ_DM);
}
return true;
}
const secret = Math.floor(Math.random() * 100); const secret = Math.floor(Math.random() * 100);
guesses.insertOne({ guesses.insertOne({
@ -47,7 +54,7 @@ export default class GuessingGameModule implements IModule {
msg.reply(serifs.GUESSINGGAME_STARTED).then(reply => { msg.reply(serifs.GUESSINGGAME_STARTED).then(reply => {
this.ai.subscribeReply(this, msg.userId, msg.isMessage, msg.isMessage ? msg.userId : reply.id); this.ai.subscribeReply(this, msg.userId, msg.isMessage, msg.isMessage ? msg.userId : reply.id);
}); });
}
return true; return true;
} else { } else {
return false; return false;

View file

@ -42,6 +42,11 @@ export default {
*/ */
GUESSINGGAME_ARLEADY_STARTED: 'え、ゲームは既に始まってますよ!', GUESSINGGAME_ARLEADY_STARTED: 'え、ゲームは既に始まってますよ!',
/**
*
*/
GUESSINGGAME_PLZ_DM: 'メッセージでやりましょう!',
/** /**
* *
*/ */