mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 23:14:53 +09:00
fix: filter server-specific chat tags (#970)
Co-authored-by: ColumbusLabs <287001685+ColumbusLabs@users.noreply.github.com>
This commit is contained in:
1 parent
c0138c3fe0
commit
aa59cd1992
3 files changed
+24
-3
No files matched your search
@@ -3,13 +3,13 @@ import { BaseInstancePlugin } from "@clusterio/host";
|
||||
import { ChatEvent } from "./messages";
|
||||
|
||||
/**
|
||||
* Removes gps and train tags from messags
|
||||
* Removes server-specific tags from messages.
|
||||
*
|
||||
* @param content - string to strip tags from.
|
||||
* @returns stripped string.
|
||||
*/
|
||||
function removeTags(content: string): string {
|
||||
return content.replace(/(\[gps=-?\d+,-?\d+\]|\[train=\d+\])/g, "");
|
||||
return content.replace(/\[(?:gps|special-item|train|train-stop)=\S*?\]/gm, "");
|
||||
}
|
||||
|
||||
export class InstancePlugin extends BaseInstancePlugin {
|
||||
|
||||
Reference in new issue
Block a user