繁体   English   中英

Discord.py 不响应字命令

[英]Discord.py not responding to word commands

当我运行它时,它没有错误,并且雕像更改后台任务正在运行,但是单词命令不起作用。 怎么解决?? 当我重新生成令牌时问题开始了

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命令不起作用

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM