Skip to content

Conversation

@ajax146
Copy link
Contributor

@ajax146 ajax146 commented Jul 22, 2024

This is a complete rewrite and restructure of protect and everything related to it.

protect.py was split into:
commands/moderator.py
commands/purge.py
core/moderation.py
functions/automod.py
functions/paste.py

Two additional files were added:
commands/modlog.py
commands/report.py

who.py was split into:
commands/notes.py
commands/whois.py

commands/moderator.py:
Moved all moderator actions into slash commands
Adds a new /unwarn command allowing individual warnings to be removed
Logs and displays who warned people (Fixes #657)
Mute can now have both a duration and a reason (fixes #721)

commands/modlog.py
Completely new feature, copying carlbots /modlog highscores and ban/unban logging
This additionally adds the ability to lookup bans by user or moderator
Bans are now forever stored in TS database (Fixes #380)

commands/notes.py
All the notes editing commands, as well as a /notes all
Write roles checks now check reader roles as well (fixes #692)
Makes notes all paginated (fixes #800)
Notes reader/writer now only send one message if config is empty (fixes #983)

commands/purge.py
Moves purge command to /purge
Combines the duration and exact command

commands/whois.py
Is the /whois command

core/moderation.py
This handles the core actions of ban/unban/kick/mute/unmute/warn/unwarn and a few core logic items, like getting all warnings

functions/automod.py
Completely rewrites automod (Fixes #463)
Fixes regex not working (no issue for this one)
Adds a mute feature for automod (Fixes #1020)
Adds automod as a framework instead of a strict class, allowing other modules to run messages through automod
Adds IRC checks to automod (Fixes #212)

functions/paste.py
Paste now makes sure that the linx API request worked and that the message was sent BEFORE deleting the original message (Fixes #1077)
Paste checks if message violates automod, and if it was recommended that it was deleted, nothing happens

Other:
Who now shows new warning information (Fixes #180)
Moves duck to use the new core/moderation.py feature

@ajax146 ajax146 added the PR: Want for next release This PR should be merged prior to the next release label May 2, 2025
@dkay0670 dkay0670 self-requested a review May 2, 2025 18:35
@TheKrol
Copy link
Contributor

TheKrol commented May 3, 2025

It appears your int for delete days broke
image

P.S. My mistake, taken care of.

@TheKrol
Copy link
Contributor

TheKrol commented May 3, 2025

If you want to change this here, make unwarn show how many warnings they still have?

@dkay0670 dkay0670 requested a review from Copilot May 4, 2025 01:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors and reorganizes moderation features, automod functionality, and note management while adding new commands for reports and modlog. Key changes include moving code into separate modules (e.g. core/moderation.py, commands/modlog.py, commands/report.py), rewriting automod and paste functionality, and updating command configurations.

Reviewed Changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
techsupport_bot/ui/pagination.py Updated the send() method to support an ephemeral parameter.
techsupport_bot/functions/paste.py Introduced improved paste logic with automod checks and attachment handling.
techsupport_bot/core/moderation.py Implemented core moderation actions (ban, unban, kick, mute, warn, unwarn) with updated type hints.
techsupport_bot/core/databases.py Added a new BanLog model for storing ban records.
techsupport_bot/commands/whois.py Integrated the new whois functionality that displays detailed user information.
techsupport_bot/commands/report.py Added a new report command to allow users to report issues; includes deduplication logic for mentioned users.
techsupport_bot/commands/relay.py Enhanced IRC relaying with an automod check before sending messages to IRC.
techsupport_bot/commands/purge.py Moved purge functionality to a slash command with duration-based purging.
techsupport_bot/commands/notes.py Introduced note commands for setting, clearing, and displaying user notes.
techsupport_bot/commands/modlog.py Added modlog commands for highscores and lookup functions; includes ban/unban logging functionalities.
techsupport_bot/commands/duck.py Updated duck command to use the new moderation.mute_user function.
techsupport_bot/commands/application.py Fixed default role configuration and skipped empty role IDs in permission checks.
techsupport_bot/commands/init.py Organized command module imports after splitting functionality into separate files.
techsupport_bot/bot.py Updated bot configuration to incorporate moderation settings.
Files not reviewed (1)
  • .flake8: Language not supported

user = None
if user:
mentioned_users.append(user)
mentioned_users: list[discord.Member] = set(mentioned_users)
Copy link

Copilot AI May 4, 2025

Choose a reason for hiding this comment

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

Using set() here converts the list into a set, which does not match the declared type of list[discord.Member] and loses ordering. Consider converting the set back to a list (e.g., mentioned_users = list(set(mentioned_users))) to maintain type consistency and order if needed.

Suggested change
mentioned_users: list[discord.Member] = set(mentioned_users)
mentioned_users = list(set(mentioned_users))

Copilot uses AI. Check for mistakes.
f"{moderator.mention} ({moderator.id}) - ({count})\n"
)
else:
final_string += {f"{index+1}. Moderator left: {moderator_id}"}
Copy link

Copilot AI May 4, 2025

Choose a reason for hiding this comment

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

The use of curly braces creates a set literal instead of concatenating a string. Replace the braces with a string format to correctly append the message (e.g., final_string += f"{index+1}. Moderator left: {moderator_id}").

Suggested change
final_string += {f"{index+1}. Moderator left: {moderator_id}"}
final_string += f"{index+1}. Moderator left: {moderator_id}\n"

Copilot uses AI. Check for mistakes.
@dkay0670
Copy link
Contributor

dkay0670 commented May 4, 2025

Fixes #800

@TheKrol TheKrol linked an issue May 4, 2025 that may be closed by this pull request
@ajax146 ajax146 added the run-ci label May 5, 2025
@ajax146 ajax146 merged commit cd7ba4a into main May 5, 2025
9 checks passed
@ajax146 ajax146 deleted the ProtectTheSecond branch May 5, 2025 17:59
@ajax146 ajax146 removed the PR: Want for next release This PR should be merged prior to the next release label May 20, 2025
ajax146 added a commit that referenced this pull request Oct 16, 2025
* Fix typo in interaction check (#1221)

* Update discord.py to version 2.5 (#1222)

* Update discord.py to version 2.5

* Update version

* Bump hypothesis from 6.122.4 to 6.131.7 (#1265)

Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.122.4 to 6.131.7.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](HypothesisWorks/hypothesis@hypothesis-python-6.122.4...hypothesis-python-6.131.7)

---
updated-dependencies:
- dependency-name: hypothesis
  dependency-version: 6.131.7
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pytest-asyncio from 0.25.0 to 0.26.0 (#1250)

Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.25.0 to 0.26.0.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Commits](pytest-dev/pytest-asyncio@v0.25.0...v0.26.0)

---
updated-dependencies:
- dependency-name: pytest-asyncio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Truly kill factoid all prefix command (#1224)

* Bump pytest from 8.3.2 to 8.3.5 (#1235)

Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.2 to 8.3.5.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@8.3.2...8.3.5)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump flake8-bugbear from 24.8.19 to 24.12.12 (#1269)

Bumps [flake8-bugbear](https://github.com/PyCQA/flake8-bugbear) from 24.8.19 to 24.12.12.
- [Release notes](https://github.com/PyCQA/flake8-bugbear/releases)
- [Commits](PyCQA/flake8-bugbear@24.8.19...24.12.12)

---
updated-dependencies:
- dependency-name: flake8-bugbear
  dependency-version: 24.12.12
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Replaces the PC joke config with a better filter (#1266)

This replaces the old pc_jokes filter and replaces it with a blacklisted_filters config, which allows a set of filters to apply in non NSFW channels, no matter what.

Additionally apply_in_nsfw_channels is added, to allow the filter to apply in all channels.

* Improves the output format of factoid search, and speeds it up a little (#1200)

* Makes role self more dynamic. (#1199)

* Bump pylint from 3.2.6 to 3.3.6 (#1247)

* Bump pylint from 3.2.6 to 3.3.6

Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.2.6 to 3.3.6.
- [Release notes](https://github.com/pylint-dev/pylint/releases)
- [Commits](pylint-dev/pylint@v3.2.6...v3.3.6)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* ignore R0917

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ajax146 <31014239+ajax146@users.noreply.github.com>

* Make duck random better (#1189)

* Make duck random better

* Update docstring

* Remove useless test line

* Rename factoid json file (#1270)

* Updating hangman to fix all the issues (#1207)

* Updating hangman to fix all the issues

* Formatting update

* Formatting and fixing the issue for help

* doc string update

* Trailing white space removed

* Doc string update

* Format and small update

* Flake update

* Flake update

* Fix game start error

* Flake update

* More Flake

* More Flake

* Fixed naming

* Flake update

* Fix issues and added a check for word length

* Update length for starting word

* Bump gitpython from 3.1.43 to 3.1.44 (#1226)

Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.43 to 3.1.44.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](gitpython-developers/GitPython@3.1.43...3.1.44)

---
updated-dependencies:
- dependency-name: gitpython
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ajax146 <31014239+ajax146@users.noreply.github.com>

* Bump pip from 24.3.1 to 25.0.1 (#1271)

Bumps [pip](https://github.com/pypa/pip) from 24.3.1 to 25.0.1.
- [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst)
- [Commits](pypa/pip@24.3.1...25.0.1)

---
updated-dependencies:
- dependency-name: pip
  dependency-version: 25.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump isort from 5.13.2 to 6.0.1 (#1272)

Bumps [isort](https://github.com/PyCQA/isort) from 5.13.2 to 6.0.1.
- [Release notes](https://github.com/PyCQA/isort/releases)
- [Changelog](https://github.com/PyCQA/isort/blob/main/CHANGELOG.md)
- [Commits](PyCQA/isort@5.13.2...6.0.1)

---
updated-dependencies:
- dependency-name: isort
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pydantic from 2.8.2 to 2.9.2 (#1149)

Bumps [pydantic](https://github.com/pydantic/pydantic) from 2.8.2 to 2.9.2.
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](pydantic/pydantic@v2.8.2...v2.9.2)

---
updated-dependencies:
- dependency-name: pydantic
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump emoji from 2.12.1 to 2.14.1 (#1274)

Bumps [emoji](https://github.com/carpedm20/emoji) from 2.12.1 to 2.14.1.
- [Release notes](https://github.com/carpedm20/emoji/releases)
- [Changelog](https://github.com/carpedm20/emoji/blob/master/CHANGES.md)
- [Commits](carpedm20/emoji@v2.12.1...v2.14.1)

---
updated-dependencies:
- dependency-name: emoji
  dependency-version: 2.14.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pipenv from 2024.4.1 to 2025.0.1 (#1273)

Bumps [pipenv](https://github.com/pypa/pipenv) from 2024.4.1 to 2025.0.1.
- [Release notes](https://github.com/pypa/pipenv/releases)
- [Changelog](https://github.com/pypa/pipenv/blob/main/CHANGELOG.md)
- [Commits](pypa/pipenv@v2024.4.1...v2025.0.1)

---
updated-dependencies:
- dependency-name: pipenv
  dependency-version: 2025.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pydoclint from 0.5.6 to 0.6.6 (#1262)

* Bump pydoclint from 0.5.6 to 0.6.6

Bumps [pydoclint](https://github.com/jsh9/pydoclint) from 0.5.6 to 0.6.6.
- [Release notes](https://github.com/jsh9/pydoclint/releases)
- [Changelog](https://github.com/jsh9/pydoclint/blob/main/CHANGELOG.md)
- [Commits](jsh9/pydoclint@0.5.6...0.6.6)

---
updated-dependencies:
- dependency-name: pydoclint
  dependency-version: 0.6.6
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update http error

* Exclude DOC503

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ajax146 <31014239+ajax146@users.noreply.github.com>

* Bump flake8 from 7.1.1 to 7.2.0 (#1275)

Bumps [flake8](https://github.com/pycqa/flake8) from 7.1.1 to 7.2.0.
- [Commits](PyCQA/flake8@7.1.1...7.2.0)

---
updated-dependencies:
- dependency-name: flake8
  dependency-version: 7.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump unidecode from 1.3.8 to 1.4.0 (#1276)

Bumps [unidecode](https://github.com/kmike/text-unidecode) from 1.3.8 to 1.4.0.
- [Release notes](https://github.com/kmike/text-unidecode/releases)
- [Commits](https://github.com/kmike/text-unidecode/commits)

---
updated-dependencies:
- dependency-name: unidecode
  dependency-version: 1.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump hypothesis from 6.131.8 to 6.131.9 (#1278)

Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.131.8 to 6.131.9.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](HypothesisWorks/hypothesis@hypothesis-python-6.131.8...hypothesis-python-6.131.9)

---
updated-dependencies:
- dependency-name: hypothesis
  dependency-version: 6.131.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pip from 25.0.1 to 25.1 (#1280)

Bumps [pip](https://github.com/pypa/pip) from 25.0.1 to 25.1.
- [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst)
- [Commits](pypa/pip@25.0.1...25.1)

---
updated-dependencies:
- dependency-name: pip
  dependency-version: '25.1'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Duck timeout on miss is now a config (#1141)

* Ducks don't timeout anymore

* unused import

* Make duck timeout a config option

---------

Co-authored-by: ajax146 <31014239+ajax146@users.noreply.github.com>

* Updates the IRC authentication method to no longer need ib3 (#1282)

This changes the IRC authentication to be done using the IRC package instead of the ib3 packages.

* Updates the IRC authentication method to no longer need ib3 (#1282)

* Start the refactor IRC branch

* Update IRC authentication system

* Formatting

* Formatting

* Bump inflect from 7.3.1 to 7.5.0 (#1279)

Bumps [inflect](https://github.com/jaraco/inflect) from 7.3.1 to 7.5.0.
- [Release notes](https://github.com/jaraco/inflect/releases)
- [Changelog](https://github.com/jaraco/inflect/blob/main/NEWS.rst)
- [Commits](jaraco/inflect@v7.3.1...v7.5.0)

---
updated-dependencies:
- dependency-name: inflect
  dependency-version: 7.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* make config.yml path configurable in .env file (#1294)

* Removes useless print statement in HTD (#1291)

* Make the DEBUG .env option default at 0 (#1301)

* Make the burn command work on message reply (#1298)

the `.burn` command now behaves like the `.hug` command, meaning it doesnt require mentioning a user to mark their message as a burn. replying to the message works. it still retains it's original behavior of marking the last message of a user as a burn when it is used as `.burn @user`.

* Fix typo in logging warning in logger (#1292)

This fixes a typo where WARN was used instead of WARNING. This was preventing messages from being logged where attachments that exceeded the size that the bot could upload were posted.

* Add /factoid call command (#1290)

* Add /factoid call command

* Fix docstring

* Add modmail bans command to list modmail bans (#1286)

Adds a new .modmail bans command to list all currently banned users by modmail.

* Bump aiocron from 1.8 to 2.1 (#1268)

Bumps [aiocron](https://github.com/gawel/aiocron) from 1.8 to 2.1.
- [Changelog](https://github.com/gawel/aiocron/blob/master/CHANGES.rst)
- [Commits](gawel/aiocron@1.8...2.1)

---
updated-dependencies:
- dependency-name: aiocron
  dependency-version: '2.1'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Add override owner config and try catch to log DM (#1220)

* Add override owner config and try catch to log DM

* Formatting

* Formatting 2

* Update config.default.yml

* Bump dateparser from 1.2.0 to 1.2.1 (#1267)

Bumps [dateparser](https://github.com/scrapinghub/dateparser) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/scrapinghub/dateparser/releases)
- [Changelog](https://github.com/scrapinghub/dateparser/blob/master/HISTORY.rst)
- [Commits](scrapinghub/dateparser@v1.2.0...v1.2.1)

---
updated-dependencies:
- dependency-name: dateparser
  dependency-version: 1.2.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* concatenation of all prior CI and addition of dependabot close steps … (#1075)

* concatenation of all prior CI and addition of dependabot close steps for semver patches on specific packages

* correct invalid yaml

* correct s

* add removed word

* Add black, fix flake8 ci

* rename black test

---------

Co-authored-by: dkay <dkay@nortnet.org>
Co-authored-by: ajax146 <31014239+ajax146@users.noreply.github.com>

* Make startup time dynamic timestamp (#1305)

* Make startup time dynamic timestamp

* Formatting

* Fix modmail alias command when no aliases defined (#1287)

* Fix modmail alias command when no aliases defined

* Make modmail no alias use prepare_deny_embed

* Add more friendly error when corrected message is too long (#886)

* Add more friendly error when corrected message is too long

* Add maximum line count

* Remove unit tests

* Update correct.py

* Auto reject applications after 30 days (#1281)

* Auto reject applications after 30 days

* Add max_age config value

* Make CI only run on PRs with the run-ci label (#1306)

* Workflow dispatch on CI

* More changes

* Test

* Add file

* Try more AI code

* Update CodeQL

* Update if statement

* Fix codeql

* Fix PR types

* Bump pip from 25.1 to 25.1.1 (#1308)

Bumps [pip](https://github.com/pypa/pip) from 25.1 to 25.1.1.
- [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst)
- [Commits](pypa/pip@25.1...25.1.1)

---
updated-dependencies:
- dependency-name: pip
  dependency-version: 25.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pipenv from 2025.0.1 to 2025.0.2 (#1307)

Bumps [pipenv](https://github.com/pypa/pipenv) from 2025.0.1 to 2025.0.2.
- [Release notes](https://github.com/pypa/pipenv/releases)
- [Changelog](https://github.com/pypa/pipenv/blob/main/CHANGELOG.md)
- [Commits](pypa/pipenv@v2025.0.1...v2025.0.2)

---
updated-dependencies:
- dependency-name: pipenv
  dependency-version: 2025.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Refactors hello, removes worthless unit tests (#1300)

* Refactors hello, removes worthless unit tests

* Add return type None to function

* fix typo

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: dkay <dkay@nortnet.org>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Merge all formatting and testing CI into one (#1312)

* Merge all formatting and testing CI into one

* Remove useless statements

* Don't run CodeQL or container on pushes, only PRs

* Refactor all moderation features, auto mod and notes. Add reports and modlog. (#1095)

This is a complete rewrite and restructure of protect and everything related to it.

protect.py was split into:
commands/moderator.py
commands/purge.py
core/moderation.py
functions/automod.py
functions/paste.py

Two additional files were added:
commands/modlog.py
commands/report.py

who.py was split into:
commands/notes.py
commands/whois.py

commands/moderator.py:
Moved all moderator actions into slash commands
Adds a new /unwarn command allowing individual warnings to be removed
Logs and displays who warned people (Fixes #657)
Mute can now have both a duration and a reason (fixes #721)

commands/modlog.py
Completely new feature, copying carlbots /modlog highscores and ban/unban logging
This additionally adds the ability to lookup bans by user or moderator
Bans are now forever stored in TS database (Fixes #380)

commands/notes.py
All the notes editing commands, as well as a /notes all
Write roles checks now check reader roles as well (fixes #692)
Makes notes all paginated (fixes #800)
Notes reader/writer now only send one message if config is empty (fixes #983)

commands/purge.py
Moves purge command to /purge
Combines the duration and exact command

commands/whois.py
Is the /whois command

core/moderation.py
This handles the core actions of ban/unban/kick/mute/unmute/warn/unwarn and a few core logic items, like getting all warnings

functions/automod.py
Completely rewrites automod (Fixes #463)
Fixes regex not working (no issue for this one)
Adds a mute feature for automod (Fixes #1020)
Adds automod as a framework instead of a strict class, allowing other modules to run messages through automod
Adds IRC checks to automod (Fixes #212)

functions/paste.py
Paste now makes sure that the linx API request worked and that the message was sent BEFORE deleting the original message (Fixes #1077)
Paste checks if message violates automod, and if it was recommended that it was deleted, nothing happens

Other:
Who now shows new warning information (Fixes #180)
Moves duck to use the new core/moderation.py feature

* Add enable all extension command (#1299)

* Fix perms with extension all command (#1316)

* Removes the if statements on CI (#1328)

* Better message on factoid forget (#1326)

* Better message on factoid delete

* Remove typing

* Fix CI schedule (#1329)

* Remove label in ci.yml (#1330)

* Bump hypothesis from 6.131.9 to 6.131.15 (#1327)

Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.131.9 to 6.131.15.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](HypothesisWorks/hypothesis@hypothesis-python-6.131.9...hypothesis-python-6.131.15)

---
updated-dependencies:
- dependency-name: hypothesis
  dependency-version: 6.131.15
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ajax146 <31014239+ajax146@users.noreply.github.com>

* Better factoid json name (#1325)

* Changes the name of factoid json to match input

* Add a to lower

* Bump pylint from 3.3.6 to 3.3.7 (#1315)

Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.3.6 to 3.3.7.
- [Release notes](https://github.com/pylint-dev/pylint/releases)
- [Commits](pylint-dev/pylint@v3.3.6...v3.3.7)

---
updated-dependencies:
- dependency-name: pylint
  dependency-version: 3.3.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ajax146 <31014239+ajax146@users.noreply.github.com>

* Bump hypothesis from 6.131.15 to 6.131.18 (#1332)

Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.131.15 to 6.131.18.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](HypothesisWorks/hypothesis@hypothesis-python-6.131.15...hypothesis-python-6.131.18)

---
updated-dependencies:
- dependency-name: hypothesis
  dependency-version: 6.131.18
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Modmail self/contact now links new thread on success (#1331)

* Modmail self/contact now links new thread on success

* Add space

* Fix factoid all when there are no factoids for a given guild (#1322)

* Fixes modmail sending files in threads (#1320)

* Properly parse namespace on slash command log (#1313)

* Properly parse namespace on slash command log

* Adds a failsafe 6000 character limit, just in case

* Move news random to be a slash command with autofill (#969)

* Hopefully fix a bug with warns

* Update News to a slash command to fix categories

* Removing just plain news command comment

* Update filtered articles

* update news filter

* update for pylint

* Reverting protect change

* Make it so it stops logging every autocomplete

* Formatting update

* More formatting changes

* Flake8 formatting update

* Small fix for flake8

* Hacky rate limit error fix

* Update docstring

---------

Co-authored-by: ajax146 <31014239+ajax146@users.noreply.github.com>
Co-authored-by: dkay <dkay@nortnet.org>

* Bump hypothesis from 6.131.18 to 6.135.4 (#1340)

Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.131.18 to 6.135.4.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](HypothesisWorks/hypothesis@hypothesis-python-6.131.18...hypothesis-python-6.135.4)

---
updated-dependencies:
- dependency-name: hypothesis
  dependency-version: 6.135.4
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pytest from 8.3.5 to 8.4.0 (#1339)

Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.5 to 8.4.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@8.3.5...8.4.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-version: 8.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pipenv from 2025.0.2 to 2025.0.3 (#1338)

Bumps [pipenv](https://github.com/pypa/pipenv) from 2025.0.2 to 2025.0.3.
- [Release notes](https://github.com/pypa/pipenv/releases)
- [Changelog](https://github.com/pypa/pipenv/blob/main/CHANGELOG.md)
- [Commits](pypa/pipenv@v2025.0.2...v2025.0.3)

---
updated-dependencies:
- dependency-name: pipenv
  dependency-version: 2025.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Adds a crude debug command (#1110)

* Adds a crude debug command

* Make some changes

* Formatting

* Formatting

* More formatting

* Even more formatting

* Bump pytest-asyncio from 0.26.0 to 1.0.0 (#1342)

Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.26.0 to 1.0.0.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Commits](pytest-dev/pytest-asyncio@v0.26.0...v1.0.0)

---
updated-dependencies:
- dependency-name: pytest-asyncio
  dependency-version: 1.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump hypothesis from 6.135.4 to 6.135.10 (#1341)

Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.135.4 to 6.135.10.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](HypothesisWorks/hypothesis@hypothesis-python-6.135.4...hypothesis-python-6.135.10)

---
updated-dependencies:
- dependency-name: hypothesis
  dependency-version: 6.135.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add a warning message to people who DM the main bot (#1334)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luna <161262151+GalacticalWolf@users.noreply.github.com>
Co-authored-by: TheKrol <TheKrol@users.noreply.github.com>
Co-authored-by: Cpt-Dingus <100243410+Cpt-Dingus@users.noreply.github.com>
Co-authored-by: dkay <dkay@nortnet.org>
Co-authored-by: Koei <eshanshekhaji@gmail.com>
Co-authored-by: PipeItToDevNull <25917750+PipeItToDevNull@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment