Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

RFC: new module WebService::Discord::Webhook

by hornpipe2 (Acolyte)
on Sep 03, 2019 at 16:34 UTC ( #11105518=perlmeditation: print w/replies, xml ) Need Help??

I originally posted this to Reddit, which directed me here.

First, the Github link: https://github.com/greg-kennedy/p5-WebService-Discord-Webhook

The Discord chat service allows server ops to create "webhook"s for their server. These are special secret URLs that allow an external client to post notifications into chat by making certain HTTP requests.

(For those unfamiliar with Discord, think "Slack, if it chugged a 12 pack of Mountain Dew".)

I created this Perl module as a way to help interact with Discord webhooks. The various functions of Webhooks are wrapped in Perl functions that execute with HTTP::Tiny, and data structures with JSON::PP. I tried to focus on ease of use and documentation.

I would appreciate it if anyone could provide feedback or check the code and see if it looks sensible. I do plan to submit this to CPAN and it would be my first module there, so I want to make sure I get it right!

EDIT: also on PrePAN now: http://prepan.org/module/nYmTLYacoXW

EDIT2: Nobody had complaints except the names... no news is good news, I guess. It's on CPAN now.

  • Comment on RFC: new module WebService::Discord::Webhook

Replies are listed 'Best First'.
Re: RFC: new module WebService::Discord::Webhook
by holli (Monsignor) on Sep 03, 2019 at 18:00 UTC
    Bad name. You wrote a client, yet you name it service. That's super confusing.


    holli

    You can lead your users to water, but alas, you cannot drown them.

      To make this even more confusing, a "Web hook" is usually a URL on your server that receives requests as a result of events somewhere else. Discord is using the term almost completely differently to refer to an HTTP API for posting notifications to Discord chats, instead of a mechanism for receiving events from Discord at some chosen URL.

      Unless Discord intends for these API URLs to be set as "Web hooks" in other services and produce notifications in a Discord chat?

      I would suggest a name more like WebService::Discord::Notifier.

      Haha. The one comment I've gotten on Reddit was to change the name to this (from Net::Discord::Webhook) - the PAUSE guide recommends using either WWW or WebService when referring to modules that interoperate with a web-based service.

      Two hardest problems in computer science, indeed...

        Yeah well, then, just append append something to furher qualify the real nature? Ideas:
        WebService::Discord::Webhook::(Client|Interface|Call|SendTo)


        holli

        You can lead your users to water, but alas, you cannot drown them.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://11105518]
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2019-12-13 20:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?