我想让我的机器人在用户输入某个句子时对用户消息做出反应。
我的回复代码:
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)
我可以做什么代码让机器人回复消息?
当我说回复时,我的意思与用户可以按消息回复相同
我正在使用 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'
我已经浏览了所有文档和此处的所有类似问题,但仍然没有解决方案!
有人可以帮忙吗?