mirror of
https://github.com/agessaman/meshcore-bot.git
synced 2026-07-20 18:41:06 +00:00
feat: Update banned user handling to support prefix matching
- Modified configuration examples to clarify that banned users are now identified by sender names using prefix matching. - Implemented a new method in CommandManager to check if a user is banned based on prefix matching, enhancing the bot's ability to ignore messages from banned senders. - Updated message handling logic to utilize the new prefix matching functionality for improved user management.
This commit is contained in:
@@ -1966,8 +1966,8 @@ class MessageHandler:
|
||||
if not self.bot.config.getboolean('Bot', 'enabled'):
|
||||
return False
|
||||
|
||||
# Check if sender is banned
|
||||
if message.sender_id and message.sender_id in self.bot.command_manager.banned_users:
|
||||
# Check if sender is banned (starts-with matching)
|
||||
if self.bot.command_manager.is_user_banned(message.sender_id):
|
||||
self.logger.debug(f"Ignoring message from banned user: {message.sender_id}")
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user