首页 > 解决方案 > 从 discord.js 运行 php 网页

问题描述

我正在制作一个机器人,如果您执行 /run,它将发出 api 请求并启动基于 Web 的操作,但我需要从 node.js 命令运行页面,我目前拥有的是

 var request = require('request');
 request('http://example.com/?ip=xxx-xxx-xxx', function (error, response, 
  body) {
   if (!error && response.statusCode == 200) {
    console.log(body) // Print the google web page.
 }
 })

但这似乎不起作用......

我该怎么做呢?

编辑:这是 cloudflare 阻止访问

标签: phpnode.js

解决方案


推荐阅读