【发布时间】:2021-07-03 21:51:17
【问题描述】:
我想通过令牌而不是机器人和 curl 来发送消息并获取它 像python中的这个 Using Python Requests to Send Discord Messages
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://discord.com/api/v8/channels/YOURID/messages");
curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'authorization' => 'YOURTOKEN']);
curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode(['content' => 'hello world']));
curl_exec($ch);
上面的代码返回未授权
【问题讨论】:
-
那么,你的question 是什么?
-
你可以在下面看到它