Electric2024

Untitled

Jun 28th, 2024
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 8.87 KB | Source Code | 0 0
  1. require("dotenv").config();
  2. const { Client, IntentsBitField, EmbedBuilder } = require("discord.js");
  3.  
  4. const client = new Client({
  5.   intents: [
  6.     IntentsBitField.Flags.Guilds,
  7.     IntentsBitField.Flags.GuildMembers,
  8.     IntentsBitField.Flags.GuildMessages,
  9.     IntentsBitField.Flags.MessageContent,
  10.   ],
  11. });
  12.  
  13. client.prefix = "-";
  14. client.allowedRoleID = "1254240699981893822";
  15. client.allowedRoleIDMember = "1254241162332737587";
  16.  
  17. client.on("ready", (c) => {
  18.   console.log(`${c.user.username} is online.`);
  19. });
  20.  
  21. client.on("messageCreate", async (message) => {
  22.   if (message.author.bot) return;
  23.  
  24.   if (!message.content.startsWith(client.prefix)) return;
  25.   const args = message.content.substring(1).split(" ");
  26.   const cmd = args.shift().toLowerCase();
  27.   const embed = new EmbedBuilder();
  28.   const sendOption = { embeds: [], content: "" };
  29.  
  30.   if (message.member.roles.cache.has(client.allowedRoleID)) {
  31.     const user =
  32.       message.mentions.members.first()?.user ??
  33.       client.users.cache.get(args[0]) ??
  34.       (await client.users.fetch(args[0]).catch(() => {}));
  35.     if (cmd === "r1") {
  36.       sendOption.embeds.push(
  37.         embed
  38.           .setTitle("``R1`` Respect")
  39.           .setDescription(
  40.             "> You must show respect to others, discrimination and hate speech is strictly prohibited."
  41.           )
  42.           .setColor("#c40d2c")
  43.           .setImage(
  44.             "https://media.discordapp.net/attachments/1254255009084866622/1255130371083735050/banner.jpg?ex=667c02bf&is=667ab13f&hm=3e6a5d8eb398d03824897983b16424363a6b654c1dcf1771907b8fa2d6a06084&=&format=webp"
  45.           )
  46.       );
  47.       sendOption.content = user ? user.toString() : null;
  48.     } else if (cmd === "r2") {
  49.       sendOption.embeds.push(
  50.         embed
  51.           .setTitle("``R2`` Drama")
  52.           .setDescription(
  53.             "> Do not cause drama within our community, unnecessary drama will be moderated for those who are included in the situation."
  54.           )
  55.           .setColor("#c40d2c")
  56.           .setImage(
  57.             "https://media.discordapp.net/attachments/1254255009084866622/1255130371083735050/banner.jpg?ex=667c02bf&is=667ab13f&hm=3e6a5d8eb398d03824897983b16424363a6b654c1dcf1771907b8fa2d6a06084&=&format=webp"
  58.           )
  59.       );
  60.       sendOption.content = user ? user.toString() : null;
  61.     } else if (cmd === "r3") {
  62.       sendOption.embeds.push(
  63.         embed
  64.           .setTitle("``R3`` Nicknames")
  65.           .setDescription(
  66.             "> Your discord nickname must be matching your Roblox username, nothing else other than callsigns and it must include your username along with it."
  67.           )
  68.           .setColor("#c40d2c")
  69.           .setImage(
  70.             "https://media.discordapp.net/attachments/1254255009084866622/1255130371083735050/banner.jpg?ex=667c02bf&is=667ab13f&hm=3e6a5d8eb398d03824897983b16424363a6b654c1dcf1771907b8fa2d6a06084&=&format=webp"
  71.           )
  72.       );
  73.       sendOption.content = user ? user.toString() : null;
  74.     } else if (cmd === "r4") {
  75.         sendOption.embeds.push(
  76.           embed
  77.             .setTitle("``R4`` Advertisement")
  78.             .setDescription(
  79.               "> Prevent from promoting any of your social media pages or anything directed toward you on social media, promoting discord servers is strictly prohibited."
  80.             )
  81.             .setColor("#c40d2c")
  82.             .setImage(
  83.               "https://media.discordapp.net/attachments/1254255009084866622/1255130371083735050/banner.jpg?ex=667c02bf&is=667ab13f&hm=3e6a5d8eb398d03824897983b16424363a6b654c1dcf1771907b8fa2d6a06084&=&format=webp"
  84.             )
  85.         );
  86.         sendOption.content = user ? user.toString() : null;
  87.     } else if (cmd === "r5") {
  88.         sendOption.embeds.push(
  89.           embed
  90.             .setTitle("``R5`` Adult Content")
  91.             .setDescription(
  92.               "> We strictly prohibit any gore, nudity or pornographic images, sending them will result in harsh punishment and this is unappealable action."
  93.             )
  94.             .setColor("#c40d2c")
  95.             .setImage(
  96.               "https://media.discordapp.net/attachments/1254255009084866622/1255130371083735050/banner.jpg?ex=667c02bf&is=667ab13f&hm=3e6a5d8eb398d03824897983b16424363a6b654c1dcf1771907b8fa2d6a06084&=&format=webp"
  97.             )
  98.         );
  99.         sendOption.content = user ? user.toString() : null;
  100.     } else if (cmd === "r6") {
  101.         sendOption.embeds.push(
  102.           embed
  103.             .setTitle("``R6`` Flooding")
  104.             .setDescription(
  105.               "> You must keep your messaging under a certain limit to ensure you are not flooding our server, you must keep all text under 6 sentences, or you will be punished for flooding, prevent from spamming as you do not gain extra experience from chatting more frequently."
  106.             )
  107.             .setColor("#c40d2c")
  108.             .setImage(
  109.               "https://media.discordapp.net/attachments/1254255009084866622/1255130371083735050/banner.jpg?ex=667c02bf&is=667ab13f&hm=3e6a5d8eb398d03824897983b16424363a6b654c1dcf1771907b8fa2d6a06084&=&format=webp"
  110.             )
  111.         );
  112.         sendOption.content = user ? user.toString() : null;
  113.     } else if (cmd === "r7") {
  114.         sendOption.embeds.push(
  115.           embed
  116.             .setTitle("``R7`` English Server")
  117.             .setDescription(
  118.               "> All of your conversations must be under the English language, we are an English only server and any conversations out of English will be moderated."
  119.             )
  120.             .setColor("#c40d2c")
  121.             .setImage(
  122.               "https://media.discordapp.net/attachments/1254255009084866622/1255130371083735050/banner.jpg?ex=667c02bf&is=667ab13f&hm=3e6a5d8eb398d03824897983b16424363a6b654c1dcf1771907b8fa2d6a06084&=&format=webp"
  123.             )
  124.         );
  125.         sendOption.content = user ? user.toString() : null;
  126.     } else if (cmd === "r8") {
  127.         sendOption.embeds.push(
  128.           embed
  129.             .setTitle("``R8`` Alternative Accounts")
  130.             .setDescription(
  131.               "> We restrict you to only having 1 account within our server, any more is prohibited. If your discord account was terminated, please make a support ticket informing us."
  132.             )
  133.             .setColor("#c40d2c")
  134.             .setImage(
  135.               "https://media.discordapp.net/attachments/1254255009084866622/1255130371083735050/banner.jpg?ex=667c02bf&is=667ab13f&hm=3e6a5d8eb398d03824897983b16424363a6b654c1dcf1771907b8fa2d6a06084&=&format=webp"
  136.             )
  137.         );
  138.         sendOption.content = user ? user.toString() : null;
  139.     } else if (cmd === "r9") {
  140.         sendOption.embeds.push(
  141.           embed
  142.             .setTitle("``R9`` Common Sense")
  143.             .setDescription(
  144.               "> Although we may not have some rules listed here, we will punish those who do not use their common sense and abide by possible rules. If you feel the rule would be restricted refrain from doing it."
  145.             )
  146.             .setColor("#c40d2c")
  147.             .setImage(
  148.               "https://media.discordapp.net/attachments/1254255009084866622/1255130371083735050/banner.jpg?ex=667c02bf&is=667ab13f&hm=3e6a5d8eb398d03824897983b16424363a6b654c1dcf1771907b8fa2d6a06084&=&format=webp"
  149.             )
  150.         );
  151.         sendOption.content = user ? user.toString() : null;
  152.     }
  153.  
  154.  
  155.     message.channel.send({ embeds: [sendOption]})
  156.     message.delete();
  157.   }
  158. });
  159.  
  160.  
  161.  client.on("messageCreate", async (message) => {
  162.   if (message.author.bot) return;
  163.  
  164.   if (!message.content.startsWith(client.prefix)) return;
  165.   const args = message.content.substring(1).split(" ");
  166.   const cmd = args.shift().toLowerCase();
  167.   const embed = new EmbedBuilder();
  168.   const sendOption = { embeds: [], content: "" };
  169.  
  170.   if (message.member.roles.cache.has(client.allowedRoleIDMember)) {
  171.     if (cmd === "app") {
  172.         sendOption.embeds.push(
  173.             embed
  174.             .setDescription("<:Albuquerque:1254279653175070811> [**Staff Application**](https://melonly.xyz/forms/7210522343515361280)")
  175.             .setColor("#c40d2c")
  176.         );
  177.     } else if (cmd === "group") {
  178.         sendOption.embeds.push(
  179.             embed
  180.             .setDescription("<:people_w:1254292907435753535> [**Group**](https://www.roblox.com/groups/17240768/Albuquerque-Roleplay)")
  181.             .setColor("#c40d2c")
  182.         );
  183.      
  184.      
  185.     }
  186.     message.channel.send({ embeds: [sendOption]})
  187.     message.delete();
  188.   }
  189. });
  190.  
  191.  
  192.  
  193.  
  194.  
  195. client.on("guildMemberAdd", async (member) => {
  196.   const channelID = "1254242667630428170"; // Replace with the ID of your desired channel
  197.   const welcomeMessage = `🎈${member} Welcome to **Albuquerque Roleplay**!\nWe now have ``${memberCount}`` members.`; // Customize your welcome message here
  198.  
  199.   const channel = member.guild.channels.cache.get(channelID);
  200.   if (!channel) return;
  201.  
  202.   channel.send({ content: welcomeMessage }).catch(console.error);
  203. });
  204.  
  205. client.login(process.env.TOKEN);
Advertisement
Add Comment
Please, Sign In to add comment