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

msg.ts

v0.5.0

Published

MSG is the framework for make discord bot easily

Downloads

7

Readme

Discord npm Build Status npm Lines of code NPM


Table of contents

About

MSG is a discord bot framework that made for complement discord.js library.

it runs on discord.js base, but it can do a lot of things to easy, than discord.js does.

so, MSG can provide legacy workload that base on discord.js library.

also, MSG can help you more with repetitive and meaningless tasks such as separation and controlling commands.

Installation

Node.js 16.0.0 or newer is required.

npm i msg.ts

Usage

const MSG = require('msg.ts')

const prefix = '!'

const bot = new MSG.Bot()

bot.setConfig({
    prefix,
})

bot.on('readyState', bot => {
    console.log(`${bot.user.tag} is ready!`)
})

bot.indent('now', [
    MSG.subCall('day', ctx => {
        ctx.reply(
            `current day is \`${new Intl.DateTimeFormat('en-US', {
                weekday: 'long',
            }).format(new Date().getDay())}\``,
        )
        return ctx.finish()
    }),
    MSG.subCall('date', ctx => {
        ctx.reply(`today is the \`${new Date().getDate()}th\``)
        return ctx.finish()
    }),
    MSG.subCall(true, ctx => {
        ctx.reply(`now time is \`${new Date()}\``)
        return ctx.finish()
    }),
])

bot.addCommand(
    MSG.subCall(true, ctx => {
        const commandDoc = `now:
    usage: \`${prefix}now\`
    description: show current time
    subcommands:
        name: day
            usage: \`${prefix}now day \`
            description: show current day of week
        name: date
            usage: \`${prefix}now  date\`
            description: show current date
        <default>
            description: just show all data
            usage: \`${prefix}now\``

        ctx.reply(`command list:\n\`\`\`yml\n${commandDoc}\n\`\`\``)
        return ctx.finish()
    }),
)

bot.login(process.env.DISCORD_TOKEN)

Other packages

generator-msg scaffolding for MSG framework (npm i -g yo generator-msg ; yo msg)

Contributing

are you want to contribute?

thanks so much!

please read our contributing guide before start contribute

links