fix on anti-scam and iplogger

This commit is contained in:
night0721 2022-02-01 03:01:40 +08:00
parent 334ccbf76e
commit 9c2256a9da
11 changed files with 4275 additions and 4210 deletions

View file

@ -1,18 +1,20 @@
const { MessageEmbed } = require("discord.js"); const { MessageEmbed } = require("discord.js");
const dares = require("../../util/Data/dares.json"); const tnd = require("../../util/Data/tnd.json");
module.exports = { module.exports = {
name: "dare", name: "dare",
description: "The maturity level of the topics the question can relate to", description: "The maturity level of the topics the question can relate to",
run: async (client, interaction) => { run: async (client, interaction) => {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setAuthor( .setAuthor({
interaction.user.tag, name: interaction.user.tag,
interaction.user.displayAvatarURL({ dyamic: true }) iconURL: interaction.user.displayAvatarURL({ dyamic: true }),
) })
.setTitle(dares[Math.round(Math.random() * (dares.length - 1))]) .setTitle(dares[Math.round(Math.random() * tnd.dare.length - 1)])
.setColor(client.color) .setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL()) .setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL(),
})
.setTimestamp(); .setTimestamp();
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });
}, },

View file

@ -1,18 +1,20 @@
const { MessageEmbed } = require("discord.js"); const { MessageEmbed } = require("discord.js");
const truth = require("../../util/Data/truth.json"); const tnd = require("../../util/Data/tnd.json");
module.exports = { module.exports = {
name: "truth", name: "truth",
description: "Gives a random question that has to be answered truthfully", description: "Gives a random question that has to be answered truthfully",
run: async (client, interaction, args) => { run: async (client, interaction, args) => {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setAuthor( .setAuthor({
interaction.user.tag, name: interaction.user.tag,
interaction.user.displayAvatarURL({ dyamic: true }) iconURL: interaction.user.displayAvatarURL({ dyamic: true }),
) })
.setTitle(truth[Math.round(Math.random() * truth.length)]) .setTitle(truth[Math.round(Math.random() * tnd.truth.length)])
.setColor(client.color) .setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL()) .setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL(),
})
.setTimestamp(); .setTimestamp();
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });
}, },

View file

@ -47,19 +47,22 @@ module.exports = {
evaled = err; evaled = err;
} }
if (typeof evaled !== "string") evaled = require("util").inspect(evaled); if (typeof evaled !== "string") evaled = require("util").inspect(evaled);
evaled = utils.chunk(evaled, 750); console.log(evaled);
evaled = chunk([evaled], 750);
console.log(evaled);
let reactions = ["❌", "⏪", "◀️", "⏹️", "▶️", "⏩"], let reactions = ["❌", "⏪", "◀️", "⏹️", "▶️", "⏩"],
page = 0, page = 0,
evaledEmbed = new Discord.MessageEmbed() evaledEmbed = new Discord.MessageEmbed()
.setColor(client.color) .setColor(client.color)
.setDescription(`\`\`\`js\n${evaled[0]}\n\`\`\``) .setDescription(`\`\`\`js\n${evaled[0]}\n\`\`\``)
.setTimestamp() .setTimestamp()
.setAuthor( .setAuthor({
`Evaled by ${interaction.user.tag}`, name: `Evaled by ${interaction.user.tag}`,
interaction.user.displayAvatarURL({ dynamic: true }) iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
) });
.addField(`Type of`, `\`\`\`js\n${typeof evaled[0]}\n\`\`\``); const mainMessage = await interaction.channel.send({
const mainMessage = await interaction.channel.send({ embeds: [evaledEmbed] }); embeds: [evaledEmbed],
});
Discord.TextChannel.prototype.send = oldSend; Discord.TextChannel.prototype.send = oldSend;
await Promise.all( await Promise.all(
(evaled.length === 1 ? ["❌", "⏹️"] : reactions).map(r => (evaled.length === 1 ? ["❌", "⏹️"] : reactions).map(r =>
@ -112,12 +115,17 @@ module.exports = {
} }
evaledEmbed = new Discord.MessageEmbed() evaledEmbed = new Discord.MessageEmbed()
.setColor(interaction.guild.me.displayColor) .setColor(interaction.guild.me.displayColor)
.setDescription(`\`\`\`js\n${evaled[page]}\n\`\`\``) .setDescription(`\`\`\`js\n${evaled[page]}\n\`\`\``);
.addField(`Type of`, `\`\`\`js\n${typeof evaled[page]}\n\`\`\``);
await mainMessage.edit({ await mainMessage.edit({
embeds: [evaledEmbed], embeds: [evaledEmbed],
}); });
}); });
}, },
}; };
function chunk(arr, size) {
let c;
Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => {
c = arr.slice(i * size, i * size + size);
});
return c;
}

