Skip to content

Project: Discord Member Status Bot with Embed Updates and Daily Messages. Created at https://spectra.codes, which is owned by @Drix10

Notifications You must be signed in to change notification settings

coslynx/discord-member-status-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

57 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


discord-member-status-bot

A Discord bot that provides real-time insights into member activity within a server.

Developed with the software and tools below.

Language: TypeScript Framework: Discord.js Database: MySQL API: Discord

git-last-commit GitHub commit activity GitHub top language

πŸ“‘ Table of Contents

  • πŸ“ Overview
  • πŸ“¦ Features
  • πŸ“‚ Structure
  • πŸ’» Installation
  • πŸ—οΈ Usage
  • 🌐 Hosting
  • πŸ“„ License
  • πŸ‘ Authors

πŸ“ Overview

This repository houses the "discord-member-status-bot" project, a sophisticated Discord bot designed to provide real-time insights into member activity within a server. Utilizing a robust tech stack comprising TypeScript, Discord.js, MySQL, and the Discord API, the bot empowers server administrators with invaluable data to make informed decisions regarding server management and member engagement.

πŸ“¦ Features

Feature Description
βš™οΈ Real-Time Member Status Updates: Tracks and displays member join/leave events in real time, showcasing online/offline status indicators.
🎀 Voice Channel Time Tracking: Monitors the duration of each member's presence in voice channels, calculating and displaying total voice channel time.
πŸ’¬ Daily Message Count: Tracks and displays the number of messages sent by each member daily, providing a comprehensive understanding of member activity within the server's text channels.
πŸ€– Automated Embed Updates: Ensures embeds displaying real-time member status, voice channel time, and message counts are updated automatically at predefined intervals.
πŸ§‘β€πŸ’» User-Friendly Interface: Provides a user-friendly interface for bot configuration, enabling server administrators to customize settings, access commands, and manage bot functionality.
πŸ›‘οΈ Robust Error Handling: Incorporates comprehensive error handling mechanisms to prevent crashes, data loss, and unexpected behavior.
πŸ“ˆ Advanced Analytics (Optional): Potential for incorporating advanced analytics capabilities, providing insights into member trends and engagement patterns.
🌐 Server-Specific Configuration (Optional): Allows for server-specific configurations, enabling different servers to have customized settings.

πŸ“‚ Structure

discord-member-status-bot/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ events/
β”‚   β”‚   β”œβ”€β”€ ready.ts
β”‚   β”‚   β”œβ”€β”€ guildMemberAdd.ts
β”‚   β”‚   β”œβ”€β”€ guildMemberRemove.ts
β”‚   β”‚   β”œβ”€β”€ voiceStateUpdate.ts
β”‚   β”‚   β”œβ”€β”€ messageCreate.ts
β”‚   β”‚   └── interactionCreate.ts
β”‚   β”œβ”€β”€ commands/
β”‚   β”‚   β”œβ”€β”€ status.ts
β”‚   β”‚   β”œβ”€β”€ voicetime.ts
β”‚   β”‚   β”œβ”€β”€ messagecount.ts
β”‚   β”‚   β”œβ”€β”€ help.ts
β”‚   β”‚   └── config.ts
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ memberService.ts
β”‚   β”‚   β”œβ”€β”€ voiceChannelService.ts
β”‚   β”‚   β”œβ”€β”€ messageService.ts
β”‚   β”‚   └── embedService.ts
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ logger.ts
β”‚   β”‚   β”œβ”€β”€ errorHandler.ts
β”‚   β”‚   β”œβ”€β”€ database.ts
β”‚   β”‚   └── helper.ts
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”œβ”€β”€ env.config.ts
β”‚   β”‚   └── database.config.ts
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ member.ts
β”‚   β”‚   β”œβ”€β”€ voiceChannel.ts
β”‚   β”‚   β”œβ”€β”€ message.ts
β”‚   β”‚   └── embed.ts
β”‚   β”œβ”€β”€ interfaces/
β”‚   β”‚   β”œβ”€β”€ memberInterface.ts
β”‚   β”‚   β”œβ”€β”€ voiceChannelInterface.ts
β”‚   β”‚   β”œβ”€β”€ messageInterface.ts
β”‚   β”‚   └── embedInterface.ts
β”‚   └── index.ts
└── dashboard/
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ main.ts
    β”‚   β”œβ”€β”€ router.ts
    β”‚   β”œβ”€β”€ components/
    β”‚   β”‚   β”œβ”€β”€ App.vue
    β”‚   β”‚   β”œβ”€β”€ Home.vue
    β”‚   β”‚   β”œβ”€β”€ Members.vue
    β”‚   β”‚   β”œβ”€β”€ VoiceTime.vue
    β”‚   β”‚   β”œβ”€β”€ MessageCount.vue
    β”‚   β”‚   β”œβ”€β”€ Config.vue
    β”‚   β”‚   └── About.vue
    β”‚   β”œβ”€β”€ styles/
    β”‚   β”‚   β”œβ”€β”€ index.css
    β”‚   β”‚   └── tailwind.css
    β”‚   β”œβ”€β”€ store/
    β”‚   β”‚   β”œβ”€β”€ index.ts
    β”‚   β”‚   └── modules/
    β”‚   β”‚       β”œβ”€β”€ member.ts
    β”‚   β”‚       β”œβ”€β”€ voiceTime.ts
    β”‚   β”‚       β”œβ”€β”€ messageCount.ts
    β”‚   β”‚       β”œβ”€β”€ config.ts
    β”‚   β”‚       └── embed.ts
    β”‚   β”œβ”€β”€ utils/
    β”‚   β”‚   β”œβ”€β”€ fetchAPI.ts
    β”‚   β”‚   β”œβ”€β”€ auth.ts
    β”‚   β”‚   └── helper.ts
    β”‚   └── main.js
    └── vite.config.js

