gpt4 book ai didi

javascript - Discord.js 从 URL 读取数据

转载 作者:行者123 更新时间:2023-12-03 00:51:47 33 4
gpt4 key购买 nike

我不知道如何从网址读取数据,例如从中获取文本

url = "https://pastebin.com/raw/k4dEkXCz"

我想像它所说的那样从中读取数据

最佳答案

答案:

const Discord = require("discord.js");
let snekfetch = require("snekfetch")

module.exports.run = async (bot, message, args) => {
let url = "https://pastebin.com/raw/k4dEkXCz"
snekfetch.get(url).then(r => console.log(decodeURIComponent(r.body)));
}

module.exports.help = {
name: "test"
}

关于javascript - Discord.js 从 URL 读取数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53013682/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com