Discord – die besten Beiträge

Python discord NonType Error?

Ich habe einen Error in meinem Code:

async def on_submit(self, interaction2: discord.Interaction):
    response = await sendRequests(str(self.username), str(self.email), str(self.password))
    if response == "email":
        await interaction2.response.send_message("Incorrect email format", ephemeral=True)
        return
    if response == "password":
        await interaction2.response.send_message("Incorrect password format. The password must meet these requirements: \nOne Uppercase letter \nOne lowercase letter \nOne number\n A special character ", ephemeral=True)
        return
    if response == "maintenance":
        await interaction2.response.send_message("The system is currently under maintenance. Please look in #news for more infos.", ephemeral=True)
    query = "INSERT INTO users VALUES (?, ?, ?, ?)"
    main.cursor.execute(query, (interaction2.user.id, str(self.username), str(self.email), str(self.password)))
    main.database.commit()
    await interaction2.response.send_message("You are now in the registration process. This can take up to one hour.", ephemeral=True)
    channel = main.bot.get_channel(1309925591146958933)
    await channel.send("make a recaptcha, registration from user : " + str(interaction2.user.name) + " with id: " + str(interaction2.user.id))

Error:
[2024-11-23 19:32:43] [ERROR  ] discord.ui.modal: Ignoring exception in modal <RegisterModal timeout=None children=3>:

Traceback (most recent call last):

 File ".venv\Lib\site-packages\discord\ui\modal.py", line 189, in _scheduled_task

   await self.on_submit(interaction)

 File "TestButton.py", line 41, in on_submit

   await channel.send("make a recaptcha, registration from user : " + str(interaction2.user.name) + " with id: " + str(interaction2.user.id))

         ^^^^^^^^^^^^

AttributeError: 'NoneType' object has no attribute 'send'

Bot, Code, Programmiersprache, Python, Webentwicklung, Python 3, Pycharm, Discord, Discord Bot

Capmonster integration in Python Script?

Guten Tag,

seit einigen Tagen versuche ich den captcha solver capmonster in mein Python Script, welches ein Discord Token Joiner ist, zu integrieren. Jedoch bekomme ich es nicht hin.

Wäre nett wenn mir jemand dabei helfen könnte.

from util import *

def send(invite, token):
  session = Client.get_session(token)
  result = session.post(f"https://discord.com/api/v9/invites/{invite}", json={"session_id": utility.rand_str(32)})
  if result.status_code == 200:
    Output("good", token).log(f"Joined {Fore.LIGHTBLACK_EX}{invite} {Fore.GREEN}-> {token} {Fore.LIGHTBLACK_EX}({result.status_code})")
  else:
    Output.error_logger(token, result.text, result.status_code)

def token_joiner():
  Output.set_title(f"Token Joiner")
   
  # Get the invite code from the user
  invite = input("Enter the invite link (without 'https://discord.gg/'): ").strip()
  invite = invite.split("/")[-1]
   
  # Get the number of threads
  max_threads = int(input("Enter the number of threads: ").strip())
   
  # Get the server name (if available)
  server_name = utility.get_server_name(invite)
  if server_name is not None:
    Output("info").notime(f"Joining {Fore.RED}{server_name}")
   
  # Run the threads
  utility.run_threads(max_threads=max_threads, func=send, args=[invite])
   
  # Wait for user to press Enter before closing the script
  input("\nPress Enter to exit the script...")

if __name__ == "__main__":
  token_joiner()
Python, captcha, Discord

Meistgelesene Beiträge zum Thema Discord