πŸ’» Installation

πŸ”§ Prerequisites

  • Node.js
  • npm
  • MySQL
  • Discord Bot Account

πŸš€ Setup Instructions

  1. Clone the repository:
    git clone https://github.com/coslynx/discord-member-status-bot.git
  2. Navigate to the project directory:
    cd discord-member-status-bot
  3. Install dependencies:
    npm install
  4. Set up a MySQL database:
    • Create a database and a user with appropriate permissions.
    • Update the database configuration in src/config/database.config.ts with your database credentials.
  5. Create a Discord Bot Account:
    • Create a Discord bot account and generate a bot token.
    • Add your bot token to the .env file:
      DISCORD_TOKEN="YOUR_BOT_TOKEN"
  6. Configure the bot:
    • Update the src/config/env.config.ts file with any necessary environment variables, such as your Discord server ID, bot prefix, and other settings.

πŸ—οΈ Usage

πŸƒβ€β™‚οΈ Running the Project

  1. Start the development server:
    npm run dev
  2. Invite your bot to your server:
    • Use the Discord developer portal to get a link to invite your bot to your server.
  3. Use the bot's commands:
    • Try using commands like /status, /voicetime, /messagecount, /help, and /config (as available) to explore the bot's features.

βš™οΈ Configuration

  • Environment Variables: Modify settings in the .env file to adjust various bot parameters.
  • Bot Settings: Use the /config command (if implemented) to customize the bot's behavior within your server.

πŸ“š Examples

  • /status: Displays real-time member status updates.
  • /voicetime: Shows the voice channel time for each member.
  • /messagecount: Displays the daily message count for each member.
  • /help: Provides a list of available commands and their descriptions.

🌐 Hosting

πŸš€ Deployment Instructions

  1. Build the project:
    npm run build
  2. Set up a server environment:
    • Choose a hosting platform (e.g., Heroku, AWS, Google Cloud) based on your needs.
    • Create a new application or instance on your chosen platform.
    • Configure the environment variables (e.g., DISCORD_TOKEN, DB_HOST, DB_USER, DB_PASS) on your server.
  3. Deploy the bot:
    • Follow the specific deployment instructions for your hosting platform.
    • Ensure your bot has the necessary permissions to operate within your server.

πŸ“œ API Documentation

πŸ” Endpoints

  • GET /api/members: Retrieves a list of members with their activity data.
  • GET /api/voice-channels: Retrieves a list of voice channels with member voice time data.
  • GET /api/messages: Retrieves a list of messages with message count data.

πŸ”’ Authentication

  • The bot uses Discord's OAuth2 authentication to securely access Discord API data.
  • You can set up a web-based dashboard (optional) that requires user authentication for managing the bot.

πŸ“ Examples

  • curl -X GET http://localhost:3000/api/members

πŸ“œ License

This project is licensed under the MIT License.

πŸ‘₯ Authors

🌐 Spectra.Codes

Why only generate Code? When you can generate the whole Repository!