New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

grot-core

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grot-core

Modular και επεκτάσιμο Discord Bot Framework σε TypeScript με plugin system και service container για εύκολη δημιουργία, κατανομή και χρήση plugins.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

GrotCore

Καλώς ήρθες στο GrotCore, ένα modular Discord bot framework σε TypeScript με plugin system. Ακολουθεί ένα γρήγορο tutorial για να ξεκινήσεις το πρώτο σου bot.

1️⃣ Εγκατάσταση

Στο project σου:

npm install grot-core

Στη συνέχεια, εγκατάστησε τα plugins που θέλεις, π.χ.:

npm install @grot/example-plugin

Κάθε plugin πρέπει να έχει εγκατεστημένο το core σαν peer dependency.

2️⃣ Δημιουργία bot

Δημιούργησε ένα αρχείο, π.χ. index.ts:

import { GrotCore } from "grot-core";
import { ExamplePlugin } from "@grot/example-plugin";

// Δημιουργία του core
const client = new GrotCore();

// Καταχώρηση plugin
client.registerPlugin(new ExamplePlugin());

// Εκκίνηση του bot
client.run();
  • Το registerPlugin() προσθέτει το plugin και μαζεύει τα required intents.
  • Το run() δημιουργεί τον Discord client με όλα τα intents που χρειάζονται τα plugins και κάνει login.

3️⃣ Περιεχόμενο plugin

Ένα παράδειγμα plugin:

import { Plugin, GrotCore } from "grot-core";

export class ExamplePlugin implements Plugin {
  name = "ExamplePlugin";
  requiredIntents = [ "Guilds", "GuildMessages" ]; // π.χ. GatewayIntentBits

  initialize(core: GrotCore) {
    core.client.on("messageCreate", msg => {
      if (msg.content === "!ping") {
        msg.reply("Pong!");
      }
    });
  }
}
  • Κάθε plugin έχει name και optional requiredIntents.
  • Η initialize(core) μέθοδος δίνει πρόσβαση στον Discord client και τις υπηρεσίες του core.

4️⃣ Εκτέλεση

DISCORD_TOKEN=your_token_here ts-node index.ts

Το bot τώρα:

  • Φορτώνει όλα τα plugins
  • Δημιουργεί τον Discord client με intents από τα plugins
  • Αρχίζει να ακούει events

5️⃣ Σημειώσεις

  • Κάθε plugin μπορεί να δηλώνει εξαρτήσεις (dependencies) για να φορτώνεται με τη σωστή σειρά.
  • Οι developers των plugins χρησιμοποιούν @grot/core σαν devDependency για type checking και build.
  • Ο τελικός χρήστης εγκαθιστά το core και τα plugins στο bot project.

Αυτό το tutorial δείχνει πώς να φτιάξεις ένα πλήρως modular Discord bot με plugins που φορτώνονται δυναμικά και αυτοματοποιημένα.

FAQs

Package last updated on 28 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts