fix(tl): improved bot-only methods detection

This commit is contained in:
teidesu 2021-05-16 02:07:23 +03:00
parent 97ba7652ff
commit f45b602423

View file

@ -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'