Webhook for Installation Middleware #8092
Unanswered
The-LukeZ
asked this question in
API Feature Requests & Ideas
Replies: 1 comment 4 replies
-
|
What you're describing is already possible by enabling auth code grant, see https://discord.com/developers/docs/topics/oauth2#advanced-bot-authorization Python code to handle it for reference: https://github.com/xelA/invite |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It would be great to have some sort of "middleware" for Discord to call before the bot being installed on a guild or user.
I imagine it like this:
User has Authorization Modal open and completes the flow.
Before the app is being added to the guild or user, the configured webhook endpoint gets called
If the Webhook responds with a 200 OK, then everything proceeds as usual. If it responds with 403 Forbidden and a json payload like
{ error: "You are banned from using the bot for violating it's TOS" }then the user gets an error page shown with something like"You cannot add the bot to you/your server. The app has provided the reason: {reason}".This would help devs of bigger bots a LOT because you wouldn't have users questioning everything if they would see an actual error instead of the bot leaving immediately as it is now.
Beta Was this translation helpful? Give feedback.
All reactions