mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-27 22:27:44 +02:00
Fix portal
This commit is contained in:
@@ -204,6 +204,7 @@ module.exports = class Util {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static stripInvites(str, { guild = true, bot = true, text = '[redacted invite]' } = {}) {
|
static stripInvites(str, { guild = true, bot = true, text = '[redacted invite]' } = {}) {
|
||||||
|
if (!str) return '';
|
||||||
if (guild) str = str.replace(inviteRegex, text);
|
if (guild) str = str.replace(inviteRegex, text);
|
||||||
if (bot) str = str.replace(botInvRegex, text);
|
if (bot) str = str.replace(botInvRegex, text);
|
||||||
return str;
|
return str;
|
||||||
@@ -233,6 +234,7 @@ module.exports = class Util {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static stripNSFWURLs(str, siteList, text = '[redacted nsfw url]') {
|
static stripNSFWURLs(str, siteList, text = '[redacted nsfw url]') {
|
||||||
|
if (!str) return '';
|
||||||
const uris = str.match(/(https?:\/\/\S+)/g);
|
const uris = str.match(/(https?:\/\/\S+)/g);
|
||||||
if (!uris) return str;
|
if (!uris) return str;
|
||||||
for (const uri of uris) {
|
for (const uri of uris) {
|
||||||
|
|||||||
Reference in New Issue
Block a user