fix embeds and statements

merge-requests/17/head
haseeb 2021-02-13 23:32:03 +00:00
parent 4b1c61f6e4
commit 857ccc2736
1 changed files with 4 additions and 18 deletions

View File

@ -29,14 +29,7 @@ export default class Root extends Route {
});
}
if (!req.body.subject) {
return res.status(400).json({
code: this.constants.codes.CLIENT_ERROR,
message: this.constants.messages.CLIENT_ERROR,
});
}
if (!req.body.body) {
if (!req.body.subject || !req.body.body) {
return res.status(400).json({
code: this.constants.codes.CLIENT_ERROR,
message: this.constants.messages.CLIENT_ERROR,
@ -60,7 +53,7 @@ export default class Root extends Route {
embed.setColor('#dd3acd');
embed.addField('Subject', req.body.subject);
embed.addField('Body', req.body.body);
embed.addField('ID', executiveOrder.oID);
embed.setDescription(executiveOrder.oID);
embed.setTimestamp(new Date());
const channel = <TextChannel>this.server.client.getChannel('807444198969835550');
@ -90,14 +83,7 @@ export default class Root extends Route {
});
}
if (!req.body.subject) {
return res.status(400).json({
code: this.constants.codes.CLIENT_ERROR,
message: this.constants.messages.CLIENT_ERROR,
});
}
if (!req.body.body) {
if (!req.body.subject || !req.body.body) {
return res.status(400).json({
code: this.constants.codes.CLIENT_ERROR,
message: this.constants.messages.CLIENT_ERROR,
@ -115,7 +101,7 @@ export default class Root extends Route {
embed.setColor('#66e1ff');
embed.addField('Subject', req.body.subject);
embed.addField('Body', req.body.body);
embed.addField('ID', motionID);
embed.setDescription(motionID);
embed.setTimestamp(new Date());
const channel = <TextChannel>this.server.client.getChannel('807444198969835550');