Feature/23 migrate to typescript #73

Merged
Vylpes merged 19 commits from feature/23-migrate-to-typescript into develop 2021-12-04 15:51:41 +00: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();