From 3218cfa2e8985c9ee408fc5e83c0bb0add92619d Mon Sep 17 00:00:00 2001 From: igorkowalczyk Date: Sun, 15 May 2022 09:54:15 +0200 Subject: [PATCH] Format code --- bot/events/guild/messageCreate.js | 77 +++++++++++++++---------------- config/main_config.js | 2 +- 2 files changed, 39 insertions(+), 40 deletions(-) diff --git a/bot/events/guild/messageCreate.js b/bot/events/guild/messageCreate.js index c2173f7ff1..f8ceeead61 100644 --- a/bot/events/guild/messageCreate.js +++ b/bot/events/guild/messageCreate.js @@ -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 diff --git a/config/main_config.js b/config/main_config.js index 3afddcfa04..540780a6fa 100644 --- a/config/main_config.js +++ b/config/main_config.js @@ -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