[Python] Python Discord Bot TypeError: __init__() takes 1 positional argument but 2 positional...

Discussão em 'Python' iniciado por Stack, Junho 20, 2025.

  1. Stack

    Stack Membro Participativo

    I have a Python Discord Bot that uses both slash commands and a the on_message event with a $ prefix. As of recently, it started showing a TypeError:

    Traceback (most recent call last):
    File "", line 25, in <module>
    bot = discord.Client(interactions.Client(token=""),command_prefix='$' , intents=intents,)
    TypeError: __init__() takes 1 positional argument but 2 positional arguments (and 1 keyword-only argument) were given


    I'm very stumped over this, I removed the file path and token from the error message to protect privacy.

    print("starting... ")

    import requests
    import discord
    from discord.ext.commands import Bot
    from discord.ext import commands
    from discord import app_commands
    import discord.ext.tasks
    import python_weather
    import asyncio
    from datetime import datetime
    import random
    import math
    import subprocess
    import time
    import interactions
    import os



    print("imports sucessful")

    now = datetime.now()
    intents = discord.Intents.all()
    bot = discord.Client(interactions.Client(token=""),command_prefix='$' , intents=intents,)

    Continue reading...

Compartilhe esta Página