I do not see anything in your example which shows how the text was chosen to be applied to petra. How does the "you are not welcome" reason get attached to Petra? is it randomly chosen from many items in the text file? Or is it the text attached to the ID 12345? Can 2 different people have the same text attached to 2 different ID numbers, or does 12345 for everyone always mean that same text?

Does the bot need to remember all the bans after restarting itself? Or only after it reconnects to the server?

How should the bot forget the ban, by being told to forget the ban against a host, or forget an ID number, or other way?