Advertisement
gaber-elsayed

blacklist

Oct 6th, 2021
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. client.on('message', async message => {
  2. if (!message.content.startsWith(prefix) || message.author.bot) return;
  3. const args = message.content.slice(prefix.length).trim().split(/ +/);
  4. const command = args.shift().toLowerCase();
  5. let user = message.mentions.members.first() || client.users.cache.find(u => u.id === args[0])
  6. let member = message.guild.member(user)
  7. if(command === "blacklist") {
  8. if(!message.member.hasPermission("MANAGE_GUILD")) return;
  9. if(!user) return message.channel.send('i cant find this user!')
  10. if(db.has(`u`,member.id)) return message.channel.send('this member already blacklisted!')
  11. db.set(`u`,member.id)
  12. message.channel.send('member added to blacklisted users!')
  13. }
  14. if(command === "remove-blacklist") {
  15. if(!message.member.hasPermission("MANAGE_GUILD")) return;
  16. if(!user) return message.channel.send('i cant find this user!')
  17. if(!db.has(`u`,member.id)) return message.channel.send('this member not blacklisted!')
  18. db.delete(`u`,member.id)
  19. message.channel.send('member removed from blacklisted users!')
  20. }
  21. if(command === 'delete-all') {
  22. if(!message.member.hasPermission("MANAGE_GUILD")) return;
  23. db.delete('u')
  24. message.channel.send('removed all blacklists')
  25. }
  26. });
  27.  
  28. السطر اللي تحطه في كل اكوادك
  29. if(db.has("u", message.author.id)) return message.channel.send('you are blacklisted!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement