Add softban command. Mod action fixes and tweaks.

This commit is contained in:
Dragory 2018-08-02 00:51:25 +03:00
parent 3e7aff5b1f
commit a0f5114f62
7 changed files with 139 additions and 40 deletions

View file

@ -267,3 +267,10 @@ export function getRoleMentions(str: string) {
return roleIds;
}
/**
* Disables link previews in the given string by wrapping links in < >
*/
export function disableLinkPreviews(str: string): string {
return str.replace(/(?<!\<)(https?:\/\/\S+)/gi, "<$1>");
}