Skip to content

Commit

Permalink
Merge pull request #59 from NITKC22s/hotfix/secretmsg_double-back-slash
Browse files Browse the repository at this point in the history
\\が\になるバグを修正
  • Loading branch information
starkoka authored Apr 22, 2023
2 parents 67c7b1f + 1ab6791 commit b12d6fd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions commands/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ module.exports =
const currentTime = date.toFormat('YYYY年 MM/DD HH24:MI:SS');
let sendingMsg='';


//ロールメンション時パーミッション確認と除外処理
if(!interaction.memberPermissions.has(1n<<17n))
{
Expand All @@ -136,13 +135,13 @@ module.exports =
}
}
const everyoneMention=receivedMsg.search(/@everyone/);
if(everyoneMention!=-1)
if(everyoneMention!==-1)
{
const rg=new RegExp("(?<!`)@everyone(?<!`)","g");
receivedMsg=receivedMsg.replace(rg,"\`@everyone\`\0");
}
const hereMention = receivedMsg.search(/@here/);
if(hereMention!=-1)
if(hereMention!==-1)
{
const rg=new RegExp("(?<!`)@here(?<!`)","g");
receivedMsg=receivedMsg.replace(rg,"\`@here\`\0");
Expand All @@ -157,7 +156,7 @@ module.exports =
switch (receivedMsg[i + 1])
{
case '\\':
sendingMsg += '\\';
sendingMsg += '\\\\';
i++;
break;
case 'n':
Expand Down

0 comments on commit b12d6fd

Please sign in to comment.