You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

discord.py中ping命令失效求助,附机器人配置及命令代码

问题描述

我知道这个问题已经被解决过无数次了,但现有的答案都无法帮到我。

机器人配置代码

import discord
from discord.ext import commands
    
bot = commands.Bot(intents=discord.Intents.all(), command_prefix="-", description="A simply well made bot...")

Ping命令代码

@bot.command()
async def ping(ctx):
    await ctx.send(f'Pong! In {round(bot.latency * 1000)}ms')

内容的提问来源于stack exchange,提问作者user18887950

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.19 15:00:52