witch;
use 5.020;
use Moo 2;
use experimental 'signatures';
use Carp 'croak';
use JSON 'encode_json', 'decode_json';
use POSIX 'strftime';
use Future::Utils 'repeat';
use Future::HTTP;
our $VERSION
my $f = $self->ua->http_request( POST => 'https://gql.twitch.tv/gql',
body => encode_json( $query ),
headers => {
# so far we need no headers
"Client-ID" =
)->then(sub( $body, $headers ) {
my $res;
if( $body ) {
$res = decode_json( $body );
} else {
return Future->done()
}
return Future->don