Git Product home page Git Product logo

anyevent-slackrtm's People

Contributors

afresh1 avatar commojun avatar ivanbutorin avatar robn avatar skaji avatar zostay avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

anyevent-slackrtm's Issues

Document diagnostic messages

None of the error messages that this module can send out are documented. That's not good. How can someone catch the messages and react appropriately if they are not documented?

add support to handle slack rtm replies

No current way i can see to handle slack replies

see "Handling responses" at https://api.slack.com/rtm

Once the JSON has been sent to the server visual clients should immediately display the text in the channel, grayed out or otherwise marked to indicate that it is "pending". At some point after that, usually a few milliseconds later, the server will send a confirmation that the message was received:

{
"ok": true,
"reply_to": 1,
"ts": "1355517523.000005",
"text": "Hello world"
}

this code adds a 'type' to these so we can register a 'reply' handler:

$ diff -u /tmp/AnyEvent-SlackRTM-1.1/lib/AnyEvent/SlackRTM.pm lib/perl5/AnyEvent/SlackRTM.pm
--- /tmp/AnyEvent-SlackRTM-1.1/lib/AnyEvent/SlackRTM.pm 2019-10-04 05:01:17.000000000 +1000
+++ lib/perl5/AnyEvent/SlackRTM.pm      2020-11-26 14:41:42.432644470 +1100
@@ -163,6 +165,7 @@
         my $message = $raw->body;
         croak "unable to decode incoming message: $message";
     };
+    $msg->{type} = 'reply' if (! $msg->{type} && $msg->{reply_to});

     # Handle errors when they occur
     if ($msg->{error}) {

proxy support missing

module does not work for me behind a proxy (when ENV variables set for https_proxy etc)

fix:

$ diff -u /tmp/AnyEvent-SlackRTM-1.1/lib/AnyEvent/SlackRTM.pm lib/perl5/AnyEvent/SlackRTM.pm
--- /tmp/AnyEvent-SlackRTM-1.1/lib/AnyEvent/SlackRTM.pm 2019-10-04 05:01:17.000000000 +1000
+++ lib/perl5/AnyEvent/SlackRTM.pm      2020-11-26 14:41:42.432644470 +1100
@@ -45,6 +45,8 @@
         agent => "AnyEvent::SlackRTM/$VERSION",
     );

+    $furl->env_proxy();
+
     my $res = $furl->get($START_URL . '?token=' . $self->{token});
     my $start = try {
         decode_json($res->content);

The ping-pong test is failing sometimes

For whatever reason, the ping-pong test is consistently failing on the Perl 5.14 test on Travis-CI. Whether this is because it's the first one that runs each time around or some quirk of 5.14, I do not know.

Add slack test support to the github action

I used to be able to test against my test slack instance using travis CI. However, this depended on legacy slack bot tokens and this needs to be updated to support the new system that has access token and refresh token. I haven't really looked into this.

I can generate the necessary tokens easily enough, but something will need to perform the refresh action and I haven't looked into that part.

Undefined value used as hash reference in ping() method

The start() method automatically adds an AnyEvent->timer callback that invokes ping(). However, it passes no arguments which leads the ping method to attempt dereferencing an undefined value when constructing the message hashref that is passed to send().

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.