Skip to content

Commit

Permalink
fix(discord): matches user mentions like <@id> (#660)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shir0ha authored May 3, 2022
1 parent 0c420fe commit 0e972d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/adapter/discord/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function adaptMessage(meta: DC.Message, session: Partial<Session> = {}) {
session.content = ''
if (meta.content) {
session.content = meta.content
.replace(/<@[!&](.+?)>/g, (_, id) => {
.replace(/<@[!&]?(.+?)>/g, (_, id) => {
if (meta.mention_roles.includes(id)) {
return segment('at', { role: id })
} else {
Expand Down

0 comments on commit 0e972d2

Please sign in to comment.