Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { SlashCommandBuilder } = require("@discordjs/builders");
- const roles = [
- { name: "Kolor Biały", value: "1125084088659873925" },
- { name: "Kolor Różowy", value: "1125084086726307880" },
- { name: "Kolor Czarny", value: "1125084090882871379" },
- { name: "Kolor Niebieski", value: "1125084085036007494" },
- { name: "Kolor Fioletowy", value: "1125084083702218852" },
- { name: "Los Węglowy", value: "1084213460784644156" },
- { name: "Pracownik", value: "1097973902115864748" },
- { name: "Los Gwiezdy", value: "1084222166607863869" },
- { name: "Kierownik", value: "1097976838384521308" },
- { name: "VIP", value: "823896548991041586" },
- { name: "Menadżer", value: "1097977276085309591" },
- { name: "Właściciel Firmy", value: "1097978740706922646" },
- { name: "Milioner", value: "855504226586460161" },
- { name: "Miliarder", value: "1122825344534192168" },
- { name: "Rodzic", value: "1097979429021548725" },
- { name: "Legenda", value: "1129400450878296095" },
- ];
- module.exports = {
- data: new SlashCommandBuilder()
- .setName("wymiana")
- .setDescription("Przekaż komuś jedną ze swoich rang.")
- .addUserOption((user) => user.setName("osoba").setDescription("Osoba, której chcesz przekazać rangę.").setRequired(true))
- .addStringOption((string) => string.setName("ranga").setDescription("Ranga jaką chcesz oddać.").addChoices(...roles).setRequired(true)),
- cooldown: "15s",
- requiredRoles: ["1125086389453725858"],
- async execute(client, interaction) {
- let target = interaction.options.getMember("osoba")
- let ranga = interaction.options.getString("ranga")
- try {
- 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." });
- if (!interaction.member.roles.cache.has(ranga)) return client.error(interaction, { description: `Nie posiadasz <@&${ranga}>` })
- if (target.roles.cache.has(ranga)) return client.error(interaction, { description: `Ta osoba posiada już <@&${ranga}>` })
- interaction.member.roles.remove(ranga, this.requiredRoles)
- target.roles.add(ranga)
- return client.success(interaction, { description: `Poprawnie przekazano <@&${ranga}> do ${target}` })
- } catch (err) {
- client.error(interaction, { description: "Wystąpił błąd! Spróbuj ponownie później" });
- client.logger.error(err);
- }
- },
- };
Advertisement
Add Comment
Please, Sign In to add comment