v3.0 #145

Merged
Vylpes merged 44 commits from develop into main 2022-04-24 14:46:37 +01:00
3 changed files with 18 additions and 11 deletions
Showing only changes of commit 90ef4317cc - Show all commits

View file

@ -20,12 +20,13 @@ FOLDERS_EVENTS=src/events
COMMANDS_DISABLED=
COMMANDS_DISABLED_MESSAGE=This command is disabled.
COMMANDS_MUTE_ROLE=Muted
COMMANDS_ROLE_ROLES=Notify,VotePings,ProjectUpdates
EMBED_COLOUR=0x3050ba
EMBED_COLOUR_ERROR=0xD52803
ROLES_MODERATOR=Moderator
ROLES_MUTED=Muted
CHANNELS_LOGS_MESSAGE=message-logs
CHANNELS_LOGS_MEMBER=member-logs

View file

@ -54,7 +54,7 @@ export default class Mute extends Command {
const publicEmbed = new PublicEmbed(context, "", `${targetUser} has been muted`);
publicEmbed.AddReason(reason);
const mutedRole = context.message.guild.roles.cache.find(role => role.name == process.env.COMMANDS_MUTE_ROLE);
const mutedRole = context.message.guild.roles.cache.find(role => role.name == process.env.ROLES_MUTED);
if (!mutedRole) {
const embed = new ErrorEmbed(context, ErrorMessages.RoleNotFound);

View file

@ -3,16 +3,22 @@ import * as dotenv from "dotenv";
dotenv.config();
// Ensure required data is in dotenv
if (!process.env.EMBED_COLOUR) throw "EMBED_COLOUR is required in .env";
if (!process.env.EMBED_COLOUR_ERROR) throw "EMBED_COLOUR_ERROR is required in .env";
const requiredConfigs = [
"EMBED_COLOUR",
"EMBED_COLOUR_ERROR",
"ROLES_MODERATOR",
"ROLES_MUTED",
"CHANNELS_LOGS_MESSAGE",
"CHANNELS_LOGS_MEMBER",
"CHANNELS_LOGS_MOD",
"COMMANDS_ROLE_ROLES"
];
if (!process.env.ROLES_MODERATOR) throw "ROLES_MODERATOR is required in .env";
if (!process.env.CHANNELS_LOGS_MESSAGE) throw "CHANNELS_LOGS_MESSAGE is required in .env";
if (!process.env.CHANNELS_LOGS_MEMBER) throw "CHANNELS_LOGS_MEMBER is required in .env";
if (!process.env.CHANNELS_LOGS_MOD) throw "CHANNELS_LOGS_MOD is required in .env";
if (!process.env.COMMANDS_MUTE_ROLE) throw "COMMANDS_MUTE_ROLE is required in .env";
requiredConfigs.forEach(config => {
if (!process.env[config]) {
throw `${config} is required in .env`;
}
});
const client = new CoreClient();
client.start();