Make it simple: message your bot your new nickname when you change it and let him store it in some variable and then use it. That will work in all cases.