toowake

Random Game

Mar 31st, 2023
564
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.69 KB | None | 0 0
  1. const { SlashCommandBuilder, EmbedBuilder} = require("discord.js");
  2.  
  3. module.exports = {
  4. data: new SlashCommandBuilder()
  5. .setName("game")
  6. .setDescription("get a random game")
  7. .addStringOption(option => option
  8. .setName("category")
  9. .setDescription("the category")
  10. .addChoices(
  11. {name: "FPS", value: "FPS"},
  12. {name: "Shooter", value: "Shooter"},
  13. {name: "Arcade", value: "Arcade"},
  14. {name: "Rythm", value: "Rythm"},
  15. {name: "Action", value: "Action"},
  16. {name: "Racing", value: "Racing"},
  17. {name: "Military", value: "Military"},
  18. {name: "Adventure", value: "Adventure"},
  19. )
  20. .setRequired(true)
  21. ),
  22.  
  23. async execute (interaction) {
  24. const Rythm = ["Fuser", "AVICII Invector", "Ragnarock", "Friday Night Funkin", "Just Dance", "Thumper", "Guitar Hero 3: Legends Of Rock", "Crypt Of The NecroDancer", "Pistol Whip", "Beat Saber"];
  25. const FPS = ["Halo Infinite", "Call of Duty MW2", "Warzone 2", "Quake 2021", "Black Mesa", "Doom Eternal", "Overwatch 2", "CS:GO", "Half Life 2", "Rainbow Six Siege", "Escape from tarkov", "Titanfall 2", "Left 4 dead 2", "Team Fortess 2", "Valorant", "Unreal Tournament"];
  26. const Arcade = ["Dead Cells 2", "Fantasian", "NUTS", "Disney Melee Mania", "Assemble with care", "Monster Hunter Strory +", "Card of Darkness", "Survival Z"];
  27. const Shooter = ["Apex Legends", "Call of Duty MW2", "CS:GO", "Destiny 2", "Fortnite", "PUBG", "Valorant", "Overwatch 2", "Battlefield 2042", "Ranbow 6 Siege"];
  28. const Military = ["Hell let loose", "Pavlov VR", "ARMA 3", "Sniper: Ghost Warrior Contracts 2", "Squad", "Enlisted", "Call of Duty: Vanguard", "Defcon", "Tannenberg", "WARNO"];
  29. const Action = ["Dead Cells", "Sekiro: Shadows Die Twice", "Bayonetta", "Batman Arkham City", "Hotline Miami", "Devil May Cry 5", "Monster Hunter World", "Vanquish", "Resident Evil 2 (2019)", "TowerFall: Ascension"];
  30. const Racing = ["Forza Horizon 5", "Dirt Rally 2", "Shift 2", "Art of Rally", "Project Cars 2", "Wreckfest"];
  31. const Adventure = ["The walking dead", "Chuchel", "Broken Sword", "Return to monkey island"];
  32.  
  33. const Category = interaction.options.getString("category");
  34.  
  35. if (Category === "Rythm") {
  36. const choices = Math.floor(Math.random() * Rythm.length);
  37.  
  38. const embed = new EmbedBuilder()
  39. .setTitle(`Game for category: ${Category}`)
  40. .setColor("Green")
  41. .addFields(
  42. {name: "Game", value: `${Rythm[choices]}`, inline: true},
  43. {name: "Requested by:", value: `<@${interaction.user.id}>`, inline: true}
  44. )
  45.  
  46. return interaction.reply({
  47. embeds: [embed]
  48. });
  49. }
  50.  
  51. if (Category === "FPS") {
  52. const choices = Math.floor(Math.random() * FPS.length);
  53.  
  54. const embed = new EmbedBuilder()
  55. .setTitle(`Game for category: ${Category}`)
  56. .setColor("Green")
  57. .addFields(
  58. {name: "Game", value: `${FPS[choices]}`, inline: true},
  59. {name: "Requested by:", value: `<@${interaction.user.id}>`, inline: true}
  60. )
  61.  
  62. return interaction.reply({
  63. embeds: [embed]
  64. });
  65. }
  66.  
  67. if (Category === "Arcade") {
  68. const choices = Math.floor(Math.random() * Arcade.length);
  69.  
  70. const embed = new EmbedBuilder()
  71. .setTitle(`Game for category: ${Category}`)
  72. .setColor("Green")
  73. .addFields(
  74. {name: "Game", value: `${FPS[choices]}`, inline: true},
  75. {name: "Requested by:", value: `<@${interaction.user.id}>`, inline: true}
  76. )
  77.  
  78. return interaction.reply({
  79. embeds: [embed]
  80. });
  81. }
  82.  
  83.  
  84. if (Category === "Shooter") {
  85. const choices = Math.floor(Math.random() * Shooter.length);
  86.  
  87. const embed = new EmbedBuilder()
  88. .setTitle(`Game for category: ${Category}`)
  89. .setColor("Green")
  90. .addFields(
  91. {name: "Game", value: `${Shooter[choices]}`, inline: true},
  92. {name: "Requested by:", value: `<@${interaction.user.id}>`, inline: true}
  93. )
  94.  
  95. return interaction.reply({
  96. embeds: [embed]
  97. });
  98. }
  99.  
  100. if (Category === "Military") {
  101. const choices = Math.floor(Math.random() * Military.length);
  102.  
  103. const embed = new EmbedBuilder()
  104. .setTitle(`Game for category: ${Category}`)
  105. .setColor("Green")
  106. .addFields(
  107. {name: "Game", value: `${Military[choices]}`, inline: true},
  108. {name: "Requested by:",value: `<@${interaction.user.id}>`, inline: true}
  109. )
  110.  
  111. return interaction.reply({
  112. embeds: [embed]
  113. });
  114. }
  115.  
  116. if (Category === "Action") {
  117. const choices = Math.floor(Math.random() * Action.length);
  118.  
  119. const embed = new EmbedBuilder()
  120. .setTitle(`Game for category: ${Category}`)
  121. .setColor("Green")
  122. .addFields(
  123. {name: "Game", value: `${Action[choices]}`, inline: true},
  124. {name: "Requested by:", value: `<@${interaction.user.id}>`, inline: true}
  125. )
  126.  
  127. return interaction.reply({
  128. embeds: [embed]
  129. });
  130. }
  131.  
  132. if (Category === "Racing") {
  133. const choices = Math.floor(Math.random() * Racing.length);
  134.  
  135. const embed = new EmbedBuilder()
  136. .setTitle(`Game for category: ${Category}`)
  137. .setColor("Green")
  138. .addFields(
  139. {name: "Game", value: `${Action[choices]}`, inline: true},
  140. {name: "Requested by:", value: `<@${interaction.user.id}>`, inline: true}
  141. )
  142.  
  143. return interaction.reply({
  144. embeds: [embed]
  145. });
  146. }
  147.  
  148. if (Category === "Adventure") {
  149. const choices = Math.floor(Math.random() * Adventure.length);
  150.  
  151. const embed = new EmbedBuilder()
  152. .setTitle(`Game for category: ${Category}`)
  153. .setColor("Green")
  154. .addFields(
  155. {name: "Game", value: `${Adventure[choices]}`, inline: true},
  156. {name: "Requested by:", value: `<@${interaction.user.id}>`, inline: true}
  157. )
  158.  
  159. return interaction.reply({
  160. embeds: [embed]
  161. });
  162. }
  163.  
  164.  
  165. }
  166. }
Advertisement
Add Comment
Please, Sign In to add comment