Add feature to fire external plugin messages
Checklist
- [x] I've searched the issues and pull requests for similar looking suggestions.
- [x] I've checked the
Unreleasedsection of the changelog for newly added features that sound like my suggestion.
Describe your Suggestion
Whenever for example the Death notification would be fired according to the config, let Dink also fire a an external plugin notification request with all the corresponding data that's normally sent through a Discord webhook. An option to only fire the external plugin request, only the Discord webhook or both could be added to each notifier or just as a global config option for all notifiers.
Reasoning
This would allow my future plugin and a lot of other potential plugins to benefit from the already well-established Dink notifiers for the goal of sending game event notifications to other platforms.
You can already include non-discord URLs to get the relevant event data: https://github.com/pajlads/DinkPlugin/blob/master/docs/json-examples.md#deaths
Or am I misunderstanding your request?
I tried this approach at first. Unfortunately, the platform I'm trying to send notifications to requires a slightly different format and some additional data that has to be configured by the user.
To illustrate the problem, here's the streamerbot api for http requests. https://docs.streamer.bot/api/http/requests/do-action
A request to the streamerbot application must contain the data "name" and "id" of a user-defined action within streamerbot. So my idea was to take in Dink's notifications with their data through the event bus and to let my plugin redirect it in the appropriate format to streamerbot with with the added action name and action id. I feel like this is the most practical and clean way of doing it, since it will all happen within runelite and I'll be able to benefit from all the work that's already been done in Dink.
I'm open to supporting this, essentially letting other plugin hub plugins piggyback off of our notifier logic. I can see this working in two ways:
- Any notifier event, regardless of whether it would fire a Dink notification, would trigger a plugin message. I can see this being problematic for common events such as Loot or Chat message events.
- Only notifier events that would fire a Dink notification triggers a plugin message. This could mean that the plugin message usage is more limited as you might need to ask the user to configure Dink before it would work for your plugin, unless we allow customization for pluginmessage limitations separately from Dink Discord/Webhook notifications.
Could you give as many examples as possible for what would be useful to your usecase @DarockObama ?
I feel like method 2 would be the most logical as the intended way, by explaining to the user how to set up Dink in the documentation of whatever plugin that wants to make use of Dink notifiers. For my usecase I'm thinking of following examples:
- Playing an animation on in-game death in OBS, possibly with the killername included, which is triggered by Streamerbot, which in turn is triggered by my plugin which will use Dink. Having the options to exclude deaths in certain places, which Dink already allows, could be useful.
- Having the Streamerbot Twitch chatbot react to certain phrases mentioned in game, which is why I think the second approach is more useful, since the user should be able to configure this within Dink.
- Letting OBS play animations depending on what loot/pet the player receives, where Dink's options to limit it to certain loot is also useful.
- Updating global variables within Streamerbot on loot received, for things such as !today commands on Twitch, where you'd also want the notification to only fire on certain loot.
- Updating boss personal best times as global variables and/or playing animations when this happens.
None of these usecases should require the screenshot to be included from Dink.
Since all of these usecases require a lot of work to set up from the user on the Streamerbot end anyway, it's completely reasonable to expect from the users to configure the individual Dink notifiers they have in mind. I will do my best to provide all the necessary guidance in the documentation.
On the other hand, the first aproach would still be perfectly fine, since in this case I could simply build the same config options in my own plugin, which would make the user experience more contained in a single plugin. I do prefer the second approach though, since this would allow my plugin to be a lot simpler.
In my case, I will be solely using Dink's external pluginmessage feature if it is added. I think it is therefore useful to at least have the option to only fire external pluginmessages for each notifier, or just globally for all notifiers.
I hope this was somewhat informative. Let me know if you'd like to know more!
This could also be useful for https://github.com/TimLehner/runelite-save-replay-buffer-for-obs-plugin