Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require('dotenv').config();
- const Discord = require("discord.js")
- const client = new Discord.Client({ intents: ['GUILD_MEMBERS','GUILDS', 'GUILD_MESSAGES'] });
- const { MessageEmbed } = require('discord.js');
- const { Permissions } = require('discord.js');
- client.on("ready", () => {
- console.log(`Logged in as ${client.user.tag}!`)
- client.user.setActivity("Gakkie is the best!");
- })
- client.on("messageCreate", async msg => {
- if (msg.author.bot) return false
- if (msg.content === ".ping") {
- msg.channel.send(`PONG 🏓API Latency is ${Math.round(client.ws.ping)}ms`);
- }
- if (msg.content === ".pong") {
- msg.channel.send(`PING 🏓API Latency is ${Math.round(client.ws.ping)}ms`);
- }
- if (msg.content === ".verify") {
- const channel = await msg.guild.channels.create('Ticket Verication', {
- type: 'GUILD_TEXT',
- permissionOverwrites: [
- {
- id: msg.guild.id,
- deny: [Permissions.FLAGS.VIEW_CHANNEL],
- },
- {
- id: msg.author.id,
- allow: [Permissions.FLAGS.VIEW_CHANNEL],
- },
- ],
- });
- const mentionnn = msg.member.user.id;
- msg.reply(`created ${channel}`);
- }
- if (msg.content === ".delete") {
- const allowedRoles = ['872028086198210570', '872084677073199126', '872060195117858817','934717670232850472', '932580139701792793'];
- const hasRole = allowedRoles.some((id) => msg.member.roles.cache.has(id));
- if (hasRole) {
- await msg.channel.delete()
- }
- else{
- msg.channel.send("Denied")
- }
- }
- if (msg.content === ".questions"){
- await msg.channel.send("Question one: What is your name?")
- await msg.channel.send("Question two: How old are you?")
- await msg.channel.send("Question three: When is your date of birth?")
- 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?")
- 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 :)")
- }
- if (msg.content === ".lock"){
- const allowedRoles = ['872028086198210570', '872084677073199126', '872060195117858817','934717670232850472', '932580139701792793'];
- const hasRole = allowedRoles.some((id) => msg.member.roles.cache.has(id));
- if (hasRole) {
- await msg.channel.permissionOverwrites.create(msg.channel.guild.roles.everyone, { SEND_MESSAGES: false });
- await msg.reply("LOCKED")
- }
- else{
- msg.channel.send("Denied")
- }
- }
- if (msg.content === ".unlock"){
- const allowedRoles = ['872028086198210570', '872084677073199126', '872060195117858817','934717670232850472','932580139701792793'];
- const hasRole = allowedRoles.some((id) => msg.member.roles.cache.has(id));
- if (hasRole) {
- await msg.channel.permissionOverwrites.create(msg.channel.guild.roles.everyone, { SEND_MESSAGES: true });
- await msg.reply("UNLOCKED")
- }
- else{
- msg.channel.send("Denied")
- }
- }
- if (msg.content === ".invite"){
- await msg.channel.send("")
- }
- })
- client.login(process.env.TOKEN)
Add Comment
Please, Sign In to add comment