Live changing the avatars of a chatbot

Good afternoon, I’ve been trying to implement a system in which depending on the user’s input, the avatar of the messages from the bot changes, meaning that when saving the message it should be also with its specific avatar. But im finding trouble with implementing it, is there any way of changing the avatar on only one message in the history? If not I might be able to append an emoji or an image to each response, but i’d rather not resort to that.

Thanks in advance.