Skip to content

Commit

Permalink
fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandons404 committed Oct 3, 2022
1 parent 5303829 commit b9c5b30
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ Events.on(PlayerLeave, (e) => {

Events.on(PlayerChatEvent, (e) => {
const player = e.player;
const text = e.message;
let text = e.message;

if (text[0] === '/') return;

const formattedName = Strings.stripColors(player.name);
const lastChar1 = formattedMessage[formattedMessage.length - 1];
const lastChar1 = text[text.length - 1];

if (lastChar1 >= 0xf80 && lastChar1 <= 0x107f) {
formattedMessage = formattedMessage.slice(0, -2);
text = text.slice(0, -2);
}

const msg = '**' + formattedName + '**' + ': ' + formattedMessage;
const msg = '**' + formattedName + '**' + ': ' + text;

sendMessage(msg);
});
Expand Down

0 comments on commit b9c5b30

Please sign in to comment.