【问题标题】:Discord.py error AttributeError: 'Client' object has no attribute 'command'Discord.py 错误 AttributeError: \'Client\' object has no attribute \'command\'
【发布时间】:2022-12-03 17:32:53
【问题描述】:

why it no work `

#Importing stuff
import discord
import os
import random
from discord.ext import commands

#Variables
command_prefix = \'!\'
intents = discord.Intents.all()
token = \'MTAzOTA3ODMyODcxMzM1NTMwNA.GMKlpL.gLzQ9H6UCaAE7PNeb0Nv-I2cb-e8p-NgZZJydY\'


#Client Setup
bot = discord.Client(command_prefix=command_prefix, intents=intents)


#On ready function (startup)
@bot.event
async def on_ready():
    print(\'Online\')
    #Status Setup
    activity = discord.Game(name=\"Put Status Here\", type=3)
    await bot.change_presence(activity=activity)


@bot.command()
async def help(ctx):
    await ctx.send(\'baller\')


#Run
bot.run(token)

`

i tried a bunch of other stuff but it no worky pls help me

Error: AttributeError: \'Client\' object has no attribute \'command\'

    标签: discord.py


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 2019-05-28
    • 2022-11-11
    • 2022-12-01
    • 2018-03-12
    • 2021-05-24
    • 2014-12-20
    • 2021-11-08
    • 1970-01-01
    相关资源
    最近更新 更多