小编Leg*_*ing的帖子

回复留言discord.py

我想让我的机器人在用户输入某个句子时对用户消息做出反应。

我的回复代码:

await ctx.message.reply("I just replied to you")
Run Code Online (Sandbox Code Playgroud)

我收到错误:

ctx.message has no attribute "reply"
Run Code Online (Sandbox Code Playgroud)

我可以做什么代码让机器人回复消息?

当我说回复时,我的意思与用户可以按消息回复相同

python discord

4
推荐指数
1
解决办法
1万
查看次数

如何让机器人加入语音频道 discord.py

我正在使用 discord.py 创建音乐机器人,但我无法将机器人连接到语音通道。我使用 Cog 将音乐功能与其他功能区分开来。

@commands.command()
async def join_voice(self, ctx):
    channel = ctx.author.voice.channel
    print(channel.id)
    await self.client.VoiceChannel.connect()
Run Code Online (Sandbox Code Playgroud)

但我收到错误: AttributeError: 'NoneType' object has no attribute 'channel'

我已经浏览了所有文档和此处的所有类似问题,但仍然没有解决方案!

有人可以帮忙吗?

python python-3.x discord.py discord.py-rewrite

3
推荐指数
1
解决办法
9129
查看次数