Created
December 2, 2021 05:19
-
-
Save sironekotoro/7a317642c58c8fafeae831e178899f53 to your computer and use it in GitHub Desktop.
Perl入学式用 Discord Webhook実習
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use HTTP::Tiny; | |
use JSON::PP; | |
my $webhook_url = 'ここに貼り付ける'; | |
my $options = { | |
headers => { 'Content-Type' => 'application/json'}, | |
content => JSON::PP->new()->encode({ content => 'Hello, Discord!' }), | |
}; | |
my $response = HTTP::Tiny->new()->post( $webhook_url, $options ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment