DjKammo

Untitled

Jan 25th, 2022 (edited)
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. require('dotenv').config();
  2. const Discord = require("discord.js")
  3. const client = new Discord.Client({ intents: ['GUILD_MEMBERS','GUILDS', 'GUILD_MESSAGES'] });
  4. const { MessageEmbed } = require('discord.js');
  5. const { Permissions } = require('discord.js');
  6.  
  7. client.on("ready", () => {
  8.   console.log(`Logged in as ${client.user.tag}!`)
  9.   client.user.setActivity("Gakkie is the best!");
  10. })
  11. client.on("messageCreate", async msg => {
  12.   if (msg.author.bot) return false
  13.  
  14.   if (msg.content === ".ping") {
  15.     msg.channel.send(`PONG 🏓API Latency is ${Math.round(client.ws.ping)}ms`);
  16.   }
  17.   if (msg.content === ".pong") {
  18.     msg.channel.send(`PING 🏓API Latency is ${Math.round(client.ws.ping)}ms`);
  19.   }
  20.   if (msg.content === ".verify") {
  21.     const channel = await msg.guild.channels.create('Ticket Verication', {
  22.       type: 'GUILD_TEXT',
  23.       permissionOverwrites: [
  24.         {
  25.           id: msg.guild.id,
  26.           deny: [Permissions.FLAGS.VIEW_CHANNEL],
  27.         },
  28.         {
  29.           id: msg.author.id,
  30.           allow: [Permissions.FLAGS.VIEW_CHANNEL],
  31.         },
  32.       ],
  33.     });
  34.     const mentionnn = msg.member.user.id;
  35.     msg.reply(`created ${channel}`);
  36.   }
  37.   if (msg.content === ".delete") {
  38.     const allowedRoles = ['872028086198210570', '872084677073199126', '872060195117858817','934717670232850472', '932580139701792793'];
  39.     const hasRole = allowedRoles.some((id) => msg.member.roles.cache.has(id));
  40.     if (hasRole) {
  41.       await msg.channel.delete()
  42.       }
  43.     else{
  44.       msg.channel.send("Denied")
  45.     }
  46.   }
  47.  
  48.   if (msg.content === ".questions"){
  49.     await msg.channel.send("Question one: What is your name?")
  50.     await msg.channel.send("Question two: How old are you?")
  51.     await msg.channel.send("Question three: When is your date of birth?")
  52.     await msg.channel.send("Question four: Is it ok if we see a clear picture of your ID or any other way we can verify you for being over 18?")
  53.     await msg.channel.send("If you need help or you have answered the questions and a mod hasn`t seen it yet please ping one of our mod team and we will be happy to help you :)")
  54.   }
  55.   if (msg.content === ".lock"){
  56.     const allowedRoles = ['872028086198210570', '872084677073199126', '872060195117858817','934717670232850472', '932580139701792793'];
  57.     const hasRole = allowedRoles.some((id) => msg.member.roles.cache.has(id));
  58.     if (hasRole) {
  59.       await msg.channel.permissionOverwrites.create(msg.channel.guild.roles.everyone, { SEND_MESSAGES: false });
  60.       await msg.reply("LOCKED")
  61.     }
  62.     else{
  63.       msg.channel.send("Denied")
  64.     }
  65.   }
  66.   if (msg.content === ".unlock"){
  67.     const allowedRoles = ['872028086198210570', '872084677073199126', '872060195117858817','934717670232850472','932580139701792793'];
  68.     const hasRole = allowedRoles.some((id) => msg.member.roles.cache.has(id));
  69.     if (hasRole) {
  70.     await msg.channel.permissionOverwrites.create(msg.channel.guild.roles.everyone, { SEND_MESSAGES: true });
  71.     await msg.reply("UNLOCKED")
  72.     }
  73.     else{
  74.       msg.channel.send("Denied")
  75.     }
  76.   }
  77.   if (msg.content === ".invite"){
  78.     await msg.channel.send("")
  79.   }
  80. })
  81.  
  82.  
  83. client.login(process.env.TOKEN)
Add Comment
Please, Sign In to add comment