diff options
Diffstat (limited to 'api/src/routes/channels')
-rw-r--r-- | api/src/routes/channels/#channel_id/messages/index.ts | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/api/src/routes/channels/#channel_id/messages/index.ts b/api/src/routes/channels/#channel_id/messages/index.ts index 2fce704b..2ce7f7b3 100644 --- a/api/src/routes/channels/#channel_id/messages/index.ts +++ b/api/src/routes/channels/#channel_id/messages/index.ts @@ -245,8 +245,16 @@ router.post( ); } - //Fix for the client bug - delete message.member + //Defining member fields + var member = await Member.findOneOrFail({ where: { id: req.user_id }, relations: ["roles"] }); + member.roles = member.roles.filter((role) => { + return role.id !== role.guild_id; + }).map((role) => { + return role.id; + }); + message.member = member; + delete message.member.last_message_id; + delete message.member.index; await Promise.all([ message.save(), |