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

Route: /channels/:id/recipients/:id #19

Closed
2 tasks
SamuelScheit opened this issue Feb 2, 2021 · 1 comment · Fixed by #369
Closed
2 tasks

Route: /channels/:id/recipients/:id #19

SamuelScheit opened this issue Feb 2, 2021 · 1 comment · Fixed by #369
Labels
Module: API Route All route issues
Milestone

Comments

@SamuelScheit
Copy link
Member

SamuelScheit commented Feb 2, 2021

@SamuelScheit SamuelScheit added the Route All route issues label Feb 2, 2021
@luth31
Copy link
Contributor

luth31 commented May 23, 2021

This route supports 2 methods: PUT to create a DM group and add users to it and DELETE to remove users from it (only the owner can do it)

In order to create a DM group, 3 users are required: the one that sends the PUT request, a primary and a secondary user (their order doesn't really matter)

To create the group DM channel:
The soon-to-be owner must send a PUT request to /channels/primary_user.dm_channel.id/recipients/secondary_user.id, if succesful this will return 201 and a json object with the following structure

{
   icon: null
   id: group_dm_channel.id
   last_message_id: // id of the last message in group dm channel, usually default "Owner added User1 and User2"
   name: null
   owner_id: // user id of owner
   recipients: [ 
      PublicUser(primary_user),
      PublicUser(secondary_user),
   ]
   type: 3 (channel type for group DM)
}

To further add new users:
participant must send a PUT request to /channels/group_dm_channel.id/recipients/invited_user.id, if succesful this will return 204 and nothing else.

To remove a participant:
owner must send a DELETE request to /channels/group_dm_channel.id/recipients/removed_user.id, if succesful this will return 204 and nothing else.

@SamuelScheit SamuelScheit self-assigned this May 30, 2021
@xNaCly xNaCly changed the title [Route] /channels/:id/recipients/:id /channels/:id/recipients/:id Aug 10, 2021
@xNaCly xNaCly changed the title /channels/:id/recipients/:id Route: /channels/:id/recipients/:id Aug 10, 2021
SamuelScheit added a commit that referenced this issue Aug 12, 2021
Set up the initial project structure
@xNaCly xNaCly added Module: API and removed Route All route issues labels Aug 12, 2021
@SamuelScheit SamuelScheit added Route All route issues high priority labels Aug 12, 2021
@SamuelScheit SamuelScheit removed their assignment Aug 16, 2021
@SamuelScheit SamuelScheit added this to the Milestone V1 milestone Sep 19, 2021
@SamuelScheit SamuelScheit modified the milestones: Milestone V1, Discord Core Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: API Route All route issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants