question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Revert some changes of #8027

See original GitHub issue

Which package is this bug report for?

discord.js

Issue description

Some changes were done #8027 witch are not profitable for Djs :

  1. The method <Interaction>.isModalSubmit() has been removed, we can’t filter anymore to redirect Modal submits interactions. (looks like a error) image
  2. Global types check like <Interaction>.isMessageComponent() and <Interaction>.isCommand() has been removed too, thoose two functions are practical and necessary because in most of the cases chat inputs and context menu commands are managed in a same class, the logic of the 3 types of commands are similar enough. image

Hi @suneettipirneni, is there a way that I wouldn’t have seen who would justify these changes?

Package version

discord.js@14.0.0-dev.1654949087-96053ba

Priority this issue should have

High (immediate attention needed)

I have tested this issue on a development release

96053ba

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
suneettipirnenicommented, Jun 12, 2022

There can be a discussion but I’d rather it be in a GitHub discussion or another issue ticket. Since this current issue ticket is created as a bug report, but it’s currently intended functionality.

1reaction
DraftProductscommented, Jun 11, 2022

I understand that it’s optional or even considered a shortcut @suneettipirneni, but we have plenty of shortcuts everywhere in Djs and in terms of DX, it’s a good thing and keeps the code clean, having methods for some advanced checks and not having them for simple ones seems to me to be a change that doesn’t add anything to Djs. I don’t see why it would be annoying to leave them.

Here is an example where it would not be aesthetic at all, if I only deal with slash-commands and modals, it is impossible to keep a uniform code:

client.on('interactionCreate', (interaction) => {
  if (interaction.type === InteractionType.ModalSubmit) {
    // return this.functionToHandleModals(interaction);
  }
  
  if (interaction.isChatInputCommand()) {
    // return this.functionToHandleSlashCommands(interaction);
  }
})
Read more comments on GitHub >

github_iconTop Results From Across the Web

Git Revert | Atlassian Git Tutorial
Learn how to use Git revert to undo changes in git. ... The git revert command is used for undoing changes to a...
Read more >
How to revert a Git commit: A simple example | TheServerSide
In this quick git revert example, we'll show you how to revert a Git commit and undo unwanted changes.
Read more >
Git Revert Explained: Safely Undoing Your Changes
Git revert undoes changes in a project commit history without tampering with it. When reverting, this operation takes the specific commit, ...
Read more >
git-revert Documentation - Git
Revert the changes specified by the fourth last commit in HEAD and create a new commit with the reverted changes. Revert the changes...
Read more >
Revert changes - GitLab Docs
In the top right corner, select Options, then select Revert. In Revert in branch, select the branch to revert your changes into. Optional....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found