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))
def getUser(message):
match = re.search(r"^(@\w+:[^ :]+)", str(message))
if match:
return str(match.group())
else:
return "Quelqu'un"
#match = re.search(r"^(@\w+:[^ :]+)", str(message))
#if match:
# return str(match.group())
#else:
# return "Quelqu'un"
return message.sender
async def getNick(room, message): # Obtenir le DisplayName à partir du mxid.
sender = getUser(message)