additon of custom channel conditional eval, though it desperately needs sanitization and/or a framework to work upon. further optimisations and addition of direct messaging

This commit is contained in:
Josh Burman
2019-12-26 03:16:18 -05:00
parent 33d1886599
commit fb5533ce7a
15 changed files with 98 additions and 77 deletions

View File

@ -0,0 +1,26 @@
import PublicChannel from '../channels/types/publicChannel';
import PrivateChannel from '../channels/types/privateChannel';
import CustomChannel from '../channels/types/customChannel';
import * as Joi from 'joi'
var app = require('../config/app');
class Validations {
MessageConditions = {
message_type: Joi.string().valid(app.messageTypes).insensitive().required(),
channel: Joi.string(),
channel_type: Joi.string(),
client_type: Joi.string(),
user_id: Joi.number().integer(),
message: Joi.alternatives().try(Joi.string(), Joi.object()),
custom: Joi.object()
}
constructor(message: any) {
if (message.channel_type == 'custom') {
let conditions = message.conditions
}
}
}
export default Validations;