View file

@ -1,7 +1,7 @@
const client = require(".."); const client = require("..");
const { MessageEmbed } = require("discord.js"); const { MessageEmbed } = require("discord.js");
const utils = require("../util/functions/function"); const utils = require("../util/functions/function");
const scams = require("../util/Data/scam.json"); const domains = require("../util/Data/domains.json");
client.on("messageCreate", async message => { client.on("messageCreate", async message => {
if (message.author.bot || !message.guild) return; if (message.author.bot || !message.guild) return;
const data = {}; const data = {};
@ -66,7 +66,17 @@ client.on("messageCreate", async message => {
} }
if (data.User?.Blacklist) return; if (data.User?.Blacklist) return;
if ( if (
scams.includes( domains.iplogger.includes(
message.content
.toLowerCase()
.match(
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
)?.[0]
.replace(/(https|http):\/\/+/g, "")
.match(/\s*([^)]+?)\s*\/+/g, "")[0]
.slice(0, -1)
) ||
domains.scam.includes(
message.content message.content
.toLowerCase() .toLowerCase()
.match( .match(
@ -77,47 +87,64 @@ client.on("messageCreate", async message => {
.slice(0, -1) .slice(0, -1)
) )
) { ) {
const _ = new MessageEmbed().setTitle(`Scam detected`).addFields( const _ = new MessageEmbed()
{ .setTitle(`Scam/IP Grabber detected`)
name: "Guild", .setTimestamp()
value: message.guild ? message.guild.name : "None", .setColor(client.color)
inline: true, .addFields(
},
{ {
name: "User", name: "User",
value: message.author.tag, value: `${message.author.tag} (${message.author.id})`,
inline: true, inline: true,
}, },
{ {
name: "Message", name: "Scam/IP Logger URL",
value: message.content, value: `||https://${message.content
inline: true,
},
{
name: "Scam link",
value: message.content
.toLowerCase() .toLowerCase()
.match( .match(
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g /(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
)?.[0] )?.[0]
.replace(/(https|http):\/\/+/g, "") .replace(/(https|http):\/\/+/g, "")
.match(/\s*([^)]+?)\s*\/+/g, "")[0] .match(/\s*([^)]+?)\s*\/+/g, "")[0]
.slice(0, -1), .slice(0, -1)}||`,
inline: true, inline: true,
} }
); )
client.channels.cache.get("936986641585799178").send({ .setFooter({
text: `Tactical Protection by ${client.author}`,
icon_url: client.user.displayAvatarURL(),
});
message
.delete()
.catch(() => {})
.then(() => {
message.channel.send({
embeds: [_], embeds: [_],
}); });
message.delete(); client.channels.cache.get("936986641585799178").send({
message.channel.send({ embeds: [
content: `**${message.author.tag}** has sent a scam link and I have deleted it to prevent spread`, _.addFields(
{
name: "Message",
value: message.content,
inline: false,
},
{
name: "Guild",
value: message.guild ? message.guild.name : "None",
inline: true,
}
),
],
});
}); });
} }
if ( if (
message?.content.startsWith(data.Guild.Prefix) || message?.content.startsWith(data.Guild.Prefix) ||
message?.content.startsWith("C.") message?.content.startsWith("C.") ||
message?.content.startsWith("c.")
) { ) {
const embed = new MessageEmbed() const embed = new MessageEmbed()
.setTitle(`Message commands are now disabled`) .setTitle(`Message commands are now disabled`)
@ -190,7 +217,15 @@ client.on("messageCreate", async message => {
} }
if (message.content) { if (message.content) {
client.channels.cache.get(client.config.DMLog).send({ client.channels.cache.get(client.config.DMLog).send({
content: `\`${message.author.tag}(${message.author.id})\`: ${message.content}`, embeds: [
new MessageEmbed()
.setDescription(message.content)
.setColor(client.color)
.setAuthor({
name: message.author.tag,
iconURL: message.author.displayAvatarURL({ dynamic: true }),
}),
],
}); });
} }
} }

View file

@ -1,11 +0,0 @@
//use eval if you wanna.
//this gives you the invite link in a server of a channel.
//code by Tac Shadow#5920
async function asyncCall() {
const result = await client.channels.cache.get("CHANNEL_ID").createInvite();
message.channel.send(`${result}`);
}
asyncCall();

View file

@ -1,26 +0,0 @@
[
"Shave your arms and send me a pic.",
"Record yourself singing a song and post it on YouTube.",
"Try to lick your own foot!",
"Message someone you havent talked to in at least 1 year on Facebook or Instagram and take a screenshot.",
"Text your crush and ask them out on a date.",
"Cut a piece of your hair.",
"List everyone as the emoji(s) you think best fits them.",
"Change your nickname/username to whatever the group wants.",
"Send me a screenshot of your messages with the last person besides me you texted.",
"Brush your teeth with peanut butter or another condiment and send me a pic.",
"Rate everyone here 1-10 in terms of personality.",
"Take a really unflattering picture and make it your profile picture for one full day.",
"Send me a screenshot of your selfies gallery.",
"Text a random number and write “I see dead people”.",
"Tell the group in detail about your first kiss.",
"Tell a joke until it makes everyone laugh.",
"Tell your girlfriend that your friends dont like her so you cant be with her anymore.",
"Brush your teeth with your best friends toothbrush.",
"Show everyone your unshaved legs.",
"Break a raw egg on your forehead.",
"Call 5 different people and talk to them in 5 different accents.",
"Set your crushs picture as your FB profile picture.",
"Show everyone your search history for the past week."
]

4131
util/Data/domains.json Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,5 @@
[ {
"truth": [
"When was the last time you lied?", "When was the last time you lied?",
"When was the last time you cried?", "When was the last time you cried?",
"What's your biggest fear?", "What's your biggest fear?",
@ -60,4 +61,30 @@
"What's the silliest reason you've left a club early?", "What's the silliest reason you've left a club early?",
"What have you purchased that's been the biggest waste of money?", "What have you purchased that's been the biggest waste of money?",
"If you could swap lives with someone in this room, who would it be?" "If you could swap lives with someone in this room, who would it be?"
] ],
"dare": [
"Shave your arms and send me a pic.",
"Record yourself singing a song and post it on YouTube.",
"Try to lick your own foot!",
"Message someone you havent talked to in at least 1 year on Facebook or Instagram and take a screenshot.",
"Text your crush and ask them out on a date.",
"Cut a piece of your hair.",
"List everyone as the emoji(s) you think best fits them.",
"Change your nickname/username to whatever the group wants.",
"Send me a screenshot of your messages with the last person besides me you texted.",
"Brush your teeth with peanut butter or another condiment and send me a pic.",
"Rate everyone here 1-10 in terms of personality.",
"Take a really unflattering picture and make it your profile picture for one full day.",
"Send me a screenshot of your selfies gallery.",
"Text a random number and write “I see dead people”.",
"Tell the group in detail about your first kiss.",
"Tell a joke until it makes everyone laugh.",
"Tell your girlfriend that your friends dont like her so you cant be with her anymore.",
"Brush your teeth with your best friends toothbrush.",
"Show everyone your unshaved legs.",
"Break a raw egg on your forehead.",
"Call 5 different people and talk to them in 5 different accents.",
"Set your crushs picture as your FB profile picture.",
"Show everyone your search history for the past week."
]
}

View file

@ -503,6 +503,7 @@ const leven = (te, t) => {
function chunk(arr, size) { function chunk(arr, size) {
Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => { Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => {
arr.slice(i * size, i * size + size); arr.slice(i * size, i * size + size);
return arr;
}); });
} }
function progressBar(value, maxValue, size) { function progressBar(value, maxValue, size) {