RealDevSquad / RealDevSquad/website-backend
API to change users' discord nickname
Open
@bharati-21 is already working on this.
Since Aug 1, 2023.
backend
feature task
- Dominant language
- JavaScript
- Stars
- 74
- Forks
- 276
- Avg merge
- 1d 26m
- Merged PRs (30d)
- 14
Description
Create an API that can change the users' nicknames in the Real Dev Squad server.
Description
Create an API under the /discord-actions API which will call upon the endpoint exposed in cloudflare workers named: /guild/members
API contracts for the /guild/members
- method: patch
- authentication: JWT signed with rds-serverless-private-key
- request body
{
discordId: <Discord id is available in the user's data once they link their discord id>, (Remember `I` is capital in Id )
userName: <rds username of the selected user also available in users' database>, (Remember `N` is capital in username)
}
Overview of the feature
Use case 1
- users join in Real Dev Squad Server
- Run the command
/verify - come to my site
- Accept terms and conditions
- click on authorize
- this will add a discord id in the users collection for the specific user
- now once the discord id is added the name change API must be called automatically and change the nickname of the user in the server
Use case 2
- users mark themselves OOO on my site
- the API needs to be called automatically
- set the nickname based on the standards defined (Will be defined in the near future)
Expectations
- Follow TDD
- Keep a minimum test coverage of 80%
- Make sure API can not be called by users directly (Apart from superuser)
Need help? Try looking here;
-
Stuck with failed authentication/bad request signature response?
- Look here how the auth token is set: https://github.com/Real-Dev-Squad/website-backend/blob/dead12da7ad289dd89dbf0b9105b94b1e19abb44/controllers/discordactions.js#L36
-
unable to make a call to the cloudflare workers?
- Look here how the fetch call is made: https://github.com/Real-Dev-Squad/website-backend/blob/dead12da7ad289dd89dbf0b9105b94b1e19abb44/controllers/discordactions.js#L110
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.