Coder Social home page Coder Social logo

mirasaki / discord.js-bot-template Goto Github PK

View Code? Open in Web Editor NEW
70.0 70.0 6.0 2.53 MB

A template for discord.js v14. Always up-to-date, integrates the latest Discord API features, and actively maintained.

Home Page: https://djs.mirasaki.dev

License: MIT License

JavaScript 99.30% Dockerfile 0.68% Procfile 0.02%
api autocomplete boilerplate bot-template buttons context-menus discord discord-api discord-bot discord-bot-template discordjs documentation documented modals nodejs rest select-menus skeleton slash-commands template

discord.js-bot-template's Introduction

Hi there, I'm Mirasaki

๐Ÿ’โ€โ™‚๏ธ About me

  • ๐Ÿ‡ณ๐Ÿ‡ฑ I was born in the Netherlands, February 1998
  • โ˜• is the best thing ever made
  • ๐Ÿต is fine too, I guess
  • ๐Ÿ“– I've got a dedicated book-display on my desk of books I know I will never read
  • ๐ŸŽต My favorite band is Nightwish, and I listen to music all the time
  • ๐ŸŽธ Playing Clone Hero - a competitive rhythm game for the Desktop - is absolutely amazing
  • ๐Ÿง™ The Lord of the Rings, the Hobbit, and Game of Thrones. Enough said

๐Ÿ“Š Github Stats

Mirasaki Github Stats

discord.js-bot-template's People

Contributors

code-factor avatar dependabot[bot] avatar mirasaki avatar semantic-release-bot 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

Watchers

 avatar  avatar  avatar

discord.js-bot-template's Issues

Adjust register listener logging

Code_o48VFsRN2P

Instead of the individual logging, change it to one long ling using listeners.join(', ')

Example output:

[INFO] Registering 9 listeners: guildCreate, guildDelete, applicationCommandInteraction, autoCompleteInteraction, interactionCreate, messageComponentInteraction, modalSubmitInteraction, pingInteraction
[SUCCESS] Finished registering listeners

Feature: Prefix commands

Is your feature request related to a problem? Please describe.
Not Related to any Problem

Describe the solution you'd like
Support for Prefix Commands

missing @discordjs/rest

@discordjs/rest is missing from package file and therefor the client won't initialize after a clean install

update deprecated default_permission value in developer commands

ApplicationCommand API Data
default_permission will soon be deprecated. You can instead set default_member_permissions to "0" to disable the command for everyone except admins by default, and/or set dm_permission to false to disable globally-scoped commands inside of DMs with your app

[BUG] - No support for ChatInput and ContextMenu commands with same name

Describe the bug
Duplicate commands (same name between ChatInputCommands and User-/MessageContext commands) is not supported, and overwrites the initial declared command

To Reproduce
Steps to reproduce the behavior:

  1. Create a ChatInputCommand named rank
  2. Create a UserContextCommand named rank
  3. Use /commands
  4. See only the UserContextCommand being displayed

Expected behavior
Display of both/all commands

Screenshots
n/a

Desktop (please complete the following information):

  • OS: [e.g. iOS] n/a
  • Version [e.g. 22] n/a

Additional context
n/a

[BUG] - Wrong command on Error while registering Discord commands

Describe the bug
If API command data validation doesn't pass, the bot would print out the wrong command data:

To Reproduce
Steps to reproduce the behavior:

  1. Create a command OPTION description of over 100 characters
  2. Restart

Expected behavior
Display correct command data

Screenshots
image

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context
Reported by Vasolix

command documentation

include a simple html page that retrieves command data and builds a documentation page

feat: ComponentCommand `isUserComponent` option

Is your feature request related to a problem? Please describe.
ComponentCommand doesn't have a configurable option to determine if a component is meant for the user who initiated it, or available globally to everyone

Describe the solution you'd like
Add a configurable option to allow this functionality.

Describe alternatives you've considered

Additional context

/**
 * @typedef {BaseConfig} ComponentCommandConfig
 * @property {boolean} [isUserComponent = true] If true, the component is only available to the user who initiated it. If false, everyone can interact with the component
 */

/**
 * @extends {CommandBase}
 */
class ComponentCommand extends CommandBase {
  constructor (config) {
    super(config);
    /**
     * @property {boolean} global If true, the component is only available to the user who initiated it. If false, everyone can interact with the component
     */
    this.isUserComponent = 'isUserComponent' in config ? config.isUserComponent : true;
  }
}

And in interactionCreate.js:

// Check if the Component Command is meant for the member initiating it
  if (
    ( interaction.isButton()
    || interaction.isStringSelectMenu()
    || interaction.isMessageComponent() )
    && clientCmd.isUserComponent === true
  ) {
    const componentIsForMember = hasAccessToComponentCommand(interaction);
    if (!componentIsForMember) {
      interaction.reply({
        content: `${emojis.error} ${member}, this message component isn't meant for you.`,
        ephemeral: true
      });
      return;
    }
  }

command cooldown types

Available types: member, channel, guild

apply throttleCommand() depending on cooldown type
default type: member (adjust in default command Class)
adjust the throttleCommand() call in src/listeners/interaction/applicationCommandInteraction.js:86
by assigning a unique identifier string and passing that as a parameter instead

[BUG] - CommandBase extension parameters

Describe the bug
IntelliSense autocomplete support isn't offered for the

@param {BaseConfig | APICommandConfig} config The full command configuration

parameter configuration,

To Reproduce
Open up VSCode, call new ChatInputCommand({ <<CURSOR HERE>> }) and press ctrl+space, APICommandConfig options are NOT displayed

Expected behavior
APICommandConfig parameters are displayed alongside BaseConfig parameters

Screenshots
For example, global is missing from autocomplete options
Code_9Bk33zn644

Desktop (please complete the following information):

  • OS: Win11
  • Browser: n/a
  • Version: latest

Additional context
n/a

Live demo

Host a live demo in the support server and invite users to come try it themselves

Support Context Menu's in the /help command

Is your feature request related to a problem? Please describe.
No information can currently be displayed for Context Menu commands.

Describe the solution you'd like
Include Context Menu commands in the /help information output. Having a description might also be included, have the normal description property in the Command data object, but remove that field when sending Interaction Command API data and include it in the /help command output

Describe alternatives you've considered
None

Additional context
n/a

[BUG] - Auto complete limited to 1 entry per command

Describe the bug
With the current implementation, a command can only have 1 auto complete enabled option

To Reproduce
Create a command with 2 auto-complete options and see them both do the same thing instead of their own dedicated handler

Expected behavior
Separate functionality for multiple auto complete options

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
in autoCompleteInteraction.js, autoCompleteQueryHandler should be defined by the option name, not the command name

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.