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:
26
src/services/validations.ts
Normal file
26
src/services/validations.ts
Normal 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;
|
Reference in New Issue
Block a user