Python Discord.py不响应word命令
当我运行它时,它没有错误,并且状态更改后台任务正在运行,但是word命令不起作用。怎么解决呢?? 当我重新生成令牌时,问题就开始了Python Discord.py不响应word命令,python,discord.py,Python,Discord.py,当我运行它时,它没有错误,并且状态更改后台任务正在运行,但是word命令不起作用。怎么解决呢?? 当我重新生成令牌时,问题就开始了 import discord, random from discord.ext import commands, tasks from itertools import cycle client = commands.Bot(command_prefix="!") word_commands = [ "we love yo
import discord, random
from discord.ext import commands, tasks
from itertools import cycle
client = commands.Bot(command_prefix="!")
word_commands = [
"we love you metallic",
"daddy metallic!!!!",
"metallic are you my dad",
"metallic you are a fine species of a man!!!!",
"everyone likes you metallic"
]
status = cycle(['your mom', 'your sister', "your grandma", "your step sis"])
@tasks.loop(seconds=3)
async def change_status():
await client.change_presence(activity=discord.Game(next(status)))
@client.event
async def on_ready():
change_status.start()
print("i am ready daddy metallic")
@client.command()
async def daddy_metallic(meta):
await meta.send(random.choice(word_commands))
@client.command()
async def ping(ctx):
await ctx.send(f'pong!Your latency is {round(client.latency*1000)}ms')
print("sent")
@client.command()
async def eightball(ctx, *, question):
responses = [
"it is certain",
"It is decidedly so",
"without a doubt",
"Yes - definitely",
"you may rely on it",
"As i see it, yes",
"Most likely",
"signs point to yes",
"replay hazy , try again",
"Ask again later",
"better not tell you now",
"cannot predict now",
"concentrate and ask again",
"don't count on it",
'my reply is no',
"my source say no",
"very doubtful"
]
await ctx.send(f'question: {question}\nAnswer: {random.choice(responses)}')
@client.command()
async def clear(ctx, amount=10):
await ctx.channel.purge(limit=amount)
@client.command()
async def selfie(ctx):
await ctx.send("https://imgur.com/a/C66kzi8")
client.run("token")
我的代码有问题吗?还是需要从discord开发者门户更改任何内容
如您所见,状态更改的后台任务正在运行,但word命令不起作用您将前缀设置为
,但您正试图使用
作为前缀。新建令牌
无法更改代码的工作方式-如果您仅在代码中不使用旧的令牌
。复制所有代码并对其进行测试后,我无法重现该问题。更新令牌后是否重新启动了bot?代码适用于我的令牌。您是否在运行(…)
中使用了新令牌?是的,我使用了新令牌,并且bot运行时没有出现错误,现在我认为这是discord developer门户中阻止word命令的权限问题