I would recommend either doing a tree search (BdApi and the library have such utilities), or something like getNestedProp from the library. This way if something goes wrong or if the structure slightly changes it doesn't just error out and can be handled gracefully or even still work.
In the plugin you use a very volatile patch that could cause rending issues when the structure is changed by discord. https://github.com/TheCommieAxolotl/BetterDiscord-Stuff/blob/58ba0f046e04f93cac647d430e6e15a15958e8c3/PreviewMessage/PreviewMessage.plugin.js#L114
I would recommend either doing a tree search (BdApi and the library have such utilities), or something like
getNestedProp
from the library. This way if something goes wrong or if the structure slightly changes it doesn't just error out and can be handled gracefully or even still work.