Skip to content

Commit

Permalink
feat(core): support shortcuts for quote replies
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Oct 18, 2022
1 parent ba7b44b commit 050cee4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/command/runtime.ts
Expand Up @@ -18,10 +18,11 @@ export default function runtime(ctx: Context) {

ctx.before('parse', (content, session) => {
const { parsed, quote } = session
if (parsed.prefix || quote) return
if (parsed.prefix) return
for (const shortcut of ctx.$commander._shortcuts) {
const { name, fuzzy, command, prefix, options = {}, args = [] } = shortcut
if (prefix && !parsed.appel || !command.ctx.filter(session)) continue
if (quote) content += ' ' + quote.content
if (typeof name === 'string') {
if (!fuzzy && content !== name || !content.startsWith(name)) continue
const message = content.slice(name.length)
Expand Down

0 comments on commit 050cee4

Please sign in to comment.