#button disable issue

1 messages · Page 1 of 1 (latest)

hot atlas
#

theres no error after this, but why wouldnt this work even in the first place?

@bot.slash_command()
async def gametimet(ctx):

    button1 = Button(label="Accept", style=discord.ButtonStyle.green)

    async def button_callback(interaction):
        button1.disabled = True

    button1.callback = button_callback
    
    view = View()
    view.add_item(button1)

    await ctx.respond('hi', view=view)
quick patrol
#

so do interaction.response.edit_message(view=view)

#

you would need to define view = View() before defining the button

#

also, i highly recommend subclassing view rather than using buttons like so

hot atlas
#

thanks

fleet rapids
#

.close

kindred windBOT
#

Done with your help thread?

Please close your own help thread by using </close:1009144375709814897> with @dreamy pebble.

dreamy pebbleBOT
#

This thread was archived by the user that opened it.