Hello guys, I have a problem and I do not know what to do. I was trying to have a command that works like so
–> !beer then it will return $(User) + random generated phrase from php file.
Unfortunately it only returns the result of one phrase per (twitch channel) chat. This means that the custom command only checks and remember api result without updating every time the command is used.
Code: $(user) $(customapi http://icelf.net/uploads/test.php?channel=noobinthecage&limit=5)
The php file generates one random phrase and works without issue in browser.
Looks like I have to find a way to make the php file clear cache =/ I have tried so many things
// First convert the request URI to a hexadecimal number, via the md5 hash
$num = md5($_SERVER[‘REQUEST_URI’]);
// Next, shorten it so the number isn’t too big, and convert it to decimal
$num = hexdec(substr($num, 27)); // this gives us a number between 0 and 65,535
// Now, convert it to a range between 0 and 5 by taking the modulus
$num = $num % 6;
// Add one…
$num++;
// And use the same switch statement we used before to achieve our desired result…
switch ($num) {
case 1:
echo “was killed by alcohol poisoning.”;
break;
case 2:
echo “started dancing seriously with a rapy look.”;
break;
case 3:
echo “just wants to die now…”;
break;
case 4:
echo “is off to see a wizard”;
break;
case 5:
echo “started licking the floor.”;
break;
case 6:
echo “WTF MAN???”;
}
?>