client.on(‘message’, message => {
if(message.content.startsWith(prefix + ‘mute’)){
let user = message.mentions.users.first();
let role = message.guild.roles.find(r => r.name === ‘Muted’);
if(!role) message.guild.createRole({name: ‘Muted’});
if(user.bot){
return message.channel.send(I can't mute ${user} because he is a bot);
}
if(user.hasPermission(‘ADMINISTRATOR’)) {
return message.channel.send(I can't mute ${user} because he is staff);
}
if(!user){
message.channel.send(`There's no person to mute tho`);
}
message.guild.channels.forEach(f => {
f.overwritePermissions(role, {
SEND_MESSAGES: false
});
user.addRole(role);
});
message.channel.send(`I muted ${user}`);
}
});
client.on(‘message’, message => {
if(message.content.startsWith(prefix + ‘unmute’)){
let user = message.mentions.users.first();
let role = message.guild.roles.find(r => r.name === 'Muted');
if(!user.roles.has(role)) {
return message.channel.send(He is not muted);
}
user.removeRole(role).then(message.channel.send(Unmuted ${user}));
}
});
This is my code, I just don’t know how to fix it because it isnt working
poi ci sono io che cerco di farlo ma nn so che sbaglio, ho seguito instruzioni e tutorial, sia da youtube che google, ma per vari motivi non capisco.
1 non so tanto l’inglese
2 ho iniziato da tipo 3 settimane a programmare e ho gia comandi facili:
ping, server-info, ban, kick, clear, invite e help
però l’help vorrei farlo con le reazioni, non so se mi capisco… potreste aiutarmi?
then there is me trying to do it but nn I know that I am wrong, I followed instructions and tutorials, both from youtube and google, but for various reasons I do not understand.
1 I don’t know so much english
2 I started planning for like 3 weeks and I already have easy commands:
ping, server-info, ban, kick, clear, invite and help
but the help I would like to do with the reactions, I do not know if I understand… could you help me?
This is my code for my discord bot but nothing works it is something like krxvees code but mine does not work
client.on(“message”, message => {
let user = message.mentions.users.first();
if(message.content.startsWith(prefix + “mute”)){
let user = message.mentions.users.first();
let role = message.guild.roles.find(r => r.name === “Muted”);
if(!role) message.guild.createRole({name: “Muted”});
if(user.bot){
return message.channel.send(“I cant mute {user} because he is a bot");
}
if(user.hasPermission("ADMINISTRATOR")) {
return message.channel.send("I can't mute {user} because he is staff”);
}
if(!user){
message.channel.send(There's no person to mute tho);
}
message.guild.channels.forEach(f => {
f.overwritePermissions(role, {
SEND_MESSAGES: false
});
user.addRole(role);
});
message.channel.send(I muted ${user});
}
});
client.on(“message”, message => {
if(message.content.startsWith(prefix + “unmute”)){
let user = message.mentions.users.first();
let role = message.guild.roles.find(r => r.name === ‘Muted’);
if(!user.roles.has(“Muted”)) {
return message.channel.send(“He is not muted”);
}
user.removeRole(“Muted”).then(message.channel.send(“Unmuted ${user}”));
}
});
let ifHasRole = message.member.roles.find(role => role.name === ‘Muted’);
if(!ifHasRole){
return message.channel.send(‘He is not muted’);
}
})
and my thing is on hello-sq lite
pls help me