Commit eb1801bc authored by nanahira's avatar nanahira

fix mid-image

parent 79c7287c
Pipeline #3184 passed with stages
in 1 minute and 18 seconds
{ {
"name": "koishi-plugin-hisoutensoku-jammer", "name": "koishi-plugin-hisoutensoku-jammer",
"version": "1.1.5", "version": "1.1.6",
"description": "A Koishi Plugin jamming hisoutensoku plays in group.", "description": "A Koishi Plugin jamming hisoutensoku plays in group.",
"main": "dist/index.js", "main": "dist/index.js",
"dependencies": { "dependencies": {
......
...@@ -75,14 +75,14 @@ class HisoutensokuJammer { ...@@ -75,14 +75,14 @@ class HisoutensokuJammer {
realMessage = realMessage.replace(chineseCharacter.characterRegExp, chineseCharacter.value) realMessage = realMessage.replace(chineseCharacter.characterRegExp, chineseCharacter.value)
} }
const messageMatch: RegExpMatchArray = realMessage.match( const messageMatch: RegExpMatchArray = realMessage.match(
/([1-2]? ?\d? ?\d ?)(([^\d][1-2]?\d{1,2}){3})[^\d]+?([1-6] ?\d ?\d ?\d ?\d)/g /([1-2]? ?\d? ?\d ?)(([^\d][1-2]?\d{1,2}){3}).+?([1-6] ?\d ?\d ?\d ?\d)/g
); );
if (!messageMatch) { if (!messageMatch) {
return; return;
} }
const attackPromises = messageMatch.map((pattern) => { const attackPromises = messageMatch.map((pattern) => {
const patternMatch = pattern.match( const patternMatch = pattern.match(
/([1-2]? ?\d? ?\d ?)(([^\d][1-2]?\d{1,2}){3})[^\d]+?([1-6] ?\d ?\d ?\d ?\d)/ /([1-2]? ?\d? ?\d ?)(([^\d][1-2]?\d{1,2}){3}).+?([1-6] ?\d ?\d ?\d ?\d)/
); );
const firstDigit = patternMatch[1].replace(/ /g, ''); const firstDigit = patternMatch[1].replace(/ /g, '');
const address = `${firstDigit}.${patternMatch[2].slice(1).split(/[^\d]/).join(".")}`; const address = `${firstDigit}.${patternMatch[2].slice(1).split(/[^\d]/).join(".")}`;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment