Skip to content

Commit

Permalink
fix: アスタリスク6つのみのメッセージを無視
Browse files Browse the repository at this point in the history
fix #574
  • Loading branch information
KisaragiEffective authored Nov 10, 2022
1 parent 5458bbe commit e632dab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/service/bold-italic-cop.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { MessageEvent, MessageEventResponder } from '../runner/index.js';

const boldItalic = /\*\*\*/g;
// 一つでも含まれていればよいため、最短マッチを行う
const boldItalic = /\*\*\*(?:.+?)\*\*\*/g;

export interface BoldItalicCop {
/**
Expand All @@ -25,7 +26,7 @@ export class BoldItalicCopReporter
if (event !== 'CREATE') return;
const boldItalicSize = message.content.match(boldItalic);
if (!boldItalicSize) return;
if (boldItalicSize.length >= 2) {
if (boldItalicSize.length >= 1) {
await message.replyMessage({
content: 'Bold-Italic警察だ!!! <:haracho:684424533997912096>'
});
Expand Down

0 comments on commit e632dab

Please sign in to comment.