pajlads / DinkPlugin

Sends level up, clue, etc. notifications to a Discord webhook or a custom web server
https://runelite.net/plugin-hub/show/dink
BSD 2-Clause "Simplified" License
33 stars 14 forks source link

Ability to filter and/or approve/deny webhooks. #407

Closed Osamu01 closed 5 months ago

Osamu01 commented 5 months ago

Checklist

Describe your Suggestion

Ability to filter(keywords etc) and/or approve/deny webhooks either based on a certain criteria or by RSN for clan leaders.

Reasoning

As a clan owner I like to allow as many people as possible to share their progress with us, so I share the discord webhook URLs between my clan, as do most clans. This can quickly turn sour, requiring a lot of blind maintenance to combat when someone attempts to use this exposed webhook maliciously & anonymously. When looking for a simple solution to approve/deny or filter webhooks I could only find self hosted options that required programming knowledge. I can think of a couple ways you could implement this solution:

  1. A discord bot and some tedious work to add approve/disprove buttons to each webhook before they're sent to a second channel/url (i don't know if this might be possible with just webhooks, don't think so)

  2. Some type of plugin-sided clan login that allows clan members/leaders to use the clan webhooks through the plugin without ever exposing said webhooks to the user.

Felanbird commented 5 months ago

This is the nature of how Discord webhooks work, there's nothing we can put in the plugin that can confirm itself to anything you wanted, Discord webhooks just don't have that sort of confirmation.

I personally would not want to host any form of discord bot or implement some sort of Discord auth, since Discord is known replace their API often, which would require us to constantly keep it updated. Also I believe they've heavily restricted new bots that want to be in like any discords, these days.

As you mentioned the plugin can already handle this perfectly externally, e.g. we the devs personally use our data and parse it into a Twitch bot, drop any non-standard notifs or any ones we don't want to display (anything under 100k, GE notifs, etc.) donk

Unfortunately it seems more like the correct approach is to lock up the webhook URL to only trusted users with Discord permissions, if no coding knowledge is available.

APKiwi commented 5 months ago

@Osamu01 if you're writing a discord bot to achieve 1. on your suggestion (I'm not sure something like this exists) you're better off automating it as Felanbird have done on twitch.

I've set up a custom discord bot that filters different clans into different channels depending on which one they're in on OSRS using the additional JSON data provided with events. You can then maintain a configurable (by admins) channel <-> clan list which as well as blacklist (or I suppose flip to whitelist) people you want notifications for. Lots of things are possible if you start to dive into this space, but as you say this would require some basic programming knowledge to achieve

Osamu01 commented 5 months ago

That's very unfortunate. Like I said I just figured it's a common use case, and the extra layer of security for clans would've been heavily appreciated but I digress I understand your thoughts and won't argue beyond my initial suggestion. I do think this is a very nice plugin regardless. Hope to see something relative in the future though.

Just for reference though, I do understand how discord webhooks work. Figuratively I meant doing something like having it send to a bots webhook URL for approval, then having the bot forward said webhook to a different URL. I'm not much of a programmer so I may be explaining it wrong.

I did look for solutions online and most of them are akin to what you guys have set up, but those options aren't very intuitive so I thought you guys might've been able to think of a solution. Perhaps someday! Have a nice one.

iProdigy commented 5 months ago

Unfortunately it's not possible for us to address this use case within dink itself - instead it requires some programming knowledge as has been pointed out

For example, one could leverage cloudflare workers or AWS lambdas to receive dink webhooks and forward them to the appropriate discord channel if it meets your desired criteria (e.g., min loot value, account name in allowlist). I'd love to provide a template for everyone to use that achieves this, but unfortunately don't have the spare time rn