Skip to content

Instantly share code, notes, and snippets.

@sironekotoro
Created December 2, 2021 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sironekotoro/7a317642c58c8fafeae831e178899f53 to your computer and use it in GitHub Desktop.
Save sironekotoro/7a317642c58c8fafeae831e178899f53 to your computer and use it in GitHub Desktop.
Perl入学式用 Discord Webhook実習
#!/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