if "/ник" in msg:
nik0 = msg.split()
fragm0 = "/ник"
new_nicks0 = []
for word in nik0:
if fragm0 not in word:
new_nicks0.append(word)
nik01 = ' '.join(new_nicks0)
nick_me = nik01
vk_session.method('messages.send', {'chat_id':id, "message": f"ваш никнейм установлен: {nick_me}", 'random_id' : 0})