|
|
|
@ -10,7 +10,7 @@ function sleep(ms) {
|
|
|
|
|
|
|
|
|
|
|
|
exports.sendText = async ctx => {
|
|
|
|
exports.sendText = async ctx => {
|
|
|
|
const { from, to, msgcontent, content: _content } = ctx.request.body;
|
|
|
|
const { from, to, msgcontent, content: _content } = ctx.request.body;
|
|
|
|
const content = _content || msgcontent.text || '';
|
|
|
|
const content = _content || msgcontent.body || '';
|
|
|
|
if (!from || !content) {
|
|
|
|
if (!from || !content) {
|
|
|
|
ctx.assert(from, 400, 'From and message are required');
|
|
|
|
ctx.assert(from, 400, 'From and message are required');
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|