.BANCHO. Log username changes to user notes in RAP

This commit is contained in:
Nyo 2016-12-28 12:16:46 +01:00
parent 8f156a0702
commit 22ae4c332b
1 changed files with 1 additions and 0 deletions

View File

@ -6,6 +6,7 @@ from objects import glob
def handleUsernameChange(userID, newUsername, targetToken=None):
try:
userUtils.appendNotes(userID, "-- Username change: '{}' -> '{}'".format(userUtils.getUsername(userID), newUsername))
userUtils.changeUsername(userID, newUsername=newUsername)
if targetToken is not None:
targetToken.kick("Your username has been changed to {}. Please log in again.".format(newUsername), "username_change")