vent::Discord::Payload;
use AnyEvent::WebSocket::Client;
use Data::Dumper;
use JSON qw(decode_json encode_json);
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Headers;
our $VERSION =
body'});
my $payload;
try {
$payload = AnyEvent::Discord::Payload->from_json($message->{'body'});
} catch {
$self->_debug($_);
return;
};
content) {
return $self->_discord_api('POST', 'channels/' . $channel_id . '/messages', encode_json({content => $content}));
}
method typing($channel_id) {
return AnyEvent->timer(
af
use v5.14;
use Moops;
class AnyEvent::Discord::Payload {
use JSON qw(decode_json encode_json);
our $VERSION = '0.1';
has version => ( is => 'ro', isa => Str, default => $VERSION );
has op =
od from_json($class: Str $json) {
$class->new(decode_json($json));
}
method from_hashref($class: HashRef $ref) {
$class->new($ref);
}
method as_json() {
return encode_json({