simplifier getUser

This commit is contained in:
nemesis 2025-11-11 22:50:39 +01:00
parent 7db29e46c0
commit 179561c3df

View file

@ -700,11 +700,12 @@ def getMessage(message):
return(str(message)) return(str(message))
def getUser(message): def getUser(message):
match = re.search(r"^(@\w+:[^ :]+)", str(message)) #match = re.search(r"^(@\w+:[^ :]+)", str(message))
if match: #if match:
return str(match.group()) # return str(match.group())
else: #else:
return "Quelqu'un" # return "Quelqu'un"
return message.sender
async def getNick(room, message): # Obtenir le DisplayName à partir du mxid. async def getNick(room, message): # Obtenir le DisplayName à partir du mxid.
sender = getUser(message) sender = getUser(message)