examples/http-interactions.psgi

filter: Statementstmt 100% 16 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 21 / 21 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Discord/Client/REST/Error.pm ↑ Summary
1 1 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Discord::Client::HTTPInteractions;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # Verify signed HTTP requests without a Bot token or Gateway connection.
7 1 my $service = Discord::Client::HTTPInteractions->new( public_key => $ENV{DISCORD_PUBLIC_KEY}, );
8  
9 # Send the reply directly in the HTTP response.
10 $service->command(
11 ping => (
12 description => 'Replies with Pong',
13 1 ▶ handler => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
14 1 my ($interaction) = @_;
15  
16 # Return the reply Future so delivery failures remain visible to the dispatcher.
17 1 return $interaction->reply('Pong!');
18 },
19 1 ),
20 );
21  
22 # Return the application for a PSGI host to serve.
23 1 $service->psgi_app;
« blib/lib/Discord/Client/REST/Error.pm ↑ Summary