'Discord py error "TypeError: Client.start() got an unexpected keyword argument 'bot'"

I was trying to create a selfbot to enhance my knowledge about discord bots, and am unable to login to the user. I have grabbed my token from discord using inspect element, and still got the same error.

import discord
from discord.ext import commands

bot = commands.Bot(command_prefix='!', self_bot=True)

@bot.command()
async def ping(ctx):
    await ctx.send(f'the ping is {bot.latency * 1000}ms.')

bot.run("my user token", bot=False)

I know that in the error it says Client.start() even though it says client.run in the main script. I have no idea why this appears



Solution 1:[1]

Here's your problem(s):

bot = commands.Bot(command_prefix='!', self_bot=True)
#and
await bot.start(token, bot=False)

^^ thanks to rose for pointing that out ^^

commands.Bot has no parameter self_bot nor does bot.start have a parameter bot

Furthermore you shouldn't log in as a user, not only does discord.py not support it but it is against discord TOS. If you are trying to make a bot read this

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1