Merge branch 'dev'

merge-requests/9/merge
Matthew 2020-04-20 13:58:42 -04:00
commit beff369177
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
9 changed files with 43 additions and 70 deletions

View File

@ -26,10 +26,13 @@ export default class Command {
/**
* - **0:** Everyone
* - **1:** Associates Team+
* - **2:** Sheriff+
* - **3:** Faculty Marshals+
* - **4:** Marshal Generals of Engineering
* - **1:** Associates+
* - **2:** Core Team+
* - **3:** Moderators, Supervisor, Board of Directors
* - **4:** Technicians, Supervisor, Board of Directors
* - **5:** Moderators, Technicians, Supervisor, Board of Directors
* - **6:** Supervisor+
* - **7:** Board of Directors
*/
public permissions: number;
@ -57,13 +60,17 @@ export default class Command {
case 0:
return true;
case 1:
return member.roles.some((r) => ['662163685439045632', '455972169449734144', '453689940140883988'].includes(r));
return member.roles.some((r) => ['701481967149121627', '453689940140883988', '455972169449734144', '701454780828221450', '701454855952138300', '662163685439045632'].includes(r));
case 2:
return member.roles.some((r) => ['662163685439045632', '455972169449734144'].includes(r));
return member.roles.some((r) => ['453689940140883988', '455972169449734144', '701454780828221450', '701454855952138300', '662163685439045632'].includes(r));
case 3:
return member.roles.some((r) => ['662163685439045632'].includes(r));
return member.roles.some((r) => ['455972169449734144', '701454855952138300', '662163685439045632'].includes(r));
case 4:
return member.id === '278620217221971968' || member.id === '253600545972027394';
return member.roles.some((r) => ['701454780828221450', '701454855952138300', '662163685439045632'].includes(r));
case 5:
return member.roles.some((r) => ['701454855952138300', '662163685439045632'].includes(r));
case 6:
return member.roles.includes('662163685439045632');
default:
return false;
}

View File

@ -1,6 +1,6 @@
/* eslint-disable no-bitwise */
import { Member, User } from 'eris';
import { v4 as uuid } from 'uuid';
import { randomBytes } from 'crypto';
import moment, { unitOfTime } from 'moment';
import { Client, RichEmbed } from '.';
import { Moderation as ModerationModel, ModerationInterface } from '../models';
@ -43,7 +43,7 @@ export default class Moderation {
public async ban(user: User, moderator: Member, duration: number, reason?: string): Promise<ModerationInterface> {
if (reason && reason.length > 512) throw new Error('Ban reason cannot be longer than 512 characters');
await this.client.guilds.get(this.client.config.guildID).banMember(user.id, 7, reason);
const logID = uuid();
const logID = randomBytes(2).toString('hex');
const mod = new ModerationModel({
userID: user.id,
logID,
@ -85,7 +85,7 @@ export default class Moderation {
this.client.unbanGuildMember(this.client.config.guildID, userID, reason);
const user = await this.client.getRESTUser(userID);
if (!user) throw new Error('Cannot get user.');
const logID = uuid();
const logID = randomBytes(2).toString('hex');
const mod = new ModerationModel({
userID,
logID,

View File

@ -8,7 +8,7 @@ export default class Ban extends Command {
this.name = 'ban';
this.description = 'Bans a member from the guild.';
this.usage = 'ban <member> [time] [reason]';
this.permissions = 2;
this.permissions = 3;
this.guildOnly = true;
this.enabled = true;
}

View File

@ -9,7 +9,7 @@ export default class Eval extends Command {
this.name = 'eval';
this.description = 'Evaluates native JS code';
this.aliases = ['e'];
this.permissions = 4;
this.permissions = 7;
this.enabled = true;
this.guildOnly = false;
}

View File

@ -3,11 +3,11 @@ import { Activity, Member, Message } from 'eris';
import { Client, Command, RichEmbed } from '../class';
enum ActivityType {
PLAYING = 0,
STREAMING = 1,
LISTENING = 2,
WATCHING = 3,
CUSTOM_STATUS = 4
PLAYING,
STREAMING,
LISTENING,
WATCHING,
CUSTOM_STATUS
}
export default class Game extends Command {

View File

@ -7,7 +7,7 @@ export default class Unban extends Command {
this.name = 'unban';
this.description = 'Unbans a member from the guild.';
this.usage = 'unban <user id> [reason]';
this.permissions = 2;
this.permissions = 3;
this.guildOnly = true;
this.enabled = true;
}

View File

@ -42,8 +42,8 @@ export default class Whois extends Command {
const ackResolve = this.resolveStaffInformation(member.id);
let description = '';
if (ackResolve) {
if (ackResolve?.title && ackResolve?.dept) {
description += `${emotes.titleAndDepartment} __**${ackResolve.title}**__, ${ackResolve.dept}\n\n`;
if (ackResolve?.title) {
description += `${emotes.titleAndDepartment} __**${ackResolve.title}**__\n\n`;
}
if (ackResolve?.emailAddress) {
description += `${emotes.email} ${ackResolve.emailAddress}\n`;

View File

@ -2,8 +2,7 @@
{
"name": "Matthew",
"id": "278620217221971968",
"title": "Marshal General of Engineering",
"dept": "Faculty Marshals",
"title": "Board of Directors",
"emailAddress": "matthew@staff.libraryofcode.org",
"gitlab": "https://gitlab.libraryofcode.org/matthew",
"github": "https://github.com/matthew119427",
@ -13,8 +12,7 @@
{
"name": "Joe",
"id": "556969659531001858",
"title": "Marshal General of Community Relations",
"dept": "Faculty Marshals",
"title": "Board of Directors",
"emailAddress": "joe@staff.libraryofcode.org",
"gitlab": "https://gitlab.libraryofcode.org/Joe",
"github": "https://github.com/sirdroolio",
@ -24,8 +22,7 @@
{
"name": "Bsian",
"id": "253600545972027394",
"title": "Assistant Marshal General of Engineering",
"dept": "Faculty Marshals",
"title": "Board of Directors",
"emailAddress": "bsian@staff.libraryofcode.org",
"bio": "I also like trains",
"acknowledgements": ["Maintainer & Assistant Lead Developer"]
@ -33,23 +30,20 @@
{
"name": "NightRaven",
"id": "239261547959025665",
"title": "Assistant Marshal General of Community Relations",
"dept": "Faculty Marshals",
"title": "Board of Directors",
"emailAddress": "nightraven@staff.libraryofcode.org",
"bio": "I like trains"
},
{
"name": "Midori",
"id": "109122112643440640",
"title": "Assistant Marshal General of Community Relations",
"dept": "Faculty Marshals",
"title": "Board of Directors",
"emailAddress": "midori@staff.libraryofcode.org"
},
{
"name": "Unknown",
"id": "143414786913206272",
"title": "Staff Sergeant",
"dept": "Faculty Marshals",
"title": "Board of Directors",
"emailAddress": "unknown@staff.libraryofcode.org",
"gitlab": "https://gitlab.libraryofcode.org/unknown",
"bio": "im not a proffesional developer or anything, i just enjoy it as a hobby."
@ -57,53 +51,26 @@
{
"name": "TheSkele27",
"id": "213632190557192192",
"title": "Community Advisor",
"dept": "Faculty Marshals",
"title": "Board of Directors",
"emailAddress": "theskele27@staff.libraryofcode.org",
"gitlab": "https://gitlab.libraryofcode.org/TheSkele27",
"github": "https://github.com/TheSkele27",
"bio": "Is water wet?"
},
{
"name": "Aikaterna",
"id": "154497072148643840",
"title": "Sheriff",
"dept": "Staff Team"
},
{
"name": "Boss",
"id": "344954369285947392",
"title": "Sheriff",
"dept": "Staff Team",
"emailAddress": "boss@staff.libraryofcode.org",
"gitlab": "https://gitlab.libraryofcode.org/Boss",
"bio": "I cant find a bio for user \"boss\""
},
{
"name": "Besero",
"id": "283318906024886272",
"title": "Associate",
"dept": "Staff Team",
"emailAddress": "besero@staff.libraryofcode.org",
"gitlab": "https://gitlab.libraryofcode.org/besero_gg",
"github": "https://github.com/kledi-harding",
"bio": "Just looking for some fun. I like going on long walks in the park. No guys",
"acknowledgements": ["Graphic Designer"]
},
{
"name": "CoalSephos",
"id": "155698776512790528",
"title": "Associate",
"dept": "Staff Team",
"gitlab": "https://gitlab.libraryofcode.org/CoalSephos",
"github": "https://github.com/CoalSephos",
"bio": "[Tastes like chicken?]"
},
{
"name": "D3XTER",
"id": "468009964263178262",
"title": "Associate",
"dept": "Staff Team",
"title": "Core Team",
"emailAddress": "dexter@staff.libraryofcode.org",
"gitlab": "https://gitlab.libraryofcode.org/D3XTER",
"bio": "Hi I'm D3XTER how are ya?"
@ -111,8 +78,7 @@
{
"name": "DedShotTM",
"id": "402154763363418142",
"title": "Associate",
"dept": "Staff Team",
"title": "Technician & Moderator",
"emailAddress": "dedshot@staff.libraryofcode.org",
"gitlab": "https://gitlab.libraryofcode.org/DedShotTM",
"github": "https://github.com/DedShotTM",
@ -122,8 +88,7 @@
{
"name": "EdgyBoi2414",
"id": "397432516010835970",
"title": "Webmaster",
"dept": "Staff Team",
"title": "Core Team",
"emailAddress": "edgyboi2414@gmail.com",
"gitlab": "https://gitlab.libraryofcode.org/EdgyBoi2414",
"github": "https://github.com/EdgyBoi2414",
@ -132,8 +97,7 @@
{
"name": "Hector",
"id": "377781496292835339",
"title": "Associate",
"dept": "Staff Team",
"title": "Core Team",
"emailAddress": "hector@staff.libraryofcode.org",
"gitlab": "https://gitlab.libraryofcode.org/Hector",
"github": "https://github.com/Hector6704",
@ -142,8 +106,7 @@
{
"name": "KhaaZ",
"id": "179908288337412096",
"title": "Associate",
"dept": "Staff Team",
"title": "Core Team",
"gitlab": "https://gitlab.libraryofcode.org/KhaaZ",
"github": "https://github.com/Khaazz",
"bio": "I baguette for a living and eat code for breakfast."

View File

@ -1,3 +1,6 @@
/* DM Ramirez with the code below to claim 500 free Rubies!
d2c3d8e14b
*/
import { parse } from 'yaml';
import { promises as fs } from 'fs';
import { Client } from './class';