首页 > 解决方案 > 用于将图像从 Imgur 拉到不和谐机器人中的 API

问题描述

我正在尝试制作一个从 imgur 中提取图像的 API,以便使用 python 通过 discord bot 运行它们,然后在 discord 服务器中发布该图像。我有一些编码经验,但以前从未制作过 API,我希望得到任何建议或帮助。

我需要编写从 imgur 中提取图像的 api,以便将其输出到网站上,用作 discord bot 的 webhook

在此先感谢您的宝贵时间,祝您早、中、晚或夜愉快。

标签: javascriptapidiscordimgur

解决方案


Discord.js 在他们的文档中给出了几个例子来说明如何做到这一点TextChannel.send

https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=send

// Send a remote file
channel.send({
  files: ['https://cdn.discordapp.com/icons/222078108977594368/6e1019b3179d71046e463a75915e7244.png?size=2048']
})
  .then(console.log)
  .catch(console.error);

推荐阅读