Skip to content

Commit

Permalink
Removed weird tags appear from rustplus messages
Browse files Browse the repository at this point in the history
  • Loading branch information
alexemanuelol committed Sep 4, 2023
1 parent 79bf209 commit 0babbc4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/rustplusEvents/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,17 @@ async function messageBroadcastTeamChanged(rustplus, client, message) {
async function messageBroadcastTeamMessage(rustplus, client, message) {
const instance = client.getInstance(rustplus.guildId);

message.broadcast.teamMessage.message.message =
message.broadcast.teamMessage.message.message.replace(/^<color.+?<\/color>/g, '');
let tempName = message.broadcast.teamMessage.message.name;
let tempMessage = message.broadcast.teamMessage.message.message;

tempName = tempName.replace(/^<size=.*?><color=.*?>/, ''); /* Rustafied */
tempName = tempName.replace(/<\/color><\/size>$/, ''); /* Rustafied */
message.broadcast.teamMessage.message.name = tempName;

tempMessage = tempMessage.replace(/^<size=.*?><color=.*?>/, ''); /* Rustafied */
tempMessage = tempMessage.replace(/<\/color><\/size>$/, ''); /* Rustafied */
tempMessage = tempMessage.replace(/^<color.+?<\/color>/g, ''); /* Unknown */
message.broadcast.teamMessage.message.message = tempMessage;

if (instance.blacklist['steamIds'].includes(`${message.broadcast.teamMessage.message.steamId}`)) {
rustplus.log(client.intlGet(null, 'infoCap'), client.intlGet(null, `userPartOfBlacklistInGame`, {
Expand Down

0 comments on commit 0babbc4

Please sign in to comment.