dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
683 stars 162 forks source link

Error while sending a message to user because of captcha #269

Closed Szymon-Kasprzycki closed 2 years ago

Szymon-Kasprzycki commented 2 years ago

Summary

selfbot

Reproduction Steps

when selfbot tries to send a message to user-based object, it throws '400 Bad Request (error code: 0)'

Code

class SelfBot(discord.Client):
    def __init__(self, token: str, connector):
        super().__init__()
        self.token = token
        self.connector = connector
        self.success = 0
        self.fail = 0
        self.work_status = True

    def get_id(self):
        return self.user.id

    async def send_to_user(self, user_id: int, message: str, file: str = None):
        try:
            user = await self.fetch_user(user_id=user_id)
            if file:
                await user.send(message, file=discord.File(file))
            else:
                await user.send(message)
            self.success += 1
        except Exception as e:
            self.fail += 1
            print(e)
            if self.fail > 100:
                self.work_status = False

Expected Results

Message sended

Actual Results

Throwing error because of hCaptcha verification

System Information

Checklist

Additional Information

No response

dolfies commented 2 years ago

You need to solve a captcha to dm people now??? That doesn't sound right...

Szymon-Kasprzycki commented 2 years ago

You need to solve a captcha to dm people now??? That doesn't sound right...

Yes, I got info about that also from few other people. image

Szymon-Kasprzycki commented 2 years ago

https://user-images.githubusercontent.com/66119938/161314518-a48ec563-483d-4568-aa97-7406e60902fa.mp4

Szymon-Kasprzycki commented 2 years ago

image

dolfies commented 2 years ago

Captcha-handling is commited.

Szymon-Kasprzycki commented 2 years ago

Hey, I've tested it and its throwing error now on bot login. Here is the traceback: image

dolfies commented 2 years ago

Fixed.

mrcrien commented 2 years ago

it was working good, but now i got this error

image
dolfies commented 2 years ago

Please share the full traceback.

mrcrien commented 2 years ago
Ekran Resmi 2022-05-22 18 58 34