Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could be used in this API #1

Open
flexsoluciones opened this issue May 18, 2023 · 0 comments
Open

could be used in this API #1

flexsoluciones opened this issue May 18, 2023 · 0 comments

Comments

@flexsoluciones
Copy link

could be used in this API
this code send message You could use in this API the idea that when writing a message in the JSON that I send the word :smile is put; and pogana it in the message:
`export async function sendMessage(req: Request, res: any) {
const { phone, message } = req.body;

const options = req.body.options || {};

try {
const results: any = [];
for (const contato of phone) {
results.push(await req.client.sendText(contato, message, options));
}

if (results.length === 0)
  return res.status(400).json('Error sending message');
req.io.emit('mensagem-enviada', results);
returnSucess(res, results);

} catch (error) {
returnError(req, res, error);
}
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant