Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. lient.on("message",(message) => {
  2. if (message.channel.type !== "text") return;
  3. if (!message.content.startsWith(prefix)) return;
  4. if(message.content.startsWith( 'prefix' + "temp on")) {
  5. if (!message.member.hasPermission("MANAGE_CHANNELS")) return message.reply("** You Don't Have Permission `Manage channels` To Do This Command");
  6. temp[message.guild.id] = {
  7. work : true,
  8. channel : "Not Yet"
  9. };
  10. message.guild.createChannel("اضغط لصنع روم مؤقت", 'voice').then(c => {
  11. c.setPosition(1);
  12. temp[message.guild.id].channel = c.id
  13. message.channel.send("** تم صنع رووم بنجاح.**");
  14. });
  15. if(message.content.startsWith( 'prefix' + "temp off")) {
  16. if (!message.member.hasPermission("MANAGE_CHANNELS")) return message.reply("** You Don't Have Permission `Manage channels` To Do This Command");
  17. message.guild.channels.get(temp[message.guild.id]).delete();
  18. temp[message.guild.id] = {
  19. work : false,
  20. channel : "Not Yet"
  21. };
  22. message.channel.send("** تم حذف رووم بنجاح.**");
  23. };
  24. }})
  25. client.on("voiceStateUpdate", (o,n) => {
  26. if (!temp[n.guild.id]) return;
  27. if (temp[n.guild.id].work == false) return;
  28. if (n.voiceChannelID == temp[n.guild.id].channel) {
  29. n.guild.createChannel(n.user.username, 'voice').then(c => {
  30. n.setVoiceChannel(c);
  31. c.overwritePermissions(n.user.id, {
  32. CONNECT:true,
  33. SPEAK:true,
  34. MANAGE_CHANNEL:true,
  35. MUTE_MEMBERS:true,
  36. DEAFEN_MEMBERS:true,
  37. MOVE_MEMBERS:true,
  38. VIEW_CHANNEL:true
  39. });
  40. })
  41. };
  42. if (!o.voiceChannel) return;
  43. if (o.voiceChannel.name == o.user.username) {
  44. o.voiceChannel.delete();
  45. };
  46. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement