I can't figure out how to read data from a url like get the text from it such as
url = "https://pastebin.com/raw/k4dEkXCz"
andI want to read data from it like what it says
Answer:
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"
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.