首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >NextCord.py没有回应

NextCord.py没有回应
EN

Stack Overflow用户
提问于 2022-06-08 07:41:33
回答 1查看 107关注 0票数 -1

*编辑:我试着让它成为ctx.send。它不起作用。

我是一个新的Python开发人员。我使用Discord.py已经有一段时间了。我听说了NextCord并决定使用它。

还:我确保正确设置了意图。代码不会给我一个错误。只是没有反应!

代码语言:javascript
复制
import nextcord
from nextcord.ext import commands
from termcolor import colored
import os
os.system('color')

logo = """
█┼┼ ███ ███- ███ ███ ███ ██▄
█┼┼ █▄┼ █┼█- █┼┼ █┼█ █▄┼ █┼█
█▄█ █▄▄ █▄█- ███ █▄█ █┼█ ███
"""

print(colored(logo, "green"))
print(colored("Lam Bot coded by LeoDev only!", "green"))

TOKEN = 'token'

bot = commands.Bot(command_prefix='$')

@bot.event
async def on_ready():
    print(colored("Bot Ready!","green"))

@bot.command()
async def ping(ctx):
    await ctx.send('Pong!')

bot.run(TOKEN)

当我在服务器中发送"$ping“时,它根本没有响应。没有错误。就是什么都没有!

EN

回答 1

Stack Overflow用户

发布于 2022-06-09 14:22:37

替换你的

代码语言:javascript
复制
bot = commands.Bot(command_prefix='$')

代码语言:javascript
复制
intents = nextcord.Intents.default()
intents.message_content = True
bot=commands.Bot(command_prefix="$",intents=intents)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72541814

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档