Skip to content

Commit

Permalink
[New] play command now checks in the database for the guild djrole an…
Browse files Browse the repository at this point in the history
…d behaves according to the result
  • Loading branch information
naseif committed Nov 2, 2021
1 parent ddda85d commit 9212208
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions commands/Music/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ module.exports = {
],
});

const checkdj = await client.db.get(`djRole_${message.guildId}`);
const userRoles = await message.member.roles.cache.map((role) => role.id);

if (checkdj && !userRoles.includes(checkdj)) {
return await message.channel.send({
embeds: [
embedMessage(
"#9dcc37",
`You are not allowed to use this command.\n This command is only available for users with the DJ Role: <@&${checkdj}>`
),
],
});
}
if (!message.member.voice.channelId)
return message.channel.send({
embeds: [
Expand Down

0 comments on commit 9212208

Please sign in to comment.