This exploit works by appending a malicious visual basic script to the end of an image file. Once that image has been sent through Discord, any user that views it will be affected, as Discord's caching system requires it to be written to the disk. From there, Windows Defender scans the file and detects the visual basic script as malware.
Credits to Foggylight27 for finding this.