Compare commits
4 commits
6b03ce8f7d
...
c6a7ea023c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6a7ea023c | ||
|
|
2e077cfe1a | ||
|
|
ee908585ae | ||
|
|
19b4583d2c |
2
LICENSE
2
LICENSE
|
|
@ -1,5 +1,5 @@
|
|||
The Giant Penis License (GPL)
|
||||
Copyright (c) 2020 Im_Verum
|
||||
Copyright (c) 2020 jan
|
||||
|
||||
▄▄██▄██▄▄
|
||||
▄█ █ █▄
|
||||
|
|
|
|||
|
|
@ -5,4 +5,4 @@ A small Discord bot with crappy code that I made for the r/Obamium Discord serve
|
|||
If you, for whatever reason, want to host this bot yourself, good luck getting it to work.
|
||||
|
||||
# Copyright
|
||||
This project is licensed under the [Giant Penis License](http://giant-penis-license.org/) which is basically a deformed MIT license.
|
||||
This project is licensed under the [Giant Penis License](https://files.janderedev.xyz/gpl.txt) which is basically a deformed MIT license.
|
||||
|
|
|
|||
|
|
@ -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.`);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ client.on('message', message => {
|
|||
else if (msgContent.startsWith(`<@!${client.user.id}>`)) usedPrefix = `<@!${client.user.id}>`;
|
||||
|
||||
if (!usedPrefix) return require('./69Reply').execute(message);
|
||||
msgContent = msgContent.split(usedPrefix)[1];
|
||||
msgContent = msgContent.substr(msgContent.indexOf(usedPrefix) + 1, msgContent.length);
|
||||
if (msgContent.startsWith(' ') && usedPrefix != prefix) msgContent = msgContent.substr(1, msgContent.length);
|
||||
const args = msgContent.split(' ');
|
||||
const cmdName = args.shift()?.toLowerCase();
|
||||
|
|
@ -31,7 +31,7 @@ client.on('message', message => {
|
|||
const cmd = commands.find(cmd => cmd.meta?.name == cmdName || cmd.meta?.aliases?.indexOf(cmdName) > -1);
|
||||
if (!cmd) return require('./69Reply').execute(message);
|
||||
|
||||
logger.info(`[CMD] ${message.author.id} ${message.author.tag} => ${cmdName}${args.length > 0 ? ',' : ''} ${args.join(' ')}`);
|
||||
logger.info(`[CMD] ${message.author.id} ${message.author.tag} => ${cmdName} ${args.join(' ')}`);
|
||||
|
||||
if (cmd.meta?.staffOnly && !message.member.permissions.has('ADMINISTRATOR')) {
|
||||
logger.warn(`${message.author.tag} => Refusing to run staff command`);
|
||||
|
|
|
|||
Loading…
Reference in a new issue