Answer- On desktop versions of Discord, you may designate attachments as spoilers by posting them and then checking the Mark as Spoiler option before pressing the send button. To post files via mobile, you must rename them as described in the preceding processes.