Add auto kick functionality (#502)
All checks were successful
Test / build (push) Successful in 13s

- Add command to configure the auto kick function
- Added ability to run functions on a cron job
- Added a cron job every hour to check if a user has had a role for a configured amount of time and kick them if they have
    - The function also optionally sends a notice embed at a configured time before the kick

#485

Reviewed-on: #502
Reviewed-by: VylpesTester <tester@vylpes.com>
Co-authored-by: Ethan Lane <ethan@vylpes.com>
Co-committed-by: Ethan Lane <ethan@vylpes.com>
This commit is contained in:
Ethan Lane 2025-01-03 17:47:16 +00:00 committed by Vylpes
parent bfbf386eeb
commit cdf689f1c5
16 changed files with 467 additions and 4 deletions

View file

@ -0,0 +1 @@
DROP TABLE auto_kick_config;

View file

@ -0,0 +1,10 @@
CREATE TABLE auto_kick_config (
Id varchar(255) NOT NULL,
WhenCreated datetime NOT NULL,
WhenUpdated datetime NOT NULL,
ServerId varchar(255) NOT NULL,
RoleId varchar(255) NOT NULL,
KickTime int NOT NULL,
NoticeTime int NULL,
NoticeChannelId varchar(255) NULL
);

View file

@ -0,0 +1,2 @@
ALTER TABLE auto_kick_config
ADD PRIMARY KEY (Id);