mirror of
https://github.com/syuilo/ai.git
synced 2024-11-24 22:01:07 +00:00
ユーザーが藍が対局情報を投稿するのを許可するか否か設定できるように
This commit is contained in:
parent
1e30e89375
commit
7f21f1055b
|
@ -37,6 +37,7 @@ process.on('message', async msg => {
|
|||
onGameStarted(msg.body);
|
||||
|
||||
//#region TLに投稿する
|
||||
if (form.find(i => i.id == 'publish').value) {
|
||||
const game = msg.body;
|
||||
const url = `${config.host}/reversi/${game.id}`;
|
||||
const user = game.user1Id == config.id ? game.user2 : game.user1;
|
||||
|
@ -51,6 +52,7 @@ process.on('message', async msg => {
|
|||
text: `${text}\n→[観戦する](${url})`
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
note = res.createdNote;
|
||||
//#endregion
|
||||
|
@ -64,6 +66,7 @@ process.on('message', async msg => {
|
|||
});
|
||||
|
||||
//#region TLに投稿する
|
||||
if (form.find(i => i.id == 'publish').value) {
|
||||
const user = game.user1Id == config.id ? game.user2 : game.user1;
|
||||
const isSettai = form[0].value === 0;
|
||||
const text = isSettai
|
||||
|
@ -85,7 +88,9 @@ process.on('message', async msg => {
|
|||
text: text
|
||||
}
|
||||
});
|
||||
}
|
||||
//#endregion
|
||||
|
||||
process.exit();
|
||||
}
|
||||
|
||||
|
|
|
@ -132,6 +132,11 @@ function gameStart(game) {
|
|||
|
||||
// フォーム
|
||||
const form = [{
|
||||
id: 'publish',
|
||||
type: 'switch',
|
||||
label: '藍が対局情報を投稿するのを許可',
|
||||
value: true
|
||||
}, {
|
||||
id: 'strength',
|
||||
type: 'radio',
|
||||
label: '強さ',
|
||||
|
|
Loading…
Reference in a new issue