generated from Nemesis/Exemple
simplifier getUser
This commit is contained in:
parent
7db29e46c0
commit
179561c3df
1 changed files with 6 additions and 5 deletions
11
asmodee.py
11
asmodee.py
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue