Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send pure JSON information to bots/api's #36

Open
MathieuDR opened this issue Oct 8, 2021 · 3 comments
Open

Send pure JSON information to bots/api's #36

MathieuDR opened this issue Oct 8, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@MathieuDR
Copy link
Collaborator

It would be nice to have a way to intject our own API's and bot that could consume this information, which opens a lot of avenues.

I envision it having a new field just like the webhooks that would only send some information in a json format for example

 {
 	"player": {
 		"name": "erkendrserke",
 		"type": "HARDCORE_IRONMAN",
 		"iconUrl": "https://oldschool.runescape.wiki/images/b/b8/Hardcore_ironman_chat_badge.png"
 	},
 	"source": {
 		"name": "Basilisk Knight",
 		"wikiUrl": "https://oldschool.runescape.wiki/w/Basilisk_Knight",
 		"level": 204
 	},
 	"item": {
 		"name": "Basilisk jaw",
 		"wikiUrl": "https://oldschool.runescape.wiki/w/Basilisk_Jaw",
 		"price": {
 			"GE": 16185474,
 			"HA": 300000
 		},
 		"quantity": 1
 	},
 	"rarity": {
 		"oneIn": 5000,
 		"percentage": 0.02
 	}
 }

or

 {
 	"player": {
 		"name": "erkendrserke",
 		"type": "HARDCORE_IRONMAN",
 		"iconUrl": "https://oldschool.runescape.wiki/images/b/b8/Hardcore_ironman_chat_badge.png"
 	},
 	"source": {
 		"name": "Theatre of Blood",
 		"wikiUrl": "https://oldschool.runescape.wiki/w/Special:Search?search=Theatre%20of%20Blood"
 	},
 	"item": {
 		"name": "Runite ore",
 		"wikiUrl": "https://oldschool.runescape.wiki/w/Runite_ore",
 		"price": {
 			"GE": 11124,
 			"HA": 1920
 		},
 		"quantity": 62
 	},
 	"rarity": {
 		"oneIn": 10,
 		"percentage": 10
 	}
 }
@MathieuDR MathieuDR added the enhancement New feature or request label Oct 8, 2021
@MathieuDR MathieuDR self-assigned this Oct 8, 2021
@MathieuDR MathieuDR removed their assignment Oct 12, 2022
@APKiwi
Copy link

APKiwi commented Mar 12, 2023

This option would be perfect for my use case also.

Especially as currently multiple POSTs are sent per drop (say in example your GP threshold is set to '1', three posts would be made, one with big bones, one with a bandos godsword, and one with a screenshot). Having this all in JSON to be consumed, rather than trying to stitch together three webhook calls would be phenomenal.

I'm also guessing the image/screenshot might be of added complexity though.

@iProdigy
Copy link
Contributor

In Dink, we have an extra field included in all webhook bodies to include metadata like looted items: https://github.com/pajlads/DinkPlugin#loot - does this meet your use case @APKiwi ?

@APKiwi
Copy link

APKiwi commented Mar 12, 2023

@iProdigy this is fantastic. I will begin writing a solution that is integrated by Dink. I've already shared it with my discord.

This needs more publicity - its a pain having multiple plugins for each 'type'. This is very elegant, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants