multiple user ids for bot api
This commit is contained in:
1 parent
870118d5ab
commit
31d03bcb14
8 files changed
+59
-44
No files matched your search
@@ -151,7 +151,11 @@ export class BotManager {
|
||||
|
||||
console.log('[BOT] Message from', fromId, ':', text, 'payload:', payload);
|
||||
|
||||
if (this.settings.userId && fromId.toString() !== this.settings.userId.toString()) {
|
||||
const allowedIds = this.settings.userId
|
||||
.split(',')
|
||||
.map((id) => id.trim())
|
||||
.filter((id) => id.length > 0);
|
||||
if (allowedIds.length > 0 && !allowedIds.includes(fromId.toString())) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user