How to get nickname of the message from chat in channel?

This part is not working?

listQuery?.loadPreviousMessages(withLimit: 10, reverse: true, completionHandler: { (messages, error) in ....

If you don’t want that warning message, you can call:

print(error.debugDescription)

To print messages (simple demo):

guard let messages = messages else {
    print("Error recovering messages")
    return
}
for msg in messages {
    print(msg.message)
}