Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorKowalczyk committed May 15, 2022
1 parent 17acbe3 commit 3218cfa
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 40 deletions.
77 changes: 38 additions & 39 deletions bot/events/guild/messageCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,46 @@ const { MessageEmbed, MessageActionRow, MessageButton } = require("discord.js");
module.exports = async (client, message) => {
try {
if (!message) return;
if (message.guild) {
if (!message.guild.me.permissions.has("EMBED_LINKS")) return;
if (!message.guild.me.permissions.has("SEND_MESSAGES")) return;
}
if (message.content.toLowerCase() == "get the cross") {
message.react("🤌");
}
if (message.author.bot) return;
if (message.guild && !message.author.bot && message.embeds.length > 0 && !message.content.includes(`http`)) {
const sqlquery = "SELECT anti_selfbots AS res FROM `guild_settings` WHERE guildid = " + message.guild.id;
client.database.query(sqlquery, function (error, results, fields) {
if (error) return console.log(error);
if (results[0]) {
let selfbot = parseInt(Object.values(JSON.parse(JSON.stringify(results[0]))));
if (selfbot == 1) {
const error_message = new MessageEmbed().setColor("RED").setDescription(`${message.author} no selfbots in ${message.guild.name} (ID: \`${message.guild.id}\`)!`);
message.author.send({ embeds: [error_message] });
return message.delete();
}
if (message.guild) {
if (!message.guild.me.permissions.has("EMBED_LINKS")) return;
if (!message.guild.me.permissions.has("SEND_MESSAGES")) return;
}
if (message.content.toLowerCase() == "get the cross") {
message.react("🤌");
}
if (message.author.bot) return;
if (message.guild && !message.author.bot && message.embeds.length > 0 && !message.content.includes(`http`)) {
const sqlquery = "SELECT anti_selfbots AS res FROM `guild_settings` WHERE guildid = " + message.guild.id;
client.database.query(sqlquery, function (error, results, fields) {
if (error) return console.log(error);
if (results[0]) {
let selfbot = parseInt(Object.values(JSON.parse(JSON.stringify(results[0]))));
if (selfbot == 1) {
const error_message = new MessageEmbed().setColor("RED").setDescription(`${message.author} no selfbots in ${message.guild.name} (ID: \`${message.guild.id}\`)!`);
message.author.send({ embeds: [error_message] });
return message.delete();
}
}
});
}
if (message.content === `<@${client.user.id}>` || message.content === `<@!${client.user.id}>`) {
const embed = new MessageEmbed() // Prettier
// .setTitle(`${client.bot_emojis.success} Hi!`, message.guild.iconURL())
.setColor("GREEN")
.setAuthor({ name: `${client.bot_emojis.wave} Hello ${message.author.username}`, iconURL: client.user.displayAvatarURL({ dynamic: true, format: "png", size: 2048 }) })
.setDescription(`> I was pinged by you, here I am - <@${client.user.id}>!\n> To see all my commands please type \`/help\` (as slash command ${client.bot_emojis.slash_commands})!`)
.setTimestamp()
.setThumbnail(client.user.displayAvatarURL({ dynamic: true, format: "png", size: 2048 }))
.setFooter({
text: `Requested by ${message.author.username}`,
iconURL: message.author.displayAvatarURL({
dynamic: true,
format: "png",
size: 2048,
}),
});
}
if (message.content === `<@${client.user.id}>` || message.content === `<@!${client.user.id}>`) {
const embed = new MessageEmbed() // Prettier
// .setTitle(`${client.bot_emojis.success} Hi!`, message.guild.iconURL())
.setColor("GREEN")
.setAuthor({ name: `${client.bot_emojis.wave} Hello ${message.author.username}`, iconURL: client.user.displayAvatarURL({ dynamic: true, format: "png", size: 2048 }) })
.setDescription(`> I was pinged by you, here I am - <@${client.user.id}>!\n> To see all my commands please type \`/help\` (as slash command ${client.bot_emojis.slash_commands})!`)
.setTimestamp()
.setThumbnail(client.user.displayAvatarURL({ dynamic: true, format: "png", size: 2048 }))
.setFooter({
text: `Requested by ${message.author.username}`,
iconURL: message.author.displayAvatarURL({
dynamic: true,
format: "png",
size: 2048,
}),
});
return message.reply({ embeds: [embed] });
}

return message.reply({ embeds: [embed] });
}
} catch (err) {
console.log(err);
const embed = new MessageEmbed() // Prettier
Expand Down
2 changes: 1 addition & 1 deletion config/main_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
advanved_logging: false, // Show debug info
ratelimit: 2500, // Global slash command ratelimit in ms (can be customized for each command)
max_input: 200, // Maximum text input for slash commands (characters)
suggestions_channel: "838092194530852884", // Suggestions channel
suggestions_channel: "838092194530852884", // Suggestions channel

member_limit: {
respect: false, // Respect guild member limit
Expand Down

0 comments on commit 3218cfa

Please sign in to comment.