From f45b602423849d1d1214902e2f920b14bc7c3869 Mon Sep 17 00:00:00 2001 From: teidesu Date: Sun, 16 May 2021 02:07:23 +0300 Subject: [PATCH] fix(tl): improved bot-only methods detection --- packages/tl/scripts/generate-schema.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/tl/scripts/generate-schema.js b/packages/tl/scripts/generate-schema.js index 58fcb273..703e0d18 100644 --- a/packages/tl/scripts/generate-schema.js +++ b/packages/tl/scripts/generate-schema.js @@ -406,7 +406,10 @@ async function addDocumentation(obj) { let botsCanUse = !!$("h3:contains('Bots can use this method')") .length let onlyBotsCanUse = - botsCanUse && !!target.description.match(/; for bots only$/) + botsCanUse && ( + !!target.description.match(/[,;]( for)? bots only$/) + || target.throws.some((it) => it.code === 'USER_BOT_REQUIRED') + ) target.available = onlyBotsCanUse ? 'bot'