Automatically consent to extracting your own battlelog (#5672)

This commit is contained in:
whales 2019-08-05 13:36:08 +09:30 committed by Guangcong Luo
parent 51932ab4f2
commit 188d8b8c85

View File

@ -3895,6 +3895,9 @@ const commands = {
if (!battle.allowExtraction) {
battle.allowExtraction = ['', ''];
}
if (user.userid === toID(battle.p1.name) || user.userid === toID(battle.p2.name)) {
this.parse(`/allowexportinputlog ${user.userid}`);
}
if (battle.allowExtraction[0] !== user.userid) {
const p1 = Users(battle.p1.name);
if (p1) p1.sendTo(room, Chat.html`|html|${user.name} wants to extract the battle input log. <button name="send" value="/allowexportinputlog ${user.userid}">Share your team and choices with "${user.name}"</button>`);