Giter Site home page Giter Site logo

peterthehan / create-discord-bot Goto Github PK

View Code? Open in Web Editor NEW
164.0 164.0 80.0 505 KB

A module-based Discord bot template.

License: MIT License

Shell 1.38% TypeScript 98.62%
bootstrap bot discord discord-bot discordjs framework modules nodejs plugin template widget

create-discord-bot's Introduction

create-discord-bot's People

Contributors

dependabot[bot] avatar peterthehan avatar shadowtime2000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

create-discord-bot's Issues

Accessing Client from Handlers/Commands

I think it would be a good idea to add the ability to access the client variable from handlers or commands, so certain commands can display cached data and such.

Command categories | Suggestion

Hi there, I'm COÐΣ THΣΣÐAL ツᴮᴼᵀ#8126 and I would like to suggest an option or something that makes your commands in categories like Moderation, General, Fun, etc.

 bot-name
 |---src
      |---commands
            |--General
                  |---userinfo
                  |---serverinfo
            |---Fun
                  |---Memes
                  |--Kiss

Something like I did up there

NPX command Not working.

Hello. I just found this and was going through the steps and cant seem to get the NPX command to work. It doesn't make the utility nor does it make or edit anything. Am I missing anything or is this outdated?

Drop discord.js dependency in favor of manually fetching application ID

We installed discord.js in order to login in via the bot token in order to fetch the application ID needed for the invite url.

https://bundlephobia.com/[email protected],[email protected],[email protected],[email protected]

We can trim the dependency bloat due to discord.js by manually fetching the application ID ourselves.

Endpoint doc: https://discord.com/developers/docs/topics/oauth2#get-current-application-information
Endpoint: GET https://discordapp.com/api/oauth2/applications/@me

Improve README readability

Existing README assumes some technical knowledge of the user and is not layman-friendly. The target audience should be lowered considering the context of the project and/or there should be multiple versions of the README that expands/condenses the information appropriately from which the user can choose from.

Error message

Everytime I do npx peterthehan/create-discord-bot I get this error message:
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -4058
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://[email protected]/peterthehan/create-discord-bot.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\yasse\AppData\Roaming\npm-cache_logs\2021-04-21T20_35_32_703Z-debug.log

Issues with ESLint in app and utility script.

While I was working on #65, the git precommit hooks failed because ESLint doesn't know which @typescript-eslint plugin to use, or more of which .eslintrc.json file to use. I feel like this is an omen for more obstacles to come, and I think we should do something about it. One solution I can think of is moving the app folder into another GitHub repo, and having the utility script download that.

JSDoc For Typescript

Currently, we commit dist files with compiled Typescript. Typescript has support for static typing using JSDoc comments which can allow us to not have to have any build process. An example of a project using that is SwordCSS.

Add logic to aggregate Intents from widgets to pass as args when initializing Client

Intents will be mandatory when discord.js switches from gateway v6 -> v8 and/or Discord kills v6. https://discord.com/developers/docs/topics/gateway#privileged-intents

Simple fix would be to initialize the client enabling all intents https://discord.js.org/#/docs/main/master/class/Intents?scrollTo=s-ALL

Better implementation would be to add a list of necessary intents as a configuration option for each widget so that we're receiving events for only the things each respective widget requires.

Run npx against the ts code instead of the compiled code

Today, we are pushing the compiled code (in dist/) to the repo so that npx can run this code using the shebang + bin value in package.json. It would be great to instead run the ts code directly with npx so we can stop pushing build files.

Global Dependencies

Currently there is no way to have global dependencies that are only initialized once. I think we should have a deps.js file which has some global dependencies. It could be like this:

const dbORM = require("db-orm");

const connection = dbOrm("my-connection");

module.exports = {
  connection
};

So then only one connection is created which is reused through out the different widgets.

Fix creating boilerplate step not copying gitignore

Today, we have code in place to write a .gitignore file manually instead of just copying from app/. For some reason fs.copySync is not copying it correctly. Additionally, other dotfiles like .eslintignore and .eslintrc.json seem to copy fine.

You can recreate the issue by commenting out the manual write, pushing to a new branch, and running the script remotely npx <username>/create-discord-bot#<yourbranchname>.

Speed up npx command

On my machine today, the npx command takes ~16 seconds and installs 27 packages before loading the prompts. For reference, an older version of the script as seen in the demo gif took ~7 seconds and installed only 7 packages.

Some performance loss is unavoidable as we add features but we should look into speeding this command up.

help

how i can stop the bot???

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.