put reactions before url_metadata to inhibit facebook links discovery
This commit is contained in:
parent
03e20fced0
commit
f0bd2e365a
2 changed files with 3 additions and 3 deletions
2
index.js
2
index.js
|
@ -9,7 +9,7 @@ server.listen(process.env.PORT || 5000)
|
|||
|
||||
/** Add your bot logic here. Removing the imported examples. */
|
||||
// require('./src/examples')
|
||||
require('./src/url_metadata')
|
||||
require('./src/reactions')
|
||||
require('./src/url_metadata')
|
||||
|
||||
bot.start() // 🚀
|
||||
|
|
|
@ -3,7 +3,7 @@ const bot = require('bbot');
|
|||
const request = require('request');
|
||||
|
||||
bot.global.text(/(https?:\/\/[^ ,\)"]*)/ig, (b) => {
|
||||
// console.log(JSON.stringify(b.match, null, 2));
|
||||
// console.log(JSON.stringify(b.envelope.payload, null, 2));
|
||||
for (url of b.match) {
|
||||
// console.log(JSON.stringify(url, null, 2));
|
||||
if (!/(coa|pad)\.crapaud-fou\.org/.test(url)) {
|
||||
|
@ -13,6 +13,7 @@ bot.global.text(/(https?:\/\/[^ ,\)"]*)/ig, (b) => {
|
|||
var match = re.exec(body);
|
||||
if (match && match[1]) {
|
||||
// b.respondEnvelope({ attachments: [] })
|
||||
// b.envelope.payload.quickReply({ attachments: [] });
|
||||
b.respond("[:link:](" + url + ") _" + match[1] + "_");
|
||||
}
|
||||
}
|
||||
|
@ -22,4 +23,3 @@ bot.global.text(/(https?:\/\/[^ ,\)"]*)/ig, (b) => {
|
|||
}, {
|
||||
id: 'get-url-metadata'
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue