gaber-elsayed

Create Gaming Server (JS)

Nov 26th, 2019
1,759
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.69 KB | None | 0 0
  1. const Discord = require('discord.js');
  2. const client = new Discord.Client();
  3.  
  4. client.on("message", message =>{
  5. //السطر ال تحت لمنع تكرار انشاء الرتب لو عاوز تغير اسم الرتب غيرها وحط اسمها فى السطر ال تحت كمان علشان ميحصلش سبام
  6. let roles = message.guild.roles.find(all=> all.name === "⇁『KiNG 』‏‏༄ ❥", "⇁『LEADER』‏‏༄ ❥", "⇁『BiG BOSS 』‏‏༄ ❥", "⇁『CAPTAIN 』‏‏༄ ❥", "⇁『SERGEANT 』‏‏༄ ❥",
  7. "⇁『youtuber 』‏‏༄ ❥", "⇁『ACTIVE 』‏‏༄ ❥");//Baron#1500
  8. if(message.content.startsWith(prefix + "roles")) {//Baron#1500
  9. if(message.author.bot) return;//Baron#1500
  10. if(roles) return message.reply('**الرتب موجوده بالفعل**')//Baron#1500
  11. //دى بقا الرتب ال انت عاوزو يعملها
  12. let roleking = message.guild.roles.find(r => r.name === "⇁『KiNG 』‏‏༄ ❥");//Baron#1500
  13. if(!roleking) {
  14. message.guild.createRole({//Baron#1500
  15. name: '⇁『KiNG 』‏‏༄ ❥',
  16. color: 'RANDOM',
  17. position: (1),
  18. hoist: (true),
  19. permissions: 'ADMINISTRATOR'
  20. })
  21. }
  22. let roleleader = message.guild.roles.find(r => r.name === "⇁『LEADER』‏‏༄ ❥");//Baron#1500
  23. if(!roleleader) {
  24. message.guild.createRole({
  25. name: '⇁『LEADER』‏‏༄ ❥',
  26. color: 'RANDOM',
  27. position: (2),//Baron#1500
  28. hoist: (true),
  29. permissions: ['CREATE_INSTANT_INVITE', 'KICK_MEMBERS', 'BAN_MEMBERS', 'MANAGE_CHANNELS', 'ADD_REACTIONS', 'VIEW_AUDIT_LOG', 'VIEW_CHANNEL', 'READ_MESSAGES', 'SEND_MESSAGES',
  30. 'SEND_TTS_MESSAGES', 'MANAGE_MESSAGES', 'EMBED_LINKS', 'ATTACH_FILES', 'READ_MESSAGE_HISTORY', 'MENTION_EVERYONE', 'CONNECT', 'SPEAK', 'MUTE_MEMBERS', 'DEAFEN_MEMBERS',
  31. 'MOVE_MEMBERS', 'USE_VAD', 'CHANGE_NICKNAME', 'MANAGE_NICKNAMES'],
  32. })
  33. }
  34. let rolebigboss = message.guild.roles.find(r => r.name === "⇁『BiG BOSS 』‏‏༄ ❥");//Baron#1500
  35. if(!rolebigboss) {
  36. message.guild.createRole({
  37. name: '⇁『BiG BOSS 』‏‏༄ ❥',
  38. color: 'RANDOM',
  39. position: (3),
  40. hoist: (true),
  41. permissions: ['CREATE_INSTANT_INVITE', 'KICK_MEMBERS', 'ADD_REACTIONS', 'VIEW_CHANNEL', 'READ_MESSAGES', 'SEND_MESSAGES', 'MANAGE_MESSAGES', 'EMBED_LINKS', 'ATTACH_FILES', 'CONNECT', 'SPEAK', 'MUTE_MEMBERS', 'DEAFEN_MEMBERS',
  42. 'READ_MESSAGE_HISTORY', 'MENTION_EVERYONE', 'MOVE_MEMBERS', 'USE_VAD', 'CHANGE_NICKNAME', 'MANAGE_NICKNAMES']
  43. })
  44. }
  45. let rolecaptain = message.guild.roles.find(r => r.name === "⇁『CAPTAIN 』‏‏༄ ❥");//Baron#1500
  46. if(!rolecaptain) {
  47. message.guild.createRole({
  48. name: '⇁『CAPTAIN 』‏‏༄ ❥',
  49. color: 'RANDOM',
  50. postion: (4),
  51. hoist: (true),
  52. permissions: ['VIEW_CHANNEL', 'READ_MESSAGES', 'SEND_MESSAGES', 'MANAGE_MESSAGES', 'EMBED_LINKS', 'ATTACH_FILES', 'CONNECT', 'SPEAK', 'MUTE_MEMBERS', 'DEAFEN_MEMBERS',
  53. 'READ_MESSAGE_HISTORY', 'MENTION_EVERYONE', 'MOVE_MEMBERS', 'USE_VAD', 'CHANGE_NICKNAME']
  54. })
  55. }
  56. let rolesergant = message.guild.roles.find(r => r.name === "⇁『SERGEANT 』‏‏༄ ❥");//Baron#1500
  57. if(!rolesergant) {
  58. message.guild.createRole({
  59. name: '⇁『SERGEANT 』‏‏༄ ❥',
  60. color: 'RANDOM',//Baron#1500
  61. postion: (5),
  62. hoist: (true),//Baron#1500
  63. permissions: ['VIEW_CHANNEL', 'READ_MESSAGES', 'SEND_MESSAGES', 'MANAGE_MESSAGES', 'EMBED_LINKS', 'ATTACH_FILES', 'CONNECT', 'SPEAK', 'MUTE_MEMBERS',
  64. 'READ_MESSAGE_HISTORY', 'MOVE_MEMBERS', 'USE_VAD', 'CHANGE_NICKNAME']
  65. })
  66. }//Baron#1500
  67. let roleyoutuber = message.guild.roles.find(r => r.name === "⇁『youtuber 』‏‏༄ ❥");
  68. if(!roleyoutuber) {//Baron#1500
  69. message.guild.createRole({
  70. name: '⇁『youtuber 』‏‏༄ ❥',
  71. color: 'RANDOM',
  72. postion: (6),
  73. hoist: (true),//Baron#1500
  74. permissions: ['VIEW_CHANNEL', 'READ_MESSAGES', 'SEND_MESSAGES', 'EMBED_LINKS', 'ATTACH_FILES', 'CONNECT', 'SPEAK',
  75. 'READ_MESSAGE_HISTORY', 'MOVE_MEMBERS', 'USE_VAD', 'CHANGE_NICKNAME', 'ADD_REACTIONS']
  76. })
  77. }
  78. let roleactive = message.guild.roles.find(r => r.name === "⇁『ACTIVE 』‏‏༄ ❥");//Baron#1500
  79. if(!roleactive) {//Baron#1500
  80. message.guild.createRole({
  81. name: '⇁『ACTIVE 』‏‏༄ ❥',
  82. color: 'RANDOM',
  83. postion: (7),
  84. hoist: (true),//Baron#1500
  85. permissions: ['VIEW_CHANNEL', 'READ_MESSAGES', 'SEND_MESSAGES', 'EMBED_LINKS', 'ATTACH_FILES', 'CONNECT', 'SPEAK',//Baron#1500
  86. 'READ_MESSAGE_HISTORY', 'MOVE_MEMBERS', 'USE_VAD', 'CHANGE_NICKNAME', 'ADD_REACTIONS']//Baron#1500
  87. })
  88. message.guild.createRole({//Baron#1500
  89. name: 'Fortnite',
  90. color: 'RANDOM',//Baron#1500
  91. postion: (7),
  92. permissions: ['VIEW_CHANNEL', 'READ_MESSAGES', 'SEND_MESSAGES', 'EMBED_LINKS', 'ATTACH_FILES', 'CONNECT', 'SPEAK',//Baron#1500
  93. 'READ_MESSAGE_HISTORY', 'MOVE_MEMBERS', 'USE_VAD', 'CHANGE_NICKNAME', 'ADD_REACTIONS']//Baron#1500
  94. })
  95. message.guild.createRole({//Baron#1500
  96. name: 'playerunknowns',
  97. color: 'RANDOM',
  98. postion: (7),
  99. permissions: ['VIEW_CHANNEL', 'READ_MESSAGES', 'SEND_MESSAGES', 'EMBED_LINKS', 'ATTACH_FILES', 'CONNECT', 'SPEAK',
  100. 'READ_MESSAGE_HISTORY', 'MOVE_MEMBERS', 'USE_VAD', 'CHANGE_NICKNAME', 'ADD_REACTIONS']//Baron#1500
  101. })//Baron#1500
  102. message.guild.createRole({
  103. name: 'counter-strike',
  104. color: 'RANDOM',//Baron#1500
  105. postion: (7),
  106. permissions: ['VIEW_CHANNEL', 'READ_MESSAGES', 'SEND_MESSAGES', 'EMBED_LINKS', 'ATTACH_FILES', 'CONNECT', 'SPEAK',
  107. 'READ_MESSAGE_HISTORY', 'MOVE_MEMBERS', 'USE_VAD', 'CHANGE_NICKNAME', 'ADD_REACTIONS']
  108. })//Baron#1500
  109. message.guild.createRole({
  110. name: 'creative-destruction',//Baron#1500
  111. color: 'RANDOM',
  112. postion: (7),
  113. permissions: ['VIEW_CHANNEL', 'READ_MESSAGES', 'SEND_MESSAGES', 'EMBED_LINKS', 'ATTACH_FILES', 'CONNECT', 'SPEAK',
  114. 'READ_MESSAGE_HISTORY', 'MOVE_MEMBERS', 'USE_VAD', 'CHANGE_NICKNAME', 'ADD_REACTIONS']
  115. })
  116. message.guild.createRole({//Baron#1500
  117. name: 'overwatch',
  118. color: 'RANDOM',
  119. postion: (7),//Baron#1500
  120. permissions: ['VIEW_CHANNEL', 'READ_MESSAGES', 'SEND_MESSAGES', 'EMBED_LINKS', 'ATTACH_FILES', 'CONNECT', 'SPEAK',
  121. 'READ_MESSAGE_HISTORY', 'MOVE_MEMBERS', 'USE_VAD', 'CHANGE_NICKNAME', 'ADD_REACTIONS']
  122. })//Baron#1500
  123. message.guild.createRole({
  124. name: 'minecraft',//Baron#1500
  125. color: 'RANDOM',
  126. postion: (7),//Baron#1500
  127. permissions: ['VIEW_CHANNEL', 'READ_MESSAGES', 'SEND_MESSAGES', 'EMBED_LINKS', 'ATTACH_FILES', 'CONNECT', 'SPEAK',
  128. 'READ_MESSAGE_HISTORY', 'MOVE_MEMBERS', 'USE_VAD', 'CHANGE_NICKNAME', 'ADD_REACTIONS']
  129. })//Baron#1500
  130. message.guild.createRole({//Baron#1500
  131. name: 'league-of-legends',
  132. color: 'RANDOM',//Baron#1500
  133. postion: (7),
  134. permissions: ['VIEW_CHANNEL', 'READ_MESSAGES', 'SEND_MESSAGES', 'EMBED_LINKS', 'ATTACH_FILES', 'CONNECT', 'SPEAK',
  135. 'READ_MESSAGE_HISTORY', 'MOVE_MEMBERS', 'USE_VAD', 'CHANGE_NICKNAME', 'ADD_REACTIONS']
  136. })//Baron#1500
  137. message.channel.send(message.member + '**جارى انشاء الرتب**').then((m)=> {
  138. setTimeout(() => {//Baron#1500
  139. m.edit('**تم انشاء الرتب بنجاح**')
  140. }, 3000);//Baron#1500
  141. })
  142. }//Baron#1500
  143. }
  144. })//Baron#1500
  145. Baron.on("message", message =>{
  146. let roleyoutuber = message.guild.roles.find(r => r.name === "⇁『youtuber 』‏‏༄ ❥");
  147. let rolepubg = message.guild.roles.find(r => r.name === "playerunknowns");
  148. let rolecsgo = message.guild.roles.find(r => r.name === "counter-strike");
  149. let rolecd = message.guild.roles.find(r => r.name === "creative-destruction");
  150. let roleow = message.guild.roles.find(r => r.name === "overwatch");
  151. let rolemc = message.guild.roles.find(r => r.name === "minecraft");
  152. let rolelol = message.guild.roles.find(r => r.name === "league-of-legends");
  153. let rolefortnite = message.guild.roles.find(r => r.name === "Fortnite");
  154. //Baron#1500
  155. let roles = message.guild.roles.find(all=> all.name === "⇁『KiNG 』‏‏༄ ❥", "⇁『LEADER』‏‏༄ ❥", "⇁『BiG BOSS 』‏‏༄ ❥", "⇁『CAPTAIN 』‏‏༄ ❥", "⇁『SERGEANT 』‏‏༄ ❥",
  156. "⇁『youtuber 』‏‏༄ ❥", "⇁『ACTIVE 』‏‏༄ ❥");//Baron#1500
  157. if(message.content.startsWith(prefix + "channels")) {
  158. if(!roles) return message.reply("**من فضلك قم بانشاء الرتب اولا اكتب $roles**")//Baron#1500
  159. if(roles) {//Baron#1500
  160. message.reply("**جارى انشاء الرومات**").then((c)=> {//Baron#1500
  161. setTimeout(() => {
  162. c.edit("**تم انشاء الرومات بنجاح**")//Baron#1500
  163. }, 10000);
  164. })
  165. message.guild.createChannel(`${message.guild.name}-TEXT` , 'category').then(tb => {//Baron#1500
  166. message.guild.createChannel('welcome' , 'text').then(nws => {
  167. nws.setParent(tb);
  168. nws.overwritePermissions(message.guild.id, {
  169. SEND_MESSAGES: false,
  170. MENTION_EVERYONE: false//Baron#1500
  171. })
  172. })
  173. message.guild.createChannel('info' , 'text').then(inf => {//Baron#1500
  174. inf.setParent(tb);//Baron#1500
  175. inf.overwritePermissions(message.guild.id, {//Baron#1500
  176. SEND_MESSAGES: false,
  177. MENTION_EVERYONE: false//Baron#1500
  178. })
  179. })
  180. message.guild.createChannel('news' , 'text').then(nws => {//Baron#1500
  181. nws.setParent(tb);
  182. nws.overwritePermissions(message.guild.id, {//Baron#1500
  183. SEND_MESSAGES: false,
  184. MENTION_EVERYONE: false//Baron#1500
  185. })
  186. })//Baron#1500
  187. message.guild.createChannel('chat' , 'text').then(cht => {//Baron#1500
  188. cht.setParent(tb);
  189. cht.overwritePermissions(message.guild.id, {
  190. MENTION_EVERYONE: false//Baron#1500
  191. })
  192. })
  193. message.guild.createChannel('bot-commands' , 'text').then(cmd => {//Baron#1500
  194. cmd.setParent(tb);
  195. cmd.overwritePermissions(message.guild.id, {//Baron#1500
  196. MENTION_EVERYONE: false//Baron#1500
  197. })
  198. })
  199. message.guild.createChannel('youtubers' , 'text').then(yt => {//Baron#1500
  200. yt.setParent(tb);//Baron#1500
  201. yt.overwritePermissions(roleyoutuber, {
  202. SEND_MESSAGES: true
  203. })
  204. yt.overwritePermissions(message.guild.id, {//Baron#1500
  205. SEND_MESSAGES: false,
  206. MENTION_EVERYONE: false
  207. })
  208. })//Baron#1500
  209. message.guild.createChannel('pic' , 'text').then(pic => {//Baron#1500
  210. pic.setParent(tb);
  211. pic.overwritePermissions(message.guild.id, {
  212. MENTION_EVERYONE: false
  213. })
  214. })
  215. message.guild.createChannel('cut-tweet' , 'text').then(cut => {
  216. cut.setParent(tb);
  217. cut.overwritePermissions(message.guild.id, {
  218. MENTION_EVERYONE: false
  219. })//Baron#1500
  220. })
  221. })
  222. message.guild.createChannel(`Games-Chat` , 'category').then(tb => {//Baron#1500
  223. message.guild.createChannel('Fortnite' , 'text').then(wlc => {
  224. wlc.setParent(tb);
  225. wlc.overwritePermissions(message.guild.id, {
  226. SEND_MESSAGES: false,
  227. MENTION_EVERYONE: false
  228. })//Baron#1500
  229. wlc.overwritePermissions(rolefortnite, {
  230. SEND_MESSAGES: true,
  231. MENTION_EVERYONE: false
  232. })
  233. })//Baron#1500
  234. message.guild.createChannel('playerunknowns' , 'text').then(ch => {//Baron#1500
  235. ch.setParent(tb);
  236. ch.overwritePermissions(message.guild.id, {//Baron#1500
  237. SEND_MESSAGES: false,
  238. MENTION_EVERYONE: false
  239. })
  240. ch.overwritePermissions(rolepubg, {//Baron#1500
  241. SEND_MESSAGES: true,
  242. MENTION_EVERYONE: false//Baron#1500
  243. })
  244. })
  245. message.guild.createChannel('counter-strike' , 'text').then(ch => {//Baron#1500
  246. ch.setParent(tb);
  247. ch.overwritePermissions(message.guild.id, {
  248. SEND_MESSAGES: false,//Baron#1500
  249. MENTION_EVERYONE: false
  250. })
  251. ch.overwritePermissions(rolecsgo, {
  252. SEND_MESSAGES: true,
  253. MENTION_EVERYONE: false
  254. })//Baron#1500
  255. })
  256. message.guild.createChannel('creative-destruction' , 'text').then(ch => {//Baron#1500
  257. ch.setParent(tb);
  258. ch.overwritePermissions(rolecd, {
  259. SEND_MESSAGES: true,//Baron#1500
  260. MENTION_EVERYONE: false
  261. })
  262. ch.overwritePermissions(message.guild.id, {
  263. SEND_MESSAGES: false,
  264. MENTION_EVERYONE: false
  265. })//Baron#1500
  266. })
  267. message.guild.createChannel('overwatch' , 'text').then(ch => {
  268. ch.setParent(tb);
  269. ch.overwritePermissions(roleow, {
  270. SEND_MESSAGES: true,
  271. MENTION_EVERYONE: false
  272. })
  273. ch.overwritePermissions(message.guild.id, {
  274. SEND_MESSAGES: false,
  275. MENTION_EVERYONE: false
  276. })
  277. })
  278. message.guild.createChannel('minecraft' , 'text').then(ch => {
  279. ch.setParent(tb);
  280. ch.overwritePermissions(rolemc, {
  281. SEND_MESSAGES: true,
  282. MENTION_EVERYONE: false
  283. })
  284. ch.overwritePermissions(message.guild.id, {
  285. SEND_MESSAGES: false,
  286. MENTION_EVERYONE: false
  287. })
  288. })
  289. message.guild.createChannel('league-of-legends' , 'text').then(ch => {
  290. ch.setParent(tb);
  291. ch.overwritePermissions(rolelol, {
  292. SEND_MESSAGES: true,
  293. MENTION_EVERYONE: false
  294. })
  295. ch.overwritePermissions(message.guild.id, {
  296. SEND_MESSAGES: false,
  297. MENTION_EVERYONE: false
  298. })
  299. })
  300. })
  301. message.guild.createChannel(`.${message.guild.name} | 🔊 .` , 'category').then(tb => {
  302. message.guild.createChannel('「الـقـرأن الـكـريــم | 📜」' , 'voice').then(ch => {
  303. ch.setParent(tb);
  304. ch.overwritePermissions(message.guild.id, {
  305. SPEAK: false//Baron#1500
  306. })
  307. message.guild.createChannel('「Events | 🎲 .」' , 'voice').then(ch => {
  308. ch.setParent(tb);
  309. ch.setUserLimit(50)//Baron#1500
  310. ch.overwritePermissions(message.guild.id, {
  311. SPEAK: false,
  312. //Baron#1500
  313. })
  314. })
  315. })
  316. })
  317. message.guild.createChannel(`.Talking | ✋🏽 .` , 'category').then(tb => {
  318. message.guild.createChannel(`「${message.guild.name} | 🔊 .」` , 'voice').then(ch => {
  319. ch.setParent(tb);
  320. ch.setUserLimit(50)//Baron#1500
  321. })
  322. message.guild.createChannel('「Sounds | ♫ .」' , 'voice').then(ch => {
  323. ch.setParent(tb);
  324. ch.setUserLimit(50)//Baron#1500
  325. })
  326. })
  327. message.guild.createChannel(`» Games | الالعاب .` , 'category').then(tb => {
  328. message.guild.createChannel(`Fortnite | فورتنآيت .` , 'voice').then(ch => {
  329. ch.setParent(tb);
  330. ch.overwritePermissions(message.guild.id, {
  331. CONNECT: false,
  332.  
  333. })
  334. ch.overwritePermissions(rolefortnite, {
  335. CONNECT: true,
  336.  
  337. })
  338. })//Baron#1500
  339. message.guild.createChannel('Minecraft | مآينكرآفت' , 'voice').then(ch => {
  340. ch.setParent(tb);
  341. ch.overwritePermissions(message.guild.id, {
  342. CONNECT: false,
  343.  
  344. })
  345. ch.overwritePermissions(rolemc, {
  346. CONNECT: true,
  347.  
  348. })
  349. })//Baron#1500
  350. message.guild.createChannel(`Creative | كريآتف .` , 'voice').then(ch => {
  351. ch.setParent(tb);
  352. ch.overwritePermissions(message.guild.id, {
  353. CONNECT: false,
  354.  
  355. })
  356. ch.overwritePermissions(rolecd, {
  357. CONNECT: true,//Baron#1500
  358.  
  359. })
  360. })
  361. message.guild.createChannel('Legends | لوول' , 'voice').then(ch => {
  362. ch.setParent(tb);
  363. ch.overwritePermissions(message.guild.id, {
  364. CONNECT: false,
  365.  
  366. })
  367. ch.overwritePermissions(rolelol, {
  368. CONNECT: true,
  369.  
  370. })
  371. })
  372. })
  373. message.guild.createChannel(`» DJ | الموسيقي .` , 'category').then(tb => {//Baron#1500
  374. message.guild.createChannel(`» Art.` , 'voice').then(ch => {
  375. ch.setParent(tb);
  376. ch.setUserLimit(15)
  377. })
  378. message.guild.createChannel(`» Fun.` , 'voice').then(ch => {
  379. ch.setParent(tb);
  380. ch.setUserLimit(15)
  381. })
  382. message.guild.createChannel(`» Life.` , 'voice').then(ch => {
  383. ch.setParent(tb);
  384. ch.setUserLimit(15)
  385. })
  386. message.guild.createChannel(`» Sing.` , 'voice').then(ch => {
  387. ch.setParent(tb);
  388. ch.setUserLimit(15)
  389. })
  390. })
  391. message.guild.createChannel(`» Privates | خآص .` , 'category').then(tb => {//Baron#1500
  392. message.guild.createChannel(`» Single.` , 'voice').then(ch => {
  393. ch.setParent(tb);
  394. ch.setUserLimit(1)
  395. })
  396. message.guild.createChannel('» Doubles.' , 'voice').then(ch => {
  397. ch.setParent(tb);
  398. ch.setUserLimit(2)
  399. })
  400. message.guild.createChannel('» Triples.' , 'voice').then(ch => {
  401. ch.setParent(tb);
  402. ch.setUserLimit(3)
  403. })
  404. message.guild.createChannel('» Forth.' , 'voice').then(ch => {
  405. ch.setParent(tb);
  406. ch.setUserLimit(4)
  407. })
  408. message.guild.createChannel('» Classic.' , 'voice').then(ch => {
  409. ch.setParent(tb);
  410. ch.setUserLimit(10)
  411. })
  412. message.guild.createChannel('» Group.' , 'voice').then(ch => {
  413. ch.setParent(tb);
  414. ch.setUserLimit(15)
  415. })
  416. }
  417. }
  418. }
  419. })
  420.  
  421. client.login(process.env.BOT_TOKEN)
Advertisement
Add Comment
Please, Sign In to add comment