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

Sapphire Version 1 Completed #2

Open
wants to merge 68 commits into
base: production
Choose a base branch
from
Open

Sapphire Version 1 Completed #2

wants to merge 68 commits into from

Conversation

demitchell14
Copy link
Member

@demitchell14 demitchell14 commented Sep 11, 2021

Features as of cb0aa3e (Commits on Sep 10, 2021)

  1. At startup, the bot connects the database, creates tables if necessary, migrates if necessary.
  2. It will load all punishments that are possible to give out into a cache.
  3. It will start an internal synchronization loop that will check all latest/active punishments, if a punishment should be disabled, it will unban/unmute the person.
  4. It has 2 commands that are usable by ping-protected users.
    a. extend [time in minutes] which will create a timeframe that users will be able to ping. One catch currently is that if the user speaks after running the command, the time will reset to the default time that people have to ping the user.
    b. clear which will immediately stop allowing pings.
  5. It has 4 punishment related commands that are usable by users with one of the moderatorRoles
    a. punishments help shows commands that you can use
    b. punishments list shows all punishments that have been created. Each user or role has its own embed with a list of punishments
    c. punishments create which allows you to create a punishment. Entering the shown command will show you the full command context
    d. punishments remove which allows you to remove a punishment. Entering the shown command will show you the full command context
  6. If a ping-protected user is pinged while not around, they will receive a punishment.
    a. Punishments are created by staff, with increasing levels of punishment.
    b. The punishment the user receives is based on how many punishments they've received prior and how many punishments have been created. This means if there are 5 punishments created, and the user has been punished once, they will receive the second priority punishment.
    c. moderatorRoles, notifyChannels, excludedChannels are not effected,
    d. In order to use the mute punishment, a muteRole must be configured.
    e. If the user that performed a ping has lenientRoles, they will receive a different set of punishments. If no lenient punishments are created, they will still get the standard punishments.
  7. If a ping-protected user speaks in a chat other than notifyChannels and excludedChannels a few things happen.
    a. A message is sent out to notifyChannels that pings notifyRoles telling them that the user is around. It also gives a link to their first post.
    b. The bot stores the timestamp of the message along with notifyTimeout time in minutes in the database. This is the time that ping-protected user will no longer be able to be pinged.

As of now, I still need to do clean up.. but I feel like we could probably do some testing.

added comments, did a little bit of cleanup, and added command documentation MD

demitchell14 and others added 30 commits July 23, 2021 22:24
includes a userid, punishment end date, created date, and an optional expiration date

Signed-off-by: Devin Mitchell <[email protected]>
…ating the punishment database table

Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
# Conflicts:
#	src/Bot.ts
#	src/config/bot.ts
#	src/controllers/PingController.ts
#	src/database/database.ts
Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
punishments will use a punishment table now that includes type (ban, mute, kick), length of punishment, and target type (role or user currently are the options)

Signed-off-by: Devin Mitchell <[email protected]>
…shments that the bot can give out

Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
…ion to check if the message author is a monitored user

Signed-off-by: Devin Mitchell <[email protected]>
demitchell14 and others added 27 commits September 10, 2021 19:42
Signed-off-by: Devin Mitchell <[email protected]>
… mention

fixed minutesToReadable

Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin Mitchell <[email protected]>
Signed-off-by: Devin <[email protected]>
Signed-off-by: Devin <[email protected]>
Signed-off-by: Devin <[email protected]>
@demitchell14 demitchell14 marked this pull request as ready for review October 1, 2021 05:06
Signed-off-by: Devin <[email protected]>
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.

1 participant