Skip to content

Instantly share code, notes, and snippets.

@nparsons08

nparsons08/backend-message.js Secret

Created Nov 11, 2019
Embed
What would you like to do?
// backend/src/controllers/v1/message.js
exports.message = async (req, res) => {
try {
const data = req.body;
const userId = data['user']['id'];
if (data['type'] === 'message.new' && userId !== 'chatbot') {
respondToUser(data);
}
res.status(200).json({});
} catch (error) {
console.log(error);
res.status(500).json({ error: error.message });
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.