私はこの Javascript を HTML 内に作成し、友人がホストしています。それは完全に機能するので、コードとは関係ないと思います:
var deaths = [
"with a potato.",
"by using a truck and running them over.",
"with a gun, bang bang.",
"by stuffing a mouldy lemon in their mouth.",
"by throwing multiple knives at them.",
"by throwing them off a building onto a cactus.",
"by tying them up and forgetting about them.",
"by using mind control and making them walk into lava."
//"",
//"",
//"",
//"",
//"",
//"",
//"",
//"",
//"",
//"",
//"",
//"",
//"",
//"",
];
var death = deaths[Math.floor(Math.random() * deaths.length)];
document.write(death)
私は、twitch tvのボットであるnightbotのコマンドを作成しています。コマンドでは、上記のjavasciptで作成されたWebページからテキストを取得します。私はこれ$(customapi URL)
をコマンドで使用していますが、コマンドを実行すると「[API は 400 文字未満を返す必要があります]」を返します。