Martin Dimitrov 4cad1fbe2b
All checks were successful
Build and push Doorman UI / API / docker (push) Successful in 1m27s
discord notifications
2024-10-26 13:31:15 -07:00

16 lines
412 B
JavaScript

exports.handler = async function(context, event, callback) {
const response = new Twilio.Response();
const discordPath = Runtime.getFunctions()['common/discord'].path;
const discord = require(discordPath);
// user must be in "Doorman" server
await discord.sendMessageToUser(context,
event.discordUser,
event.msg,
)
.catch((e) => console.error(e));
return callback(null, response);
};