forked from Lea/obama-bot
renamed variables
This commit is contained in:
parent
2e077cfe1a
commit
c6a7ea023c
|
@ -6,24 +6,24 @@ module.exports.meta = {
|
|||
staffOnly: true
|
||||
}
|
||||
|
||||
const roleid = '718862546395988078';
|
||||
const cid = '718908301555007518';
|
||||
const roleID = '718862546395988078';
|
||||
const channelID = '718908301555007518';
|
||||
|
||||
module.exports.run = async (message, args) => {
|
||||
let target = message.mentions.members.first();
|
||||
let role = message.guild.roles.cache.get(roleid);
|
||||
let channel = message.guild.channels.cache.get(cid);
|
||||
let role = message.guild.roles.cache.get(roleID);
|
||||
let channel = message.guild.channels.cache.get(channelID);
|
||||
if (!role) return message.channel.send('Error: Could not find role');
|
||||
if (!channel) return message.channel.send('Error: Could not find channel');
|
||||
if (!target) return message.channel.send('You need to @mention someone for this to work!');
|
||||
if (target.user.bot) return message.channel.send('You can\'t do this with bots.');
|
||||
if (!target.roles.cache.has(roleid)) {
|
||||
if (!target.roles.cache.has(roleID)) {
|
||||
// Give the role
|
||||
target.roles.add(role);
|
||||
channel.send(`${target.user} is now able to access this channel.`);
|
||||
let msg = new Discord.MessageEmbed()
|
||||
.setTitle('Congratulations!')
|
||||
.setDescription(`The r/Obamium Discord Staff has decided to give you access to a secret text channel: <#${cid}>`)
|
||||
.setDescription(`The r/Obamium Discord Staff has decided to give you access to a secret text channel: <#${channelID}>`)
|
||||
.setThumbnail('https://discordemoji.com/assets/emoji/ClapClap.gif');
|
||||
target.send(msg);
|
||||
message.channel.send(`${target.user.username} is now a true obama fan.`);
|
||||
|
|
Loading…
Reference in a new issue