Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selfbot self.button(click) wont work on large server. #631

Open
3 tasks done
loxlet opened this issue Dec 17, 2023 · 2 comments
Open
3 tasks done

Selfbot self.button(click) wont work on large server. #631

loxlet opened this issue Dec 17, 2023 · 2 comments
Labels
unconfirmed bug Unconfirmed bug

Comments

@loxlet
Copy link

loxlet commented Dec 17, 2023

Summary

self.button(click) wont work on large server, but work flawlessly on small server

Reproduction Steps

run selfbot , button self click works on small server but 400 bad request on larger sever.

Code

if isbutton(cid):
# dprint(f"{Fore.LIGHTRED_EX}Button Data: {buttons[0]}")
   await self.wait_for("message_edit", check=mcheck)
   await self.buttons[0].click()
   await self.afterclick()

Expected Results

the button clicked

Actual Results

[2023-12-18 02:49:02] [ERROR ] discord.client: Ignoring exception in on_message
Traceback (most recent call last):
File "C:\Users\Dhinotea\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\client.py", line 600, in _run_event
await coro(*args, **kwargs)
File "C:\abc\main.py", line 223, in on_message
await self.buttons[1].click()
File "C:\Users\Dhinotea\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\components.py", line 243, in click
return await _wrapped_interaction(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Dhinotea\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\interactions.py", line 203, in _wrapped_interaction
await state.http.interact(type, data, channel, nonce=nonce, **kwargs)
File "C:\Users\Dhinotea\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\http.py", line 930, in request
raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In data: Component validation failed

System Information

  • Python v3.11.3-final
  • discord.py-self v2.1.0-alpha
  • discord.py-self metadata: v2.1.0a0
  • aiohttp v3.8.5
  • system info: Windows 10 10.0.19045

Checklist

  • I have searched the open issues for duplicates.
  • I have shared the entire traceback.
  • I am using a user token (and it isn't visible in the code).

Additional Information

sometimes it works on large server, like 1 out of 1000 times. but on small server it works every single time.

@loxlet loxlet added the unconfirmed bug Unconfirmed bug label Dec 17, 2023
@FrostX-Official
Copy link

+1, having the same issue with UnbelievaBoat buttons on a huge server

@astolfoismywaifu
Copy link

@FrostX-Official Hes referring to my project here and for me it was an issue with my code or maybe just the way discord works but I pretty much had to add a check to see if the buttons were disabled.

def mcheck(before, after):
    if before.id == message.id and not after.components[0].children[0].disabled:
        self.buttons = after.components[0].children
        return True
    else:
        return False
await self.wait_for("message_edit", check=mcheck)
await self.buttons[0].click()

After adding not after.components[0].children[0].disabled it works just fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unconfirmed bug Unconfirmed bug
Projects
None yet
Development

No branches or pull requests

3 participants