streamdeck-discord-message
streamdeck-discord-message copied to clipboard
Post as Actual User
This was asked for in an Issue posted to the other Discord plugin.
@cnschu do you still want/need this?
In any case this one's a bit of a pickle as the entire point of using webhooks was to avoid having to authenticate to the Discord Web API and thus have to keep track of and properly refresh OAuth tokens
I can give a use case where this would be great.
I was hoping to use your plugin to interact with the Avrae bot, which is a D&D bot that does all sorts of stuff (say, roll a virtual d20). I got this plugin to post messages into the channel the Avrae bot is listening on, but it was ignoring all of the messages. When I talked to the Avrae support group, they have the bot built to ignore messages from other bots. Since a webhook message shows up as a bot message, it doesn't work.
With this feature (send as the user) I could use my deck to have buttons for each type of roll or function. Or even better, i could chain commands and have it pop up Discord over my webcam via OBS, do the roll, sleep for X seconds, then go back to the webcam.
Tracking the OAuth tokens seems like it'd be super deep or even not possible with the plugin architecture, though I've only just started to scratch the surface of it. But it'd be very cool if it were possible.
@cnschu do you still want/need this?
no, no longer needed.
I can give a use case where this would be great.
I was hoping to use your plugin to interact with the Avrae bot, which is a D&D bot that does all sorts of stuff (say, roll a virtual d20). I got this plugin to post messages into the channel the Avrae bot is listening on, but it was ignoring all of the messages. When I talked to the Avrae support group, they have the bot built to ignore messages from other bots. Since a webhook message shows up as a bot message, it doesn't work.
With this feature (send as the user) I could use my deck to have buttons for each type of roll or function. Or even better, i could chain commands and have it pop up Discord over my webcam via OBS, do the roll, sleep for X seconds, then go back to the webcam.
Tracking the OAuth tokens seems like it'd be super deep or even not possible with the plugin architecture, though I've only just started to scratch the surface of it. But it'd be very cool if it were possible.
best solution here is to talk to the dev of avrea to no longer ignore other bots.
Yeah my thinking was that I'd need to deploy a small web application to handle the tokens and then I'd have to worry about stuff like CSRF. The alternative I've been looking into is work that others have been doing on running things like node within the plugin architecture but not sure how well that's supported presently or going forward
I actually came to this repo thinking that this plugin could handle this. Using it on discord posting as some kind of BOT, is a no go. So what is the problem with API tokens? I see a lot of plugins using API tokens...
I actually came to this repo thinking that this plugin could handle this. Using it on discord posting as some kind of BOT, is a no go. So what is the problem with API tokens? I see a lot of plugins using API tokens...
It's not impossible to do, it's just more trouble than I think it's worth given that I just made this in a bit of spare time to make announcements when I stream (because Discord bots that do it automatically are way too slow).
Could you please provide some concrete examples of plugins that work with OAuth tokens for Discord or other APIs? Maybe some repositories I can look at to see how other plugins do it?
I mostly just want to avoid having to run a public web service just to handle OAuth flows. Using webhooks lets me not have to deal with that but with the caveat that the message is considered as coming from a bot account.
Could you please provide some concrete examples of plugins that work with OAuth tokens for Discord or other APIs? Maybe some repositories I can look at to see how other plugins do it?
I think I saw it in some of the crypto exchange rate plugins, where they require a different key for every broker. But perhaps it was not an OAUTH, but just an API key? So maybe I was wrong.
Yes if it's just an API key I can just ask the user to provide it (just as I do the webhook URL presently) and store it locally in the plugin which would be much simpler.
An OAuth flow requires a bit more care and I haven't seen examples of plugins that handle it properly. The plugin runs completely locally at the moment and doesn't run its own webserver or anything like that so I have nothing to provide Discord for an OAuth redirect 🤔
runs completely locally ... and doesn't run its own webserver ... so I have nothing to provide Discord for an OAuth redirect
Interesting, maybe we can think of an option to connect to own or external server if available?
For reference, the other Discord plugin that I am aware of requires users to create their own application with Discord and then provide both the app ID and the client secret as properties on the Stream Deck button.
This could feasibly be implemented in this plugin and I think it would even be possible to use the same Discord application for both plugins, which would make configuration easier for users that are already using the other plugin on their deck.
That plugin is here, for reference: https://github.com/fredemmott/StreamDeck-Discord
The README has brief instructions for the user on how to create the application and provide its information to the plugin.
I would also like a feature like this! I was hoping to control the groovy music player bot in this way, but that bot seems set to ignore messages posted by bots.