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

[Feature Request] Add Discord Role For Monthly Donors #13

Open
JasonDocton opened this issue Jun 15, 2022 · 2 comments
Open

[Feature Request] Add Discord Role For Monthly Donors #13

JasonDocton opened this issue Jun 15, 2022 · 2 comments

Comments

@JasonDocton
Copy link
Collaborator

Feature Request: When a new monthly donor is created, award them with a Discord Role. Remove said Discord Role when they're no longer a monthly donor.

Use case: As a way to thank monthly donors for their support, we'd love to award them with a Discord Role that highlights them within our community. Currently, a user must reach out to one of the mods on our Discord to ask for this role, which then requires the mod to have staff confirm the user is indeed a monthly donor. Ideally, this process would be done automatically, allowing monthly donors to enjoy their Discord Role straight away.

Suggestions: It could be possible to manage this process via Supabase Auth, which allows for someone to oAuth with their Discord. The upside of using Supabase Auth here is we'll be able to do things like password resets or create additional oAuth fairly easily. The downside is that Supabase Auth contains its own, unique database called Auth.User, which would then need to be connected back to our Database table called User. Another method would be leveraging a Discord Bot to track the status of a monthly donor and to award/remove the Discord Role based on their status.

Related files:

File Location
schema.prisma prisma/
create-user.ts backed/router/user/create-user.ts
guildmember.tsx src/pages/guildmember.tsx
@gcavanunez
Copy link
Contributor

The discord bot route may be the most efficient way, and assuming we resolve this feature post bringing in Auth (via supabase or NextAuth).

graph TD;
    Bot-->Rad-Webhook;
    Rad-Webhook-->DB-Reward-Operation;
Loading

Another could be the cron approach

graph TD;
    Cron-->Validating-Logic;
    Validating-Logic-->DB-Reward-Operation;
Loading

@spirobel
Copy link

maybe it would be better if the rad backend called a webhook on the discord bot. This way you would not need a cron job. I wrote something similar that works the other way round: syncing discord roles with group permissions in an external system: https://github.com/spirobel/discord-rolesync

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

No branches or pull requests

3 participants