#Help passing arguments into button callbacks
1 messages · Page 1 of 1 (latest)
I probably should
have used pastebin
but I just get
Ignoring exception in view <View timeout=None children=8> for item <Button style=<ButtonStyle.primary: 1> url=None disabled=False label='U1' emoji=None row=0>:
Traceback (most recent call last):
File "/Users/oriontomasi/opt/anaconda3/lib/python3.9/site-packages/disnake/ui/view.py", line 385, in _scheduled_task
await item.callback(interaction)
TypeError: 'coroutine' object is not callable
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
I'm probably doing something really idiotic
please someone help
Yeah that's not going to work
You don't add () when assigning a callback
Otherwise the script tries to call the callback first and assign whatever it returns as its callback
how do I pass arguments through though
You don't
I think you can use custom_id to assign the buttons the upscale value
lemme check
'497d586c-6d31-434c-9de5-054d0631f484'
uuuh
like that long
thats how long it is
how do I make a view subclass, could you point me to the documentation?
Either of the examples in the view folder should suffice
k
Basically make a view. Give it a instance variable that is the code point. Add your 8 buttons using decorators. Reference the self.codepoint during the callback and apply the changes