mirror of
https://github.com/syuilo/ai.git
synced 2024-11-25 06:01:07 +00:00
✌️
This commit is contained in:
parent
e29ca5a12c
commit
bc1c115de4
|
@ -296,7 +296,7 @@ export default class 藍 {
|
||||||
}
|
}
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
public lookupFriend(userId: User['id']): Friend {
|
public lookupFriend(userId: User['id']): Friend | null {
|
||||||
const doc = this.friends.findOne({
|
const doc = this.friends.findOne({
|
||||||
userId: userId
|
userId: userId
|
||||||
});
|
});
|
||||||
|
|
|
@ -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
|
const text = results.join('\n') + '\n\n' + (winner
|
||||||
? serifs.kazutori.finishWithWinner(acct(winner))
|
? serifs.kazutori.finishWithWinner(acct(winner), name)
|
||||||
: serifs.kazutori.finishWithNoWinner);
|
: serifs.kazutori.finishWithNoWinner);
|
||||||
|
|
||||||
this.ai.post({
|
this.ai.post({
|
||||||
|
|
|
@ -301,7 +301,7 @@ export default {
|
||||||
|
|
||||||
finish: 'ゲームの結果発表です!',
|
finish: 'ゲームの結果発表です!',
|
||||||
|
|
||||||
finishWithWinner: user => `今回は${user}さんの勝ちです!またやりましょう♪`,
|
finishWithWinner: (user, name) => name ? `今回は${user}(${name})さんの勝ちです!またやりましょう♪` : `今回は${user}さんの勝ちです!またやりましょう♪`,
|
||||||
|
|
||||||
finishWithNoWinner: '今回は勝者はいませんでした... またやりましょう♪',
|
finishWithNoWinner: '今回は勝者はいませんでした... またやりましょう♪',
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue