1. I have a hook method that returns a string, in that method I am using a web request to get a string. Is it possible to delay the methods return until the webrequest has finished processing so I can return the string I pull from the webrequest?
     
  2. Wulf

    Wulf Community Admin

    Yes, take a look at my Slack and Babel plugins and the plugins using them. You can have a callback inside your plugin that is triggered from the webrequest, and also a callback/Action that is sent back to a plugin if it originated from another.
     
  3. Ok thanks I'll take a look
     
  4. @Wulf, can I get the response using a normal hook call without the direct reference to the plugin?
    Ex. Slack.Call("...", "...");
     
  5. Wulf

    Wulf Community Admin

    I'm not sure, but testing that now as I encountered an issue with the direct method.
     
  6. Wulf

    Wulf Community Admin

    Here ya go @k1lly0u:
    Code:
                Action<bool> callback = response =>
                {
                    if (player.ConnectedPlayer == null) return;
                    player.Reply(response ? Lang("ReportSent", player.Id) : Lang("ReportFailed", player.Id));
                };
                Slack.Call("TicketMessage", string.Join(" ", args), player, channel, callback);
     
  7. Legend, thanks :)