javascript - 用于将图像从 Imgur 拉到不和谐机器人中的 API
问题描述
我正在尝试制作一个从 imgur 中提取图像的 API,以便使用 python 通过 discord bot 运行它们,然后在 discord 服务器中发布该图像。我有一些编码经验,但以前从未制作过 API,我希望得到任何建议或帮助。
我需要编写从 imgur 中提取图像的 api,以便将其输出到网站上,用作 discord bot 的 webhook
在此先感谢您的宝贵时间,祝您早、中、晚或夜愉快。
解决方案
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);
推荐阅读
- python - 当函数参数是列表时,python panel.interact 不创建 UI 小部件
- json - 为什么 grpc-gateway 生成字符串字段而不是 int 或 float?
- r - 如何运行回归,其中每个处理批次具有不同的匹配对照批次?
- amazon-s3 - 如何在加载 S3 时自动推断 CSV 文件的架构?
- javascript - react setState Hook 并不总是更新对象
- amazon-web-services - 带有 Terraform 的 AWS Glue 管道
- javascript - 无法读取未定义的 vuejs 组件的属性“stripeTokenHandler”
- javascript - 在 AngularJS 的父组件和子组件中获取相同数据的最有效方法?
- java - 从垂直数组中获取单个列表并水平存储它们
- arduino - 使用 Arduino 进行 3.7V 锂电池电量检查