Your best bet would be storing all message data you want together with the message ID into a database of some kind for every sent message and then getting the info from that database using the message ID you get from the on_raw_message_delete
event. That effectively would make your cache persist over restarts, although will use up more and more disk space.