T.F.A's Utilities is a powerful and advanced Discord moderation bot built for T.F.A 7524 - Development. This project uses Prisma ORM and discord.js v14, and the main database SQLite. You can change the database to another one (examples: MongoDB, PostgreSQL... etc.) but you need to edit the model in prisma/schema.prisma
.
Warning This bot is made for a single-server only. If you make your bot public, you need a huge database and some other configuration for the commands. This bot is NOT made for public servers.
- Custom slash (
/
) commands (5 max)
- Anti-swear
- Anti-link
- Anti-Discord server invites
- Anti-caps
- Anti-mass mention
- Anti-walls (number of lines per message)
- Anti-emoji spam (number of emojis per message)
- Anti-IP addresses (avoid any IPv4 or/and IPv6 in any message)
- Message update anti-bypasser (avoid members to bypass automod by editing their messages)
- Auto-mod infractions
- Infractions
- Automod
- 3x warnings: 3h timeout
- Automod
- Infractions expiration time
- Automod
- Warning: 6h
- Mute: Permanent
- Manual
- Warning: 7d / Permanent
- Mute: Permanent
- Ban: Permanent
- Kick: Permanent
- Automod
- Slowmode
- Channel lock & unlock
- Server lockdown & unlock
- Yeet (troll command)
- Note system
- Protected moderator roles (avoid staff members to punish other staff members)
- AFK system
- Welcome system & autorole
- Server & user info
- Help with mentionable commands & autocomplete options
- Run the following command to initialize a new package:
npm init -y
- Install typescript, prisma, and @types/ms as dev dependencies:
npm install --save-dev typescript prisma @types/ms
- Run a migration to create your database tables with prisma: (Learn more here)
npx prisma migrate dev --name init
- Install other required packages:
npm install @prisma/client aqify.js axios discord.js dotenv ms
- Rename
.env.example
to.env
andexample.config.ts
(insrc/
) toconfig.ts
, and then fill all required values in each file.
.env:
# The database URL ("file:./dev.db" for SQLite)
DATABASE_URL="file:./dev.db"
# The Discord bot token
CLIENT_TOKEN=""
# The Discord bot ID
CLIENT_ID=""
# The developer ID (You)
OWNER_ID=""
config.ts:
export default {
lockdown: {
// The channel IDs to update whenever the server is on lockdown.
channels: string[]
},
moderation: {
// The role IDs to protect other staff members whenever a staff tries to punish them.
protectedRoles: string[]
},
automod: {
// The role IDs to ignore people (have at least one of the roles) who breaks the automod rules.
protectedRoles: string[]
}
};
- Run the following command to compile the TypeScript files into JavaScript files, and then starts from the main file
lib/index.js
.
npm run build
GPL-3.0, General Public License v3.0