plugin-hub icon indicating copy to clipboard operation
plugin-hub copied to clipboard

Create RNGStreet

Open bradoeoe opened this issue 1 year ago • 6 comments

Plugin for RNGStreet clan, currently the plugin just sends lootdrops/name/clan name etc as a json file for the data to be handled within our discord bot.

bradoeoe avatar Mar 16 '24 01:03 bradoeoe

New plugin rngstreet: https://github.com/bradoeoe/RNGStreet/tree/cddac2069f9e9ac403c0f1c2b1258b40d9242b96

If your discord bot is already reading JSON, could you not obtain this data by using the existing hub plugin Dink? loot drops/name/clan name are already sent via JSON to any url input that is not a discord webhook

Felanbird avatar Mar 16 '24 01:03 Felanbird

Oh does it? I wasn't able to get it to send via JSON. Just tried now and getting error codes for unsupported media type :(

bradoeoe avatar Mar 16 '24 01:03 bradoeoe

I would assume your JSON handling is wrong if you're getting that error, but here's an example JSON response from dink for a loot notif on a cow

{
   "type":"LOOT",
   "playerName":"felanbird1",
   "accountType":"NORMAL",
   "dinkAccountHash":"omitted",
   "clanName":"P i c k l e",
   "seasonalWorld":false,
   "extra":{
      "items":[
         {
            "id":526,
            "quantity":1,
            "priceEach":73,
            "name":"Bones"
         },
         {
            "id":2132,
            "quantity":1,
            "priceEach":101,
            "name":"Raw beef"
         },
         {
            "id":1739,
            "quantity":1,
            "priceEach":173,
            "name":"Cowhide"
         }
      ],
      "source":"Cow",
      "category":"NPC",
      "killCount":2
   },
   "embeds":[
      {
         "title":"Loot Drop",
         "description":"felanbird1 has looted: \n\n1 x [Bones](https://oldschool.runescape.wiki/w/Special:Search?search\u003dBones) (73)\n1 x [Raw beef](https://oldschool.runescape.wiki/w/Special:Search?search\u003dRaw%20beef) (101)\n1 x [Cowhide](https://oldschool.runescape.wiki/w/Special:Search?search\u003dCowhide) (173) \nFrom: Cow",
         "author":{
            "name":"felanbird1",
            "url":"https://secure.runescape.com/m\u003dhiscore_oldschool/hiscorepersonal?user1\u003dfelanbird1"
         },
         "color":15990936,
         "image":{
            "url":"attachment://lootImage.png"
         },
         "thumbnail":{
            "url":"https://static.runelite.net/cache/item/icon/1739.png"
         },
         "fields":[
            {
               "name":"Kill Count",
               "value":"```\n2\n```",
               "inline":true
            },
            {
               "name":"Total Value",
               "value":"```ldif\n347 gp\n```",
               "inline":true
            }
         ],
         "footer":{
            "text":"Powered by Dink",
            "icon_url":"https://github.com/pajlads/DinkPlugin/raw/master/icon.png"
         },
         "timestamp":"2024-03-16T01:54:46.967804900Z"
      }
   ]
}

Felanbird avatar Mar 16 '24 01:03 Felanbird

This is still failing to build. (did you not update the file in this PR?) Is this something you could utilize the Dink plugin for instead?

Nightfirecat avatar Apr 06 '24 03:04 Nightfirecat

Just tried now and getting error codes for unsupported media type :(

If you're still having trouble, we added more developer documentation to explain how to obtain the JSON payload from the multipart body in Dink

iProdigy avatar Apr 07 '24 02:04 iProdigy