feat(informer): 🚸 make entity search case insensitive
This commit is contained in:
parent
69b1ab0b0b
commit
3379f75ab9
|
@ -116,12 +116,12 @@ function item(
|
|||
return item
|
||||
}
|
||||
|
||||
function entity(name) {
|
||||
const entity = typeof name === "string" ? bot.nearestEntity((entity) => {
|
||||
const ename = entity.name || entity.username
|
||||
return name && ename ? ename == name : true
|
||||
}) : entity
|
||||
console.log(entity)
|
||||
function entity(name = bot.nearestEntity()) {
|
||||
const entity = typeof name === "string" ? (name = name.toLowerCase()) && bot.nearestEntity((entity) => {
|
||||
const enames = [entity.username?.toLowerCase(), entity.name, entity.displayName?.toLowerCase()]
|
||||
return enames.includes(name)
|
||||
}) : name
|
||||
console.log("info entity:", entity)
|
||||
if (!entity) {
|
||||
quiet || bot.chat("no entity")
|
||||
return entity
|
||||
|
|
Loading…
Reference in New Issue
Block a user