A feature-rich, modular Discord bot built using TypeScript and discord.js. This bot provides various utilities such as automated welcome messages, moderation commands (kick/ban), reaction roles, fun commands (jokes), and message logging. The bot is fully customizable and scalable, making it ideal for learning and building more complex bots.
- Welcome System: Sends welcome messages and assigns default roles when users join.
- Moderation Tools: Includes commands for kicking and banning users.
- Reaction Roles: Assign roles to users based on emoji reactions.
- Fun Commands: Fetches jokes or fun facts.
- Message Logging: Logs message edits and deletions to a specific channel.
Follow these steps to get your bot up and running:
git clone https://github.com/yourusername/discord-bot-typescript.git
cd discord-bot-typescriptInstall all the required packages with npm:
npm installCreate a .env file in the root of the project and add your bot token:
DISCORD_TOKEN=your-bot-tokenTo compile your TypeScript code, run:
npx tscOnce compiled, you can run your bot:
npx ts-node src/index.ts- Go to the Discord Developer Portal.
- Select your bot and copy the OAuth2 URL with appropriate permissions (e.g., Administrator or custom permissions).
- Paste the URL in your browser and invite the bot to your server.
/kicking @user- Kicks the specified user from the server./baning @user- Bans the specified user from the server./unban @user- Bans the specified user from the server.
!joke- Fetches a random joke.
- React to a message with the "👍" emoji to get a role.
- The bot automatically logs message edits and deletions to the
logschannel.
If you'd like to contribute to this bot, feel free to open issues or submit pull requests. Contributions are always welcome!
This project is licensed under the MIT License - see the LICENSE file for details.
- discord.js - The library for interacting with the Discord API.
- TypeScript - A strongly typed programming language that builds on JavaScript.