Skip to content

Commit

Permalink
Handle slack's text channel mention warning
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwofford committed Oct 16, 2019
1 parent 6f9ed9b commit e885349
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/interactions/dm.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const interactionDM = (bot, message) => {

const encodedText = text.replace('&lt;', '<text').replace('&gt;', '>')
console.log(encodedText)
const messageRegex = /dm <[@#](.+?(?=[>\|])).*?>(.*)/
const messageRegex = /dm <.*?[@#](.+?(?=[>\|])).*?>(.*)/
const [, targetUser, targetMessage] = encodedText.match(messageRegex)

bot.say({ text: targetMessage, channel: targetUser }, (err, response) => {
Expand Down

0 comments on commit e885349

Please sign in to comment.