sub discord { use LWP; use HTTP::Request; use JSON; my ($_a) = @_; my ($_r); my $_msg = { 'username' => 'chsm-ext', 'content' => $_a, }; my $_json = JSON->new->allow_nonref; my $_ua = LWP::UserAgent->new; my $_req = HTTP::Request->new(POST => 'https://discord.com/api/webhooks/'.$app->{'discord'}); $_req->content_type('application/json'); $_req->header("User-Agent" => "Perl Discord HookBot"); $_req->content($_json->encode($_msg)); $_r = $_ua->request($_req); return $_r; }