aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/extensions/discord-akairo/BushClientUtil.ts10
-rw-r--r--src/lib/models/Guild.ts8
-rw-r--r--src/lib/utils/BushConstants.ts3
3 files changed, 16 insertions, 5 deletions
diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts
index 64616f0..498b9cb 100644
--- a/src/lib/extensions/discord-akairo/BushClientUtil.ts
+++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts
@@ -1095,7 +1095,7 @@ export class BushClientUtil extends ClientUtil {
if (force) return true;
// If the victim is not in the guild anymore it will be undefined
- if (!victim.guild && ['ban', 'unban'].includes(type)) return true;
+ if ((!victim || !victim.guild) && !['ban', 'unban'].includes(type)) return true;
if (moderator.guild.id !== victim.guild.id) {
throw new Error('moderator and victim not in same guild');
@@ -1519,6 +1519,14 @@ export class BushClientUtil extends ClientUtil {
}
/**
+ * Removes all characters in a string that are either control characters or change the direction of text etc.
+ */
+ public sanitizeWtlAndControl(str: string) {
+ // eslint-disable-next-line no-control-regex
+ return str.replace(/[\u0000-\u001F\u007F-\u009F\u200B]/g, '');
+ }
+
+ /**
* Discord.js's Util class
*/
get discord() {
diff --git a/src/lib/models/Guild.ts b/src/lib/models/Guild.ts
index 1897068..ab18d05 100644
--- a/src/lib/models/Guild.ts
+++ b/src/lib/models/Guild.ts
@@ -92,10 +92,10 @@ export const guildFeaturesObj = {
name: 'Auto Publish',
description: 'Publishes messages in configured announcement channels.'
},
- autoThread: {
- name: 'Auto Thread',
- description: 'Creates a new thread for messages in configured channels.'
- },
+ // autoThread: {
+ // name: 'Auto Thread',
+ // description: 'Creates a new thread for messages in configured channels.'
+ // },
blacklistedFile: {
name: 'Blacklisted File',
description: 'Automatically deletes malicious files.'
diff --git a/src/lib/utils/BushConstants.ts b/src/lib/utils/BushConstants.ts
index 68c0951..0e1388e 100644
--- a/src/lib/utils/BushConstants.ts
+++ b/src/lib/utils/BushConstants.ts
@@ -228,8 +228,11 @@ export class BushConstants {
REQUEST_TO_SPEAK: { name: 'Request to Speak', important: false },
MANAGE_THREADS: { name: 'Manage Threads', important: true },
USE_PUBLIC_THREADS: { name: 'Use public Threads', important: false },
+ CREATE_PUBLIC_THREADS: { name: 'Create Public Threads', important: false },
USE_PRIVATE_THREADS: { name: 'Use Private Threads', important: false },
+ CREATE_PRIVATE_THREADS: { name: 'Create Private Threads', important: false },
USE_EXTERNAL_STICKERS: { name: 'Use External Stickers', important: false },
+ SEND_MESSAGES_IN_THREADS: { name: 'Send Messages In Threads', important: false },
START_EMBEDDED_ACTIVITIES: { name: 'Start Activities', important: false }
},