feat: add README, .env.example, fix mention detection with spaces, add diensten to .gitignore
This commit is contained in:
parent
0e7272dadd
commit
a9459a16be
4 changed files with 150 additions and 2 deletions
|
|
@ -13,8 +13,11 @@ function isBotMentioned(message) {
|
|||
if (message._data?.mentionedJidList?.length > 0) {
|
||||
return true
|
||||
}
|
||||
if (message.body && message.body.toLowerCase().includes(`@${BOT_NAME}`)) {
|
||||
return true
|
||||
if (message.body) {
|
||||
const normalized = message.body.toLowerCase().replace(/\s+/g, '')
|
||||
if (normalized.includes(`@${BOT_NAME.replace(/\s+/g, '')}`)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
@ -32,6 +35,8 @@ async function handleWebhook(payload) {
|
|||
const dienstnummer = extractDienstnummer(message.body || '')
|
||||
if (!dienstnummer) return
|
||||
|
||||
console.log(`Processing dienst ${dienstnummer} for ${message.author}`)
|
||||
|
||||
const author = message.author
|
||||
if (!author) return
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue