-
-
Couldn't load subscription status.
- Fork 25
API route to look up user by username #2
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great to make bot development simpler! 👍
rfcs/rfc-0001-lookup-by-username.md
Outdated
| # Drawbacks | ||
|
|
||
| - Might require another index in MongoDB | ||
| - Since the backend needs to make sure the returned users are mutual, there might be more processing overhead involved, but the logic for this can probably be copied from the /users/:id route |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
rfcs/rfc-0001-lookup-by-username.md
Outdated
|
|
||
| # Guide-level explanation | ||
|
|
||
| Send a `GET` request to `/users/by-name/insert` (no idea how to name the route) to get an array of users matching that username. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be a POST to /users/by-name or something along those lines using the body to specify username and later discriminator.
| The `exact` field should default to true and indicates whether we want an exact match (still case insensitive) or if we want to receive all users starting with the search term, similar to Discord's user search - See [below](#prior-art). \ | ||
| Setting this to `false` will make this endpoint feasable as a replacement for the current temporary [member search route](https://github.com/revoltchat/backend/commit/d81d08f1ce222a9fe05986e15c4e3748bdd5d4ae). | ||
|
|
||
| If this is implemented before discriminators are, the `discriminator` field should be supported as a placeholder and functionality can be added at a later point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| If this is implemented before discriminators are, the `discriminator` field should be supported as a placeholder and functionality can be added at a later point. |
|
I strongly oppose this proposal. This is computationally expensive for certain database layouts. |
No description provided.