feat: enhance sender ID handling in Telegram channel
- Update sender ID construction to prioritize user ID while maintaining username for allowlist compatibility. - Improve allowlist checking in BaseChannel to support sender IDs with multiple parts separated by '|'.
This commit is contained in:
@@ -72,7 +72,14 @@ class BaseChannel(ABC):
|
||||
if not allow_list:
|
||||
return True
|
||||
|
||||
return str(sender_id) in allow_list
|
||||
sender_str = str(sender_id)
|
||||
if sender_str in allow_list:
|
||||
return True
|
||||
if "|" in sender_str:
|
||||
for part in sender_str.split("|"):
|
||||
if part and part in allow_list:
|
||||
return True
|
||||
return False
|
||||
|
||||
async def _handle_message(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user