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

dna-discord-framework-experimental

v1.0.50

Published

A node module that contains a Framework for building complex Discord Bots with ease and low barrier of entry

Downloads

3

Readme

Discord Bot Kit

A node module that contains a Framework for building complex Discord Bots with ease and low barrier of entry

Installing

Github

Run the Following command

git clone https://github.com/Nano-DNA-Studios/DNA-Discord-Framework.git

NPM

npm install dna-discord-framework

Getting Started

The following will show the basics on how to get started and use the

Create Discord Application

Start by heading over to Discord Applications and Login using your Discord Account

You will then receive a page looking like the following image

Click on the "New Application" Button.

You will be prompted to name the Discord Bot, and agree to the Terms and click "Create"

image

This leads you to the Following page

image

You can fill out this information to customize your bot and give it personality. You can fill this out later.

Setup Bot and Invite to Server

Go to the "Bot" Tab.

Make sure you turn the "Public Bot" Setting Off and turn on all the Settings in "Priveleged Gateway Intents"

image

Head over to the "OAuth2" Tab.

image

In the OAuth URL Generator section select the "Bot" and "application.commands" boxes

image

To avoid issues in the future check the Administrator boxes, this gives all permissions to the Bot. Once you're more familiar with setting up a bot you can be more selective

image

At the bottom of the Page a URL will be generated copy it

image

Inviting Requires Admin Priviliges

Paste it in the Server you want to invite it to and Click on it.

image

image

Click "Continue"

Click "Authorize"

image

The Bot should now be added.

image

If Successful they should appear in the Server.

image

The Bot can't be used and Won't be online until you make your own Discord Project

Make Bot Go Online with Default Settings

Setup Project

Head over to your preffered Code editor, the folowing will use VS Code.

Create a new Folder in the location you want to store your Bot and then drag the Folder into the VS Code Window to open the project

image

Run the Following in the VS Code Terminal or Equivalent

npm init -y  
npm install typescript --save-dev
npx tsc --init

image

Create Base Bot

Now install the NPM Package using the following command.

npm install dna-discord-framework

image

Create a new file named "index.ts"

image

Inside your "index.ts" file, add the following code

import { DiscordBot, BotDataManager } from "dna-discord-framework";

const Bot = new DiscordBot(BotDataManager);

Bot.StartBot();

image

Next, run the following in the terminal, this will create a JavaScript file in your project

tsc

image

Finally run the following to start the Bot

node index.js

You will be prompted to provide a Token

image

Generating Token and Login

Back in Discord Applications, go to the "Bot" Tab

image

Click the "Reset Token" Button, you may be prompted for a 2 Factor Authentication if you have that set up

It will then show your token with a "Copy" button.

Do Not Share Your Token Anywhere

If shared you Bot can be comprimised. Discord will also search for your token and if found on the internet will deactivate it.

image

Copy your Token and paste it in the Command Line for the Program. You should receive something similar

image

If you have invited the Bot to multiple Servers you may be prompted to input the name of the Server you want it connected to.

Notice that a Resource Folder is created with the Bots Data and a Log file. Make sure to add these files to your GitIgnore in order not to compromise your Token or other important information

image

Going back to Discord, you should notice that your Bot is now online

image

Run your First Command

The Bot comes with a few default Commands. The first is Setting the Log Channel. This is not required but can be useful to debug things in the future if you need it.

In the Discord Server start typing "/setlogchannel"

The command should appear in a Window

image

Click on it to complete the Command, you will then see a new Window appear for your options.

Pick an appropriate Channel to send Logs to, in our case it will be #general

image

Now run the command.

You will get an ephemeral message. This is only visible to you

** All Command Responses are Ephemeral, Once a Log Channel is set a copy of the Response is sent to the Log Channel**

image

Now that a Log Channel is set Responses will be sent there for Future Commands.

If needed the Bot also keeps tracks of Logs. This can be accessed in the log.txt file. Alternatively you can get them through Discord by running the following Command

/getlogs

The logs file should be sent and Downloadable now

image

Logs keep track of the user who called Commands, Name of the Command, Response Message and the Date and time the Command was called

Creating your own Command