import interactions
from interactions import listen, Extension, events, Guild, Embed, Button, ButtonStyle, StringSelectMenu, component_callback, ComponentContext
from interactions import StringSelectOption
from interactions.api.events import Component
from resources.firebase import firebaseLib
from resources.verify_methods.rover import RoVer
from resources.verify_methods.bloxlink import Bloxlink
from resources.role import PermissionCog
class VerifyButton(Extension):
def __init__(self, client: interactions.Client):
self.client = client
self.selection = StringSelectMenu(
StringSelectOption(
label="Roblox OAuth",
value= "Roblox OAuth",
description="Verify your Roblox Account with Roblox OAuth",
# emoji=self.client.get_custom_emoji(1137546094486765598)
),
StringSelectOption(
label="Bloxlink",
value= "Bloxlink",
description="Verify your Roblox Account with Bloxlink",
# emoji=self.client.get_custom_emoji(1137545583331115090)
),
custom_id="verify_select",
placeholder="Choose Verification Method",
min_values=1,
max_values=1,
)
@listen()
async def on_ready(self):
# code was too long
await channel.send(embeds=embed, components=self.selection)
@component_callback("verify_select")
async def my_callback(self, ctx: ComponentContext):
await ctx.defer(ephemeral=True)
def setup(client):
VerifyButton(client)
#component_callback("verify_select") is not responding
1 messages · Page 1 of 1 (latest)
Hey! Once your issue is solved, press the button below to close this thread!
latest version
Pastebin
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.
latest version broke my code, worked on other versions
i'll look at it
component callback could have broke
yep, definitely a bug
man this whole thing is messed up
oh lovely
oh dear
@regal briar the nightmare isnt over yet
i can only solve this fully by using nonlocal but i know you all would scream at me
there is a partial solution i could do without using it
and it would solve it for most cases
but component_callback has been broken for a while, it seems
it broke this update
nah, its been broken, just not in a way most people saw
its been working for me
the _unpack_helper stuff? doesnt actually do its job outside of the validator
the inner wrapper function never receives the list it makes
it receives the raw tuple instead
I see
yeah im so sorry but im going to pr a patch that uses nonlocal
Yeah, go for it. Just leave a comment saying it's tech debt
We can fix it the right way later
wait i may be able to hack this together
i'll experiment a little
omg the solution was really this simple
pring
❤️
i hate how simple #1523 is and you will too
• Pull Request Type: Bugfix
• Created: <t:1691518322:R>
Description
component_callback and modal_callback was always using the function name after the last patch due to some weirdness. This PR fixes that by simplifying the patch and... fixing parts of the patch itself, funny enough.
Frankly, I'm disappointed in myself how easy this fix was 😅.
Changes
- Pass in
custom_idto the unpack helper/validator, not the emptyresolved_custom_id. - Removed the unused (other than for the mistake above)
resolved_custom_idinitial declaration - I think we all forgot thatresolved_custom_iddoes not get passed into there without anonlocal. No idea howcustom_iddoes in this specific case, but it does.- Yes, this patch makes the code very similar to the code before the first patch. However, since the variable name inside the wrapper function is different from just
custom_id, everything works now (for some reason).
- Yes, this patch makes the code very similar to the code before the first patch. However, since the variable name inside the wrapper function is different from just
Related Issues
N/A
Test Scenarios
[CODEBLOCK]
Python Compatibility
- ❌ I've ensured my code works on Python
3.10.x - ✅ I've ensured my code works on Python
3.11.x
Checklist
- ✅ I've run the
pre-commitcode linter over all edited files - ✅ I've tested my changes on supported Python versions
- ❌ I've added tests for my code, if applicable
- ❌ I've updated / added documentation, where applicable
the only thing we did wrong initially was the name lmao
are you telling me python actually cares about redefinitions but not usages for scopes
...fuck it, python moment
damn im pretty sure i caused this because of my feature request lmao
well good its fixed now
It's pretty common.
var = 1
var2 = 2
def scope():
print(var) # undefined
print(var2) # 2
var = "this name is now a function local"
yup
own up to it
say you helped identify critical bugs in a large open source project in your resume
/j

So, am I merging and dropping 5.9.2?
i would do it
@stoic rivet is gonna reinstall discord again 😛
one more review is needed
mans gonna reinstall the moment he sees a new 5.9.1 release anyhow
either semver angarery or release angery
Nah, he was expecting 5.9.1
can u pls review
pls
discord-py-interactions is showing correct stuff
fixed
how do i get a partialemoji to set the emoji for a StringSelectMenu
spin a new post for that