diff --git a/chat/command.go b/chat/command.go index 49c8b7f..f6aa9bd 100644 --- a/chat/command.go +++ b/chat/command.go @@ -155,7 +155,11 @@ func InitCommands(c *Commands) { } oldID := member.ID() - member.SetID(SanitizeName(args[0])) + newID := SanitizeName(args[0]) + if newID == oldID { + return errors.New("new name is the same as the original") + } + member.SetID(newID) err := room.Rename(oldID, member) if err != nil { member.SetID(oldID)