Guest User

Untitled

a guest
Jul 20th, 2023
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. const { SlashCommandBuilder } = require("@discordjs/builders");
  2.  
  3. const roles = [
  4. { name: "Kolor Biały", value: "1125084088659873925" },
  5. { name: "Kolor Różowy", value: "1125084086726307880" },
  6. { name: "Kolor Czarny", value: "1125084090882871379" },
  7. { name: "Kolor Niebieski", value: "1125084085036007494" },
  8. { name: "Kolor Fioletowy", value: "1125084083702218852" },
  9. { name: "Los Węglowy", value: "1084213460784644156" },
  10. { name: "Pracownik", value: "1097973902115864748" },
  11. { name: "Los Gwiezdy", value: "1084222166607863869" },
  12. { name: "Kierownik", value: "1097976838384521308" },
  13. { name: "VIP", value: "823896548991041586" },
  14. { name: "Menadżer", value: "1097977276085309591" },
  15. { name: "Właściciel Firmy", value: "1097978740706922646" },
  16. { name: "Milioner", value: "855504226586460161" },
  17. { name: "Miliarder", value: "1122825344534192168" },
  18. { name: "Rodzic", value: "1097979429021548725" },
  19. { name: "Legenda", value: "1129400450878296095" },
  20. ];
  21.  
  22. module.exports = {
  23. data: new SlashCommandBuilder()
  24. .setName("wymiana")
  25. .setDescription("Przekaż komuś jedną ze swoich rang.")
  26. .addUserOption((user) => user.setName("osoba").setDescription("Osoba, której chcesz przekazać rangę.").setRequired(true))
  27. .addStringOption((string) => string.setName("ranga").setDescription("Ranga jaką chcesz oddać.").addChoices(...roles).setRequired(true)),
  28. cooldown: "15s",
  29. requiredRoles: ["1125086389453725858"],
  30. async execute(client, interaction) {
  31. let target = interaction.options.getMember("osoba")
  32. let ranga = interaction.options.getString("ranga")
  33. try {
  34. if (interaction.member.roles.cache.some((x) => client.config.roles.inne.ekoBlock.includes(x.id))) return client.error(interaction, { description: "Posiadasz rangę blokującą dostęp do ekonomi serwera." });
  35. if (!interaction.member.roles.cache.has(ranga)) return client.error(interaction, { description: `Nie posiadasz <@&${ranga}>` })
  36. if (target.roles.cache.has(ranga)) return client.error(interaction, { description: `Ta osoba posiada już <@&${ranga}>` })
  37.  
  38. interaction.member.roles.remove(ranga, this.requiredRoles)
  39. target.roles.add(ranga)
  40.  
  41. return client.success(interaction, { description: `Poprawnie przekazano <@&${ranga}> do ${target}` })
  42. } catch (err) {
  43. client.error(interaction, { description: "Wystąpił błąd! Spróbuj ponownie później" });
  44. client.logger.error(err);
  45. }
  46. },
  47. };
Advertisement
Add Comment
Please, Sign In to add comment