Add commands API (#38)
This commit is contained in:
parent
a9e67aa340
commit
e563521416
8 changed files with 267 additions and 35 deletions
|
|
@ -61,7 +61,7 @@ export default definePlugin({
|
|||
const emojiString = `<${emoji.animated ? 'a' : ''}:${emoji.originalName || emoji.name}:${emoji.id}>`;
|
||||
const url = emoji.url.replace(/\?size=[0-9]+/, `?size=48`);
|
||||
messageObj.content = messageObj.content.replace(emojiString, (match, offset, origStr) => {
|
||||
return `${getWordBoundary(origStr, offset-1)}${url}${getWordBoundary(origStr, offset+match.length)}`;
|
||||
return `${getWordBoundary(origStr, offset - 1)}${url}${getWordBoundary(origStr, offset + match.length)}`;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -76,7 +76,7 @@ export default definePlugin({
|
|||
|
||||
const url = emoji.url.replace(/\?size=[0-9]+/, `?size=48`);
|
||||
messageObj.content = messageObj.content.replace(emojiStr, (match, offset, origStr) => {
|
||||
return `${getWordBoundary(origStr, offset-1)}${url}${getWordBoundary(origStr, offset+match.length)}`;
|
||||
return `${getWordBoundary(origStr, offset - 1)}${url}${getWordBoundary(origStr, offset + match.length)}`;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue