diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-03 18:16:11 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-03 18:16:11 -0400 |
commit | 3b1311951638bc54efbbb245632e2b3ab460f741 (patch) | |
tree | 07fc42ba19a0ec4a2b3168faf96d284f726fb3da /src/lib | |
parent | 4b4d05d9708bdaef2c93df1a83c4ce7ca4350f7a (diff) | |
download | tanzanite-3b1311951638bc54efbbb245632e2b3ab460f741.tar.gz tanzanite-3b1311951638bc54efbbb245632e2b3ab460f741.tar.bz2 tanzanite-3b1311951638bc54efbbb245632e2b3ab460f741.zip |
new links, bug fixes, excape rtl charecters in welcome messages
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/extensions/discord-akairo/BushClientUtil.ts | 10 | ||||
-rw-r--r-- | src/lib/models/Guild.ts | 8 | ||||
-rw-r--r-- | src/lib/utils/BushConstants.ts | 3 |
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 } }, |