Bot can't write messages even though the account isn't banned

Yes.

If you or your library is not sending the correct line endings then the PRIVMSG not succeed.

Source code might help