Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions bot/commands/addEventRole.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const config = require('../../config.json');
const Discord = require('discord.js');

module.exports.execute = async (client, message, args) => {
let role = message.guild.roles.cache.get(config.bot.roles.event);

if (!message.member.roles.cache.has(config.bot.roles.event)) {
await message.member.roles.add(role);
await message.channel.send('> You have opted into event notifications!\n_To opt-out, run the `remove event role` command._');
} else {
await message.channel.send('You already have the event role.');
}
}

module.exports.config = {
name: 'get event role',
aliases: ['get event role', 'assign me the event role',],
description: 'Add the Event role to yourself!',
}
19 changes: 19 additions & 0 deletions bot/commands/removeEventRole.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const config = require('../../config.json');
const Discord = require('discord.js');

module.exports.execute = async (client, message, args) => {
let role = message.guild.roles.cache.get(config.bot.roles.event);

if (message.member.roles.cache.has(config.bot.roles.event)) {
await message.member.roles.remove(role);
await message.channel.send('> You have opted out of event notifications!\n_To opt-in, run the `get event role` command._');
} else {
await message.channel.send('You do not have the event role.')
}
}

module.exports.config = {
name: 'remove event role',
aliases: ['remove event role', 'remove the event role from me',],
description: 'Remove the Event role from yourself!',
}