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 🙏

© 2024 – Pkg Stats / Ryan Hefner

automata-bot.js

v2.0.5

Published

Discord.js but with some improvements

Downloads

4

Readme

MordeKayh

All the functions of discord.js but with some helpers and interactive commands.

Actually version

this version fixes the error when executing handlers commands.

Install

install mordekayh in your project

npm install mordekayh.js

Usage

const {MordeKayh, Intents} = require('mordekayh.js');
const bot = new MordeKayh({intents: [Intents.FLAGS.GUILDS]});

bot.on('ready', () => {
	console.log(`${bot.user.username}#${bot.user.discriminator}`);
})

bot.login('TOKEN');

Commander

This repository is with the use of hand commands, you can use this by configuring as follows.

Example:

const {MordeKayh, Intents} = require('mordekayh.js');
const bot = new MordeKayh({intents: [Intents.FLAGS.GUILDS]});

bot.commandHandler('./commands');

In order to use the commands perfectly, use this template in each command.

module.exports = {
	value: ['command'],
	description: "Template command",
	category: "helper",
	func: (bot, message, args) => {
		// YOUR CODE HERE
	}
}

here is a simple example of how to execute the commands with the message event

const {MordeKayh, Intents} = require('mordekayh.js');
const bot = new MordeKayh({intents: [Intents.FLAGS.GUILDS]});
const prefix = "!";

bot.on('message', (message) => {
	const init = message.content.split(' ', 1)[0];
	init.replace(prefix, '');
	const command = bot.getCommand(init);
	if(!command) return message.channel.send('Command not found');

	command.func(bot, message, args)
})

bot.login('TOKEN');

local databases

Initialize a database for your bot locally, or you can just use another database. Usage database:

const {MordeKayh, Intents} = require('mordekayh.js');
const bot = new MordeKayh({intents: [Intents.FLAGS.GUILDS]});

bot.database('./databases');

you can use the archive or you can use the database manager. These databases come with a template that you can easily change with the manager or directly with the functions.

Usage database

const {MordeKayh, Intents} = require('mordekayh.js');
const bot = new MordeKayh({intents: [Intents.FLAGS.GUILDS]});

bot.database('./databases');
const database = bot.startDB('init.database');
bot.setDB('init.database', []);

const data = bot.getDB('init.database');

Use server for APIs

now you can create a fast and secure environment with the use of express and some plugins.

const {MordeKayh, Intents} = require('mordekayh.js');
const bot = new MordeKayh({intents: [Intents.FLAGS.GUILDS]});

bot.on('ready', () => {
	console.log(`${bot.user.username}#${bot.user.discriminator}`);
})
const app = bot.server({
	guilds: bot.startDB('guilds')
});

app.listen(1000, () => {
	console.log('Server on');
});

app.get('/', (req, res) => {
	res.send({message: "Simple API with express."})
})

bot.login('TOKEN');

Logger

record and exchange data with this logger. This logger is good on occasions when we want to know certain actions of the user, or we simply want to save everything as backup, This logger uses dates and sha256 codes, which you can distribute by message or action of your users.

const {MordeKayh, Intents} = require('mordekayh.js');
const bot = new MordeKayh({intents: [Intents.FLAGS.GUILDS]});

bot.on('ready', () => {
	// SAVING LOG
	bot.logger('Bot on');
})

bot.database('./databases');

getting the logs

You can get logs in various ways, manually or by default by our repository.

const {MordeKayh, Intents} = require('mordekayh.js');
const bot = new MordeKayh({intents: [Intents.FLAGS.GUILDS]});

bot.on('ready', () => {
	// obtaining the logs from 10 minutes ago to the current time.
	bot.getLogs(bot.timems('10m'))
})

bot.database('./databases')

Note: filter it with .filter or with .sort.

FIXED

command handlers are no longer buggy, some new stuff added. For example, the use of all discord.js references and the Embeds and cache helpers were added.

Embed usage

bot.on('messageCreate', (message) => {
	message.channel.send(bot.embed({
		title: "Hello world",
		text: "this a hello world",
		icon: "your icon url",
		thumbnail: "thumb",
		color: "Color embed"
	}))
})

Add cache

const cache = bot.setCache({database: [{users: [], fixeds: []}]});

Support

Get support in discord: https://discord.gg/4r3bTAWGSF

Developers

Information

This project is an extension to the open source bots in Discord.

MordeKayh bot is the start of great projects.


⌨️ with ❤️ by KeigoCode 😊 ⌨️ with ❤️ by Kan014 😊