Skip to content

Ganyu-Studios/seyfert-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Seyfert Bot Template

Seyfert TypeScript Node.js License

A modern, feature-rich Discord bot template built with Seyfert framework

โœจ Features

  • ๐Ÿ”ฅ Modern TypeScript - Written in TypeScript with full type safety
  • โšก Seyfert Framework - Built on top of the powerful Seyfert Discord library
  • ๐ŸŽฏ Command System - Easy-to-use command structure with decorators
  • ๐Ÿ“ฆ Event Handling - Clean event system for Discord events
  • ๐Ÿ› ๏ธ Development Tools - Hot reload, linting, and formatting included
  • ๐Ÿ”ง Configuration - Flexible configuration with environment variables
  • ๐Ÿ“ Code Quality - Biome for linting and formatting, Husky for git hooks
  • ๐ŸŽจ Argument Parsing - YunaForSeyfert for advanced command argument parsing

๐Ÿ—๏ธ Project Structure

seyfert-template/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ commands/          # Bot commands
โ”‚   โ”‚   โ””โ”€โ”€ ping.ts        # Example ping command
โ”‚   โ”œโ”€โ”€ events/            # Discord events
โ”‚   โ”‚   โ””โ”€โ”€ ready.ts       # Bot ready event
โ”‚   โ””โ”€โ”€ index.ts           # Main entry point
โ”œโ”€โ”€ dist/                  # Compiled JavaScript (generated)
โ”œโ”€โ”€ seyfert.config.mjs     # Seyfert configuration
โ”œโ”€โ”€ tsconfig.json          # TypeScript configuration
โ”œโ”€โ”€ biome.json             # Biome linting/formatting config
โ””โ”€โ”€ package.json           # Project dependencies

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 20+
  • pnpm (recommended package manager)
  • Discord Bot Token (Get one here)

Installation

  1. Clone the repository

    git clone https://github.com/Ganyu-Studios/seyfert-template.git
    cd seyfert-template
  2. Install dependencies

    pnpm install
  3. Set up environment variables

    # Create a .env file in the root directory
    TOKEN=your_discord_bot_token_here
  4. Start development

    pnpm dev

๐Ÿ”ง Available Scripts

Script Description
pnpm dev Start the bot in development mode with hot reload
pnpm test Run the bot in debug mode for testing
pnpm build Compile TypeScript to JavaScript
pnpm start Start the production build
pnpm lint Run Biome linter
pnpm format Format code with Biome
pnpm typecheck Check TypeScript types without emitting

๐ŸŽฎ Commands

Built-in Commands

  • /ping - Check bot latency and API response time
    • Aliases: !ping, ?latency, >>pong
    • Shows gateway latency and API response time

๐Ÿ“š Adding New Commands

Create a new file in src/commands/ directory:

import { Command, type CommandContext, Declare } from "seyfert";

@Declare({
    name: "hello",
    description: "Say hello to the user",
})
export default class HelloCommand extends Command {
    override async run(ctx: CommandContext) {
        await ctx.editOrReply({ content: `Hello, ${ctx.author.displayName}! ๐Ÿ‘‹` });
    }
}

๐ŸŽฏ Adding New Events

Create a new file in src/events/ directory:

import { createEvent } from "seyfert";

export default createEvent({
    data: { name: "messageCreate" },
    async run(message, client) {
        // Handle message create event
        console.log(`Message received: ${message.content}`);
    },
});

โš™๏ธ Configuration

The bot configuration is handled through seyfert.config.mjs. Key features:

  • Environment-based setup - Automatically switches between development and production
  • Debug mode - Use --debug flag for detailed logging
  • Intent management - Configurable Discord gateway intents
  • Command handling - Custom command processing with Yuna parser

Environment Variables

Variable Description Required
TOKEN Discord bot token โœ…

๐Ÿ› ๏ธ Development

Code Quality

This template includes:

  • Biome - Fast linting and formatting
  • Husky - Git hooks for code quality
  • lint-staged - Run linters on staged files
  • TypeScript - Type checking and compilation

Development Flags

  • --dev - Development mode (uses src/ directory)
  • --debug - Debug mode (enhanced logging)

๐Ÿ“ฆ Dependencies

Core

  • seyfert - Modern Discord bot framework
  • yunaforseyfert - Advanced argument parsing
  • dotenv - Environment variable management

Development

  • typescript - TypeScript compiler
  • @biomejs/biome - Linting and formatting
  • tsx - TypeScript execution
  • husky - Git hooks

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™‹โ€โ™‚๏ธ Support

๐Ÿ’ Acknowledgments

  • Seyfert Team - For the amazing Discord bot framework
  • Ganyu Studios - Template development and maintenance
  • Community - For feedback and contributions

Made with โค๏ธ by Ganyu Studios

Star โญ this repository if you found it helpful!

About

A simple template for a simple framework.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks