This commit is contained in:
syuilo 2020-09-02 20:51:56 +09:00
parent e29ca5a12c
commit bc1c115de4
3 changed files with 6 additions and 3 deletions

View file

@ -296,7 +296,7 @@ export default class 藍 {
}
@autobind
public lookupFriend(userId: User['id']): Friend {
public lookupFriend(userId: User['id']): Friend | null {
const doc = this.friends.findOne({
userId: userId
});

View file

@ -195,8 +195,11 @@ export default class extends Module {
}
}
const winnerFriend = winner ? this.ai.lookupFriend(winner.id) : null;
const name = winnerFriend ? winnerFriend.name : null;
const text = results.join('\n') + '\n\n' + (winner
? serifs.kazutori.finishWithWinner(acct(winner))
? serifs.kazutori.finishWithWinner(acct(winner), name)
: serifs.kazutori.finishWithNoWinner);
this.ai.post({

View file

@ -301,7 +301,7 @@ export default {
finish: 'ゲームの結果発表です!',
finishWithWinner: user => `今回は${user}さんの勝ちです!またやりましょう♪`,
finishWithWinner: (user, name) => name ? `今回は${user}(${name})さんの勝ちです!またやりましょう♪` : `今回は${user}さんの勝ちです!またやりましょう♪`,
finishWithNoWinner: '今回は勝者はいませんでした... またやりましょう♪',