Update cafy to 8.0.0 🚀
This commit is contained in:
parent
0c3e9dd5e0
commit
f664cf09c0
97 changed files with 294 additions and 291 deletions
|
@ -19,7 +19,7 @@ import config from '../../../../../config';
|
|||
*/
|
||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
||||
// Get 'userId' parameter
|
||||
const [recipientId, recipientIdErr] = $(params.userId).type(ID).get();
|
||||
const [recipientId, recipientIdErr] = $.type(ID).get(params.userId);
|
||||
if (recipientIdErr) return rej('invalid userId param');
|
||||
|
||||
// Myself
|
||||
|
@ -41,11 +41,11 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
|
|||
}
|
||||
|
||||
// Get 'text' parameter
|
||||
const [text, textErr] = $(params.text).optional.string().pipe(isValidText).get();
|
||||
const [text, textErr] = $.str.optional().pipe(isValidText).get(params.text);
|
||||
if (textErr) return rej('invalid text');
|
||||
|
||||
// Get 'fileId' parameter
|
||||
const [fileId, fileIdErr] = $(params.fileId).optional.type(ID).get();
|
||||
const [fileId, fileIdErr] = $.type(ID).optional().get(params.fileId);
|
||||
if (fileIdErr) return rej('invalid fileId param');
|
||||
|
||||
let file = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue