Added discord support to emailing with @

This commit is contained in:
aewens 2018-07-16 18:36:13 -04:00
parent d80fe57567
commit 501faaf4c5
1 changed files with 14 additions and 11 deletions

View File

@ -56,19 +56,22 @@ module.exports = class Summon {
text = `${text} in channel ${this.channel}`;
text = `${text} for reason: ${reason}`;
if (!user.startsWith("@")) {
this.transporter.sendMail({
from: this.client.config.email,
to: `${user}@tilde.team`,
subject: subject,
text: text
}, (err, info) => {
// DEBUG
// console.log("Summon::email", info);
response.debug.email = info;
});
let email = `${user}@tilde.team`;
if (user.startsWith("@")) {
email = email.slice(1);
}
this.transporter.sendMail({
from: this.client.config.email,
to: email,
subject: subject,
text: text
}, (err, info) => {
// DEBUG
// console.log("Summon::email", info);
response.debug.email = info;
});
// I obvious don't know everyone's Pushbullet API
if (user === this.client.config.author) {
const self = this;