npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@scorpion-kitty/core

v1.3.2

Published

Scorpion Kitty discord bot framework

Readme

Scorpion Kitty Core

npm version build status

This package contains the brain of the Scorpion Kitty Discord bot as it has the complexity of handling and registering the commands abstracted away in this internal framework.

The way this framework is supposed to be used and feel like is greatly inspired by Angular and Nest.js.

This way to see a more detailed documentation.

Usage

Services

A simple service with one method looks like this:

// main.service.ts
import { Injectable } from '@scorpion-kitty/core';

@Injectable()
export class MainService {
	async pingAsync(param: string): Promise<string> {
		return param;
	}
}

Controllers

A controller with one command looks like this:

// main.controller.ts
import {
	BotController,
	BotCommand,
	HasServerPermission,
	IsBotOwner,
	Message
} from '@scorpion-kitty/core';

import { MainService } from './main.service';

@BotController()
export class MainController {
	// The constructor will be called from the framework and filled with provided services,
	// so they are ready to use inside the controller
	constructor(private mainService: MainService) {}

	// This method will be called, when a messages with the first word '?test' or '?t' will be received
	// and only, if the author has the MANAGE_MESSAGES permission
	@BotCommand('test :param :text', { aliases: ['t'] })
	@HasServerPermission(
		['MANAGE_MESSAGES'],
		`You can't just go around and test stuff`
	)
	async command(
		@Msg() msg: Message,
		@Param('param') param: string,
		@Param('text') someText: string
	) {
		await msg.reply('I got your test-command');
		const result = await this.mainService.pingAsync('Hi');
		await msg.channel.send(
			`${param}, ${text} and the async service says ${result}`
		);
	}

	// This command will only be allowed to be used by the discord user who owns the bot
	@BotCommand('owner')
	@IsBotOwner('Do not touch me')
	async ownerCommand(@Msg() msg: Message) {
		await msg.reply('yes?');
	}
}

This will create a controller that contains a command registered as ?test and ?t.

Modules

To register controllers, so the bot can start handling them, you need to create modules.

// main.module.ts
import { BotModule } from '@scorpion-kitty/core';
import { MainService } from './main.service';
import { MainController } from './main.controller';

@BotModule({
	imports: [],
	providers: [MainService],
	controllers: [MainController]
})
export class MainModule {}

Register the root module

One module is needed as root for the bot to be created. Furthermore, the bots Discord Bot Client Token from a registered Discord Application is needed to start the bot.

// main.ts
import { ScorpionKittyFactory } from '@scorpion-kitty/core';

const token = process.env.TOKEN;

const bot = ScorpionKittyFactory.create(MainModule);
bot.login(token, { customPrefix: '!', logLevel: 'trace' });