Giter Site home page Giter Site logo

Custom_Id in interaction about nextcord HOT 6 CLOSED

lordcod avatar lordcod commented on June 4, 2024
Custom_Id in interaction

from nextcord.

Comments (6)

spifory avatar spifory commented on June 4, 2024

There doesn't seem to be a custom_id documented under Interaction/Interaction data under Discord's documentation.
I could only find an id that existed under Interaction, and a custom_id under components (modals, buttons, ...), which already exist in nextcord

from nextcord.

lordcod avatar lordcod commented on June 4, 2024

There doesn't seem to be a custom_id documented under Interaction/Interaction data under Discord's documentation. I could only find an id that existed under Interaction, and a custom_id under components (modals, buttons, ...), which already exist in nextcord

there is interaction.data there is a dict issued in which there is a custom_id

from nextcord.

Soheab avatar Soheab commented on June 4, 2024

I don't see why this is needed and you didn't provide any use case either.

custom_id is an attribute on all subclasses of Item so it should already be accessible?
If this is for the on_interaction event then we don't really recommend using that over the callbacks.

from nextcord.

lordcod avatar lordcod commented on June 4, 2024

I don't see why this is needed and you didn't provide any use case either.

custom_id is an attribute on all subclasses of Item so it should already be accessible? If this is for the on_interaction event then we don't really recommend using that over the callbacks.

this parameter can be added to button, dropdown exactly and in on_interaction to find out the custom_id and use, for example, for inactive interaction

from nextcord.

Soheab avatar Soheab commented on June 4, 2024

this parameter can be added to button, dropdown exactly and in on_interaction to find out the custom_id and use, for example, for inactive interaction

Thought so. The library provides something called "Persistent View" for that case. As I said, we don't recommend using the event, there is even a warning on the docs about it.
good-file-name.jpg

Having said that.. our (NC maintainers) stance on that may change for v3 since the warning and all are from discord.py 🤷

from nextcord.

EmreTech avatar EmreTech commented on June 4, 2024

Since all view items include a custom_id attribute already, there's no use in having a custom_id attribute in the interaction class. If you absolutely need it from the interaction object for some reason, you can get it from Interaction.data.

from nextcord.

Related Issues (20)

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.