Is there anyway to mark images as spoiler?

佐手、 提交于 2020-01-15 09:30:56

问题


The new discord update added the feature to mark images and text as spoilers for text: you just have to type || text ||. For images, there is a check mark at the bottom of the attachment prompt:

Is there a way to mark images as spoiler or is the feature too new?

This does not work:

let image = new Attachment('./img/image.jpg'); 
message.channel.send("|| " + image + " ||");`

回答1:


a quick way of doing it would be starting the filename with SPOILER_ for example img.png would become SPOILER_img.png




回答2:


This is what the API has listed for the image for embeds and it doesn't seem to mention marking as a spoiler so perhaps it is yet to be added for bots. I can't find anything about spoilers in the API, maybe you'll have more luck.




回答3:


    message.channel.send({
        files: [{
          attachment: 'IMG LINK',
          name: 'SPOILER_NAME.jpg'
        }]
      })


来源:https://stackoverflow.com/questions/54476198/is-there-anyway-to-mark-images-as-spoiler

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!