#button help

1 messages · Page 1 of 1 (latest)

hasty stag
#

button help

#
if ephemeral and view.timeout is None:
                     ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'timeout'
sudden shell
#

Full error

#

And code

hasty stag
crisp roverBOT
hasty stag
#

code

#
Traceback (most recent call last):
  File "C:\Users\w\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\ui\view.py", line 425, in _scheduled_task
    await item.callback(interaction)
  File "C:\Users\w\OneDrive\Desktop\bot\modules\buttons.py", line 50, in lock
    await interaction.response.send_message(embed=e, view=None, ephemeral=True)
  File "C:\Users\w\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\interactions.py", line 779, in send_message
    if ephemeral and view.timeout is None:
                     ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'timeout'

error

#

error

solemn thorn
#

You can't pass the ephemeral kwarg to an edit response

#

You can't switch from ephemeral to non-ephemeral or viceversa

hasty stag
#

editing

#

what do u mean

#

its send_message

#

where do you see edit

solemn thorn
#

I'm fucking blind

#

Sorry lmfao

hasty stag
#

that's okay

#

I need help man

solemn thorn
#

What's your pycord version @hasty stag

#

And can you show me your view's init

candid bay
# hasty stag https://pastebin.com/1GxhRBNa
    async def lock(self, interaction: discord.Interaction, button: discord.ui.Button):```
wrong server, this isn't the pycord structure; chances are you're using discord.py so you should check with them
#

...that being said, you can fix it by removing view=None because in pycord the default view is None while in dpy it defaults to MISSING, and the check there is jank so it breaks if you do view=None