Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature nameCleansing #201

Merged
merged 5 commits into from
Jun 17, 2023
Merged

Add feature nameCleansing #201

merged 5 commits into from
Jun 17, 2023

Conversation

LagSeeN
Copy link
Collaborator

@LagSeeN LagSeeN commented Jun 17, 2023

Description

Add bot support cleansing name when user edit nickname
example
Zalgo: Test -> Test
Hoisted: ! Name -> Name
Exclamation Mark: ! -> Name
Bad Name: examplebadname -> Name

Type of change

  • New feature (non-breaking change which adds functionality)

Screenshot

Checklist:

  • I have run pnpm format and my code don't have any linting issues
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

@LagSeeN
Copy link
Collaborator Author

LagSeeN commented Jun 17, 2023

Issue

@github-actions
Copy link

github-actions bot commented Jun 17, 2023

Coverage Summary

Status Category Percentage Covered / Total
🔵 Lines 47.39% 1520 / 3207
🔵 Statements 47.39% 1520 / 3207
🔵 Functions 39.8% 41 / 103
🔵 Branches 87.12% 115 / 132
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
src/Bot.ts 26.9% 100% 10% 26.9% 37-42, 45-49, 52-53, 56-58, 61-74, 77-98, 101-136, 139-166, 169-196
src/config.ts 100% 100% 100% 100%
src/prisma.ts 66.66% 0% 0% 66.66% 7, 12-15
src/__mocks__/config.ts 100% 100% 100% 100%
src/features/index.ts 100% 100% 100% 100%
src/features/memberUpdateLogger/index.ts 10.52% 100% 0% 10.52% 8-75
src/features/messagePruner/index.ts 80% 100% 0% 80% 8-9
src/features/messagePruner/pruneMessagesCommand.ts 16.55% 100% 0% 16.55% 24-144
src/features/messageReporter/index.ts 80% 100% 0% 80% 8-9
src/features/messageReporter/reportToModeratorMessageCommand.ts 14.86% 100% 0% 14.86% 22-147
src/features/nameChecker/checkName.ts 20.4% 100% 0% 20.4% 11-49
src/features/nameChecker/checkNameAgainstPatterns.ts 86.48% 88.88% 100% 86.48% 30-34
src/features/nameChecker/index.ts 31.25% 100% 0% 31.25% 10-31
src/features/nameCleansing/checkName.ts 84.44% 57.14% 100% 84.44% 26-30, 32-33
src/features/nameCleansing/index.ts 31.25% 100% 0% 31.25% 10-31
src/features/nameCleansing/nameCleansing.ts 20.25% 100% 0% 20.25% 17-79
src/features/nominations/index.ts 80% 100% 0% 80% 8-9
src/features/nominations/nominateCommand.ts 19.71% 100% 0% 19.71% 41-148, 151-213
src/features/ping/index.ts 80% 100% 0% 80% 8-9
src/features/ping/pingCommand.ts 62.5% 100% 0% 62.5% 10-15
src/features/preventEmojiSpam/index.ts 31.42% 100% 0% 31.42% 11-34
src/features/preventEmojiSpam/isEmojiPreventionEnabled.ts 100% 100% 100% 100%
src/features/profileInspector/index.ts 31.69% 100% 0% 31.69% 28-31, 43-50, 62-77, 96-104, 118-123, 125-186, 188-228, 230-253, 256, 259, 261-271, 274-289, 297-306
src/features/runtimeConfig/index.ts 75% 100% 0% 75% 9-11
src/features/runtimeConfig/inspectConfigCommand.ts 66.66% 100% 0% 66.66% 12-17
src/features/runtimeConfig/reloadConfigCommand.ts 65% 100% 0% 65% 13-19
src/features/slowmode/index.ts 80% 100% 0% 80% 8-9
src/features/slowmode/slowmodeCommand.ts 58.18% 100% 0% 58.18% 32-54
src/features/stickyMessage/channelLock.ts 100% 100% 100% 100%
src/features/stickyMessage/index.ts 40.62% 100% 0% 40.62% 13-31
src/features/stickyMessage/messageCooldown.ts 97.33% 100% 75% 97.33% 41-42
src/features/stickyMessage/messageCounter.ts 100% 80% 100% 100%
src/features/stickyMessage/stickyMessageHandler.ts 100% 100% 100% 100%
src/features/stickyMessage/stickyMessageRemove.ts 100% 100% 100% 100%
src/features/stickyMessage/stickyMessageSet.ts 83.8% 81.25% 100% 83.8% 28-33, 50-55, 63-67
src/features/stickyMessage/stickyMessages.ts 99% 80% 100% 99% 79
src/features/tempRole/expireCheck.ts 11.59% 100% 0% 11.59% 9-69
src/features/tempRole/index.ts 52.38% 100% 0% 52.38% 11-20
src/features/tempRole/temporaryRoleCommand.ts 33.64% 100% 0% 33.64% 71-87, 90-153, 155-217
src/features/threadPruner/activeThreadsCommand.ts 20.37% 100% 0% 20.37% 31-88, 91-126, 128-162
src/features/threadPruner/getActiveThreads.ts 36.84% 100% 0% 36.84% 8-19
src/features/threadPruner/getThreadStats.ts 18.6% 100% 0% 18.6% 9-43
src/features/threadPruner/index.ts 80% 100% 0% 80% 8-9
src/features/userInfo/index.ts 80% 100% 0% 80% 8-9
src/features/userInfo/userInfoCommand.ts 33.33% 100% 0% 33.33% 12-35
src/types/UserModerationLogEntry.ts 100% 100% 100% 100%
src/types/defineCommand.ts 100% 100% 100% 100%
src/types/definePlugin.ts 100% 100% 100% 100%
src/utils/ActionSet.ts 19.58% 0% 0% 19.58% 15-92
src/utils/RuntimeConfiguration.ts 74.13% 60% 100% 74.13% 33-37, 41-48, 53-54
src/utils/RuntimeConfigurationSchema.ts 100% 100% 100% 100%
src/utils/cache.ts 100% 100% 100% 100%
src/utils/createLogger.ts 33.33% 100% 0% 33.33% 4-9
src/utils/fake.ts 83.33% 66.66% 100% 83.33% 22-26
src/utils/generateTsv.ts 100% 100% 100% 100%
src/utils/isOnlyEmoji.ts 100% 100% 100% 100%
src/utils/prompt.ts 25.45% 100% 0% 25.45% 15-55
src/utils/sendDm.ts 100% 100% 100% 100%
src/utils/toLocalDate.ts 100% 100% 100% 100%
src/utils/typeGuards.ts 70% 100% 0% 70% 8-10

src/features/nameCleansing/nameCleansing.ts Outdated Show resolved Hide resolved
src/features/nameCleansing/nameCleansing.ts Outdated Show resolved Hide resolved
@LagSeeN LagSeeN requested a review from dtinth June 17, 2023 13:01
Copy link
Collaborator

@dtinth dtinth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from inefficiencies and code repetition pointed out by @leomotors, otherwise looks good now. I’ll go ahead and merge this in krub and will improve upon it as suggested.

@dtinth dtinth added this pull request to the merge queue Jun 17, 2023
Merged via the queue into main with commit 123e6bc Jun 17, 2023
@dtinth dtinth deleted the feature/nameCleansing branch June 17, 2023 15:23
@LagSeeN LagSeeN mentioned this pull request Jun 17, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants