Development (#77)

- moved extended tsconfig into our tsconfig to remove errors
- updated some mod checks to allow for running of commands (warn, about)
if mod only has manageMessages

Review this ASAP
pull/89/head
Samuel Shuert 3 years ago committed by GitHub
commit aacedbe77c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5,7 +5,6 @@
"@tensorflow/tfjs": "^3.18.0",
"@tensorflow/tfjs-node": "^3.18.0",
"@total-typescript/ts-reset": "^0.3.7",
"@tsconfig/node18-strictest-esm": "^1.0.0",
"@types/gm": "^1.25.0",
"@types/node": "^18.14.6",
"@ungap/structured-clone": "^1.0.1",
@ -82,7 +81,7 @@
"prettier": "^2.7.1",
"prettier-eslint": "^15.0.1",
"tsc-suppress": "^1.0.7",
"typescript": "^4.9.4",
"typescript": "^5.0.0",
"yarn-audit-fix": "^9.3.9"
}
}

@ -444,7 +444,7 @@ const callback = async (interaction: CommandInteraction): Promise<unknown> => {
const check = (interaction: CommandInteraction) => {
const member = interaction.member as GuildMember;
if (!member.permissions.has("ModerateMembers")) return "You do not have the *Moderate Members* permission";
if (!member.permissions.has("ManageMessages")) return "You do not have the *Manage Messages* permission";
return true;
};

@ -300,7 +300,7 @@ const callback = async (
const check = (interaction: CommandInteraction | ButtonInteraction, partial: boolean = false, target?: GuildMember) => {
if (!interaction.guild) return;
const member = interaction.member as GuildMember;
if (!member.permissions.has("ModerateMembers")) return "You do not have the *Moderate Members* permission";
if (!member.permissions.has("ManageMessages")) return "You do not have the *Manage Messages* permission";
if (partial) return true;
let apply: GuildMember;
if (interaction.isButton()) {

@ -1092,29 +1092,29 @@ const callback = async (interaction: CommandInteraction): Promise<void> => {
} else {
switch (i.values[0]) {
case "invites": {
config.invite = await inviteMenu(i, m, _.isEqual(config, current), config.invite);
current.invite = await inviteMenu(i, m, _.isEqual(config, current), current.invite);
break;
}
case "mentions": {
config.pings = await mentionMenu(i, m, _.isEqual(config, current), config.pings);
current.pings = await mentionMenu(i, m, _.isEqual(config, current), current.pings);
break;
}
case "words": {
config.wordFilter = await wordMenu(i, m, _.isEqual(config, current), config.wordFilter);
current.wordFilter = await wordMenu(i, m, _.isEqual(config, current), current.wordFilter);
break;
}
case "malware": {
config.malware = !config.malware;
current.malware = !current.malware;
break;
}
case "images": {
const next = await imageMenu(i, m, _.isEqual(config, current), config.images);
config.images = next;
const next = await imageMenu(i, m, _.isEqual(config, current), current.images);
current.images = next;
break;
}
case "clean": {
const next = await cleanMenu(i, m, _.isEqual(config, current), config.clean);
config.clean = next;
current.clean = next;
break;
}
}

@ -219,7 +219,7 @@ export async function doMemberChecks(member: Discord.GuildMember): Promise<void>
// Does the username contain filtered words
// Does the nickname contain filtered words
let nameCheck;
if(member.nickname) {
if (member.nickname) {
nameCheck = TestString(member.nickname ?? "", loose, strict, guildData.filters.wordFilter.enabled);
} else {
nameCheck = TestString(member.user.username, loose, strict, guildData.filters.wordFilter.enabled);
@ -239,13 +239,7 @@ export async function doMemberChecks(member: Discord.GuildMember): Promise<void>
// Does the nickname contain an invite
const nicknameInviteCheck =
guildData.filters.invite.enabled && /discord\.gg\/[a-zA-Z0-9]+/gi.test(member.nickname ?? "");
if (
nameCheck !== null ||
avatarCheck ||
inviteCheck ||
nicknameInviteCheck ||
avatarTextCheck !== null
) {
if (nameCheck !== null || avatarCheck || inviteCheck || nicknameInviteCheck || avatarTextCheck !== null) {
const infractions = [];
if (nameCheck !== null) {
infractions.push(`Name contains a ${nameCheck.type}ly filtered word (${nameCheck.word})`);

@ -1,6 +1,19 @@
{
"extends": "@tsconfig/node18-strictest-esm/tsconfig.json",
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Node 18 + ESM + Strictest",
"compilerOptions": {
"lib": ["es2022"],
"strict": true,
"exactOptionalPropertyTypes": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"forceConsistentCasingInFileNames": true,
"allowUnusedLabels": false,
"allowUnreachableCode": false,
"module": "NodeNext",
"target": "es2020",
"sourceMap": true,
@ -11,7 +24,8 @@
"resolveJsonModule": true,
"moduleResolution": "NodeNext",
"skipLibCheck": true,
"noImplicitReturns": false
"noImplicitReturns": false,
"checkJs": true
},
"include": ["src/**/*", "src/*", "src/config/main.d.ts", "src/config/main.ts"],
"exclude": ["src/Unfinished/**/*", "src/reflex/nsfwjs/**/*"]

Loading…
Cancel
Save