Skip to content

Haresh/discord setup#3

Merged
OmOgale merged 6 commits intomainfrom
haresh/discord-setup
Nov 5, 2025
Merged

Haresh/discord setup#3
OmOgale merged 6 commits intomainfrom
haresh/discord-setup

Conversation

@hareshgoyal06
Copy link
Collaborator

Summary

This pull request introduces the initial setup for BobaTalks, a lightweight Discord bot built using discord.js v14 and TypeScript.
It establishes the core structure for command handling, environment configuration, and local development.

Features

Basic bot setup with discord.js and TypeScript

Environment configuration via .env (DISCORD_TOKEN, CLIENT_ID, GUILD_ID)

Slash command registration script (npm run register)

Development (npm run dev) and production (npm run build && npm start) workflows

Initial slash commands:

/ping — health check

/serverinfo — display server statistics

/userinfo — display user information

/poll — create interactive polls (up to 5 options)

/welcome — send a welcome message to a user

Includes basic error handling and embed-based responses

How to Test Locally

Create a .env file in the project root:

DISCORD_TOKEN=your_bot_token_here
CLIENT_ID=your_client_id_here
GUILD_ID=your_guild_id_here

Install dependencies:

npm ci

Register slash commands (first-time setup):

npm run register

Start the bot:


# Development mode
npm run dev

# Production mode
npm run build
npm start

Copy link
Collaborator

@OmOgale OmOgale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few small changes lol. Great work @hareshgoyal06 🧋

Copy link
Collaborator

@OmOgale OmOgale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also can you move these files under a bot subdirectory under src. So under src/bot/. The readme looks dope, but it addresses the bot specifically so i think moving all bot code under a common dir would be nice

@hareshgoyal06
Copy link
Collaborator Author

Github Issue link

Discord Bot Init

Implementation description

  • Integrated Discord bot using discord.js v14 with TypeScript
  • Implemented 5 MVP slash commands: /ping, /serverinfo, /userinfo, /poll, and /welcome
  • Set up complete development environment with ESLint, Prettier, Husky, and TypeScript strict mode
  • Organized all bot code under src/bot/ directory for better project structure
  • Configured build pipeline with TypeScript compilation to dist/bot/
  • Added npm scripts for development (npm run dev), building (npm run build), command registration (npm run register), and production (npm start)
  • Fixed deprecation warning by using Events.ClientReady instead of ready event
  • Created comprehensive bot documentation in src/bot/README.md
  • Updated main README with bot-specific scripts and reference to bot documentation

Steps to test

  1. Clone the repository and run npm ci to install dependencies
  2. Create a .env file with DISCORD_TOKEN, CLIENT_ID, and GUILD_ID (see src/bot/README.md for instructions on obtaining these values)
  3. Run npm run register to register slash commands with Discord
  4. Run npm run dev to start the bot in development mode
  5. Verify the bot comes online and logs ✅ Logged in as [bot name]
  6. Test each command in your Discord server:
    • /ping - Should respond with "🏓 Pong!"
    • /serverinfo - Should display server statistics
    • /userinfo - Should show user information
    • /poll - Should create an interactive poll
    • /welcome - Should send a welcome message
  7. Run npm run build to verify TypeScript compilation works
  8. Run linting and formatting checks: npm run lint && npm run format -- --check .

What should reviewers focus on?

  • Bot directory structure under src/bot/ and whether it's well-organized
  • TypeScript configuration (tsconfig.json and tsconfig.build.json) with rootDir setup
  • npm scripts configuration in package.json for dev/build/start workflows
  • Bot documentation clarity in src/bot/README.md
  • Error handling in command execution
  • Code quality and adherence to project standards (ESLint, Prettier, TypeScript strict mode)
image image

@hareshgoyal06 hareshgoyal06 requested a review from OmOgale November 5, 2025 05:40
@OmOgale OmOgale merged commit e16a6bc into main Nov 5, 2025
2 checks passed
@OmOgale OmOgale deleted the haresh/discord-setup branch November 5, 2025 17:52
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.

2 participants