This commit is contained in:
Stanislaw
2021-10-04 19:58:46 +02:00
parent 270fcfa814
commit 7af5d661e9
2 changed files with 28 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
"hexBlue": "61f2ea", "hexBlue": "61f2ea",
"hexRed": "fb636b", "hexRed": "fb636b",
"iconurl": "https://i.imgur.com/4AmRDyX.png", "iconurl": "https://i.imgur.com/4AmRDyX.png",
"timeout": 4000,
"rolesList": [ "rolesList": [
"tf2", "tf2",
"liga", "liga",

View File

@@ -1,4 +1,4 @@
const { MessageActionRow, MessageButton } = require('discord.js'); const { MessageActionRow, MessageButton, ButtonInteraction, Interaction, Client } = require('discord.js');
module.exports = { module.exports = {
name: 'embed', name: 'embed',
@@ -58,13 +58,37 @@ module.exports = {
i++; i++;
} }
readyMsg = { embeds: [embed], components: btnList }; readyMsg = { embeds: [embed], components: btnList };
break; //Buttons fukken works
default:
break;
default:
embed.title = `zły parametr: ` + args[0]; embed.title = `zły parametr: ` + args[0];
embed.color = cl.cfg.hexRed; embed.color = cl.cfg.hexRed;
readyMsg = { embeds: [embed] }; readyMsg = { embeds: [embed] };
break; break;
} }
msg.channel.send(readyMsg); msg.channel.send(readyMsg);
if(args[0] === "rolki")
{
cl.on('interactionCreate', inter => {
if(!inter.isButton()) return;
const role = inter.member.guild.roles.cache.find((role) => role.name == inter.customId);
if(inter.member.roles.cache.has(role))
{
inter.member.roles.add(role)
inter.reply("Gratulacje, dodalismy ci tą bezużyteczną rangę",{timeout:cl.cfg.timeout})
.then (inter.deleteReply())
}
else
{
inter.member.roles.remove(role)
inter.reply("Gratulacje, odebraliśmy ci tą bezużyteczną rangę",{timeout:cl.cfg.timeout})
.then (inter.deleteReply())
}
}
)
}
}, },
}; };