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

View file

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

View file

@ -47,19 +47,22 @@ module.exports = {
evaled = err;
}
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 = ["❌", "⏪", "◀️", "⏹️", "▶️", "⏩"],
page = 0,
evaledEmbed = new Discord.MessageEmbed()
.setColor(client.color)
.setDescription(`\`\`\`js\n${evaled[0]}\n\`\`\``)
.setTimestamp()
.setAuthor(
`Evaled by ${interaction.user.tag}`,
interaction.user.displayAvatarURL({ dynamic: true })
)
.addField(`Type of`, `\`\`\`js\n${typeof evaled[0]}\n\`\`\``);
const mainMessage = await interaction.channel.send({ embeds: [evaledEmbed] });
.setAuthor({
name: `Evaled by ${interaction.user.tag}`,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
});
const mainMessage = await interaction.channel.send({
embeds: [evaledEmbed],
});
Discord.TextChannel.prototype.send = oldSend;
await Promise.all(
(evaled.length === 1 ? ["❌", "⏹️"] : reactions).map(r =>
@ -112,12 +115,17 @@ module.exports = {
}
evaledEmbed = new Discord.MessageEmbed()
.setColor(interaction.guild.me.displayColor)
.setDescription(`\`\`\`js\n${evaled[page]}\n\`\`\``)
.addField(`Type of`, `\`\`\`js\n${typeof evaled[page]}\n\`\`\``);
.setDescription(`\`\`\`js\n${evaled[page]}\n\`\`\``);
await mainMessage.edit({
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 { MessageEmbed } = require("discord.js");
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 => {
if (message.author.bot || !message.guild) return;
const data = {};
@ -66,7 +66,17 @@ client.on("messageCreate", async message => {
}
if (data.User?.Blacklist) return;
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
.toLowerCase()
.match(
@ -77,47 +87,64 @@ client.on("messageCreate", async message => {
.slice(0, -1)
)
) {
const _ = new MessageEmbed().setTitle(`Scam detected`).addFields(
{
name: "Guild",
value: message.guild ? message.guild.name : "None",
inline: true,
},
const _ = new MessageEmbed()
.setTitle(`Scam/IP Grabber detected`)
.setTimestamp()
.setColor(client.color)
.addFields(
{
name: "User",
value: message.author.tag,
value: `${message.author.tag} (${message.author.id})`,
inline: true,
},
{
name: "Message",
value: message.content,
inline: true,
},
{
name: "Scam link",
value: message.content
name: "Scam/IP Logger URL",
value: `||https://${message.content
.toLowerCase()
.match(
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
)?.[0]
.replace(/(https|http):\/\/+/g, "")
.match(/\s*([^)]+?)\s*\/+/g, "")[0]
.slice(0, -1),
.slice(0, -1)}||`,
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: [_],
});
message.delete();
message.channel.send({
content: `**${message.author.tag}** has sent a scam link and I have deleted it to prevent spread`,
client.channels.cache.get("936986641585799178").send({
embeds: [
_.addFields(
{
name: "Message",
value: message.content,
inline: false,
},
{
name: "Guild",
value: message.guild ? message.guild.name : "None",
inline: true,
}
),
],
});
});
}
if (
message?.content.startsWith(data.Guild.Prefix) ||
message?.content.startsWith("C.")
message?.content.startsWith("C.") ||
message?.content.startsWith("c.")
) {
const embed = new MessageEmbed()
.setTitle(`Message commands are now disabled`)
@ -190,7 +217,15 @@ client.on("messageCreate", async message => {
}
if (message.content) {
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 cried?",
"What's your biggest fear?",
@ -60,4 +61,30 @@
"What's the silliest reason you've left a club early?",
"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?"
],
"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) {
Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => {
arr.slice(i * size, i * size + size);
return arr;
});
}
function progressBar(value, maxValue, size) {