mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:26:21 +02:00
Fix
This commit is contained in:
@@ -163,11 +163,11 @@ client.on('message', async msg => {
|
||||
if (!call.adminCall && (msg.guild && (!msg.channel.topic || !msg.channel.topic.includes('<xiao:phone>')))) return;
|
||||
if (!call.active) return;
|
||||
if (call.adminCall && msg.guild.id === call.origin.guild.id && !client.isOwner(msg.author)) return;
|
||||
// try {
|
||||
try {
|
||||
await call.send(origin ? call.recipient : call.origin, msg, hasText, hasImage, hasEmbed);
|
||||
//} catch {
|
||||
// return; // eslint-disable-line no-useless-return
|
||||
//}
|
||||
} catch {
|
||||
return; // eslint-disable-line no-useless-return
|
||||
}
|
||||
});
|
||||
|
||||
client.on('guildCreate', async guild => {
|
||||
|
||||
@@ -207,6 +207,7 @@ module.exports = class Util {
|
||||
|
||||
static stripNSFWURLs(str, siteList, text = '[redacted nsfw url]') {
|
||||
const uris = str.match(/(https?:\/\/\S+)/g);
|
||||
if (!uris) return str;
|
||||
for (const uri of uris) {
|
||||
const parsed = url.parse(uri);
|
||||
if (!siteList.some(pornURL => parsed.host === pornURL)) continue;
|
||||
|
||||
Reference in New Issue
Block a user