【发布时间】:2022-05-12 03:26:02
【问题描述】:
问题标题定义了问题。我使用以下内容安装了discord.py 模块:
pip install -U git+https://github.com/Rapptz/discord.py
但是,当我尝试运行我的代码时:
import discord
class JoinQueue_Button(discord.ui.View):
@discord.ui.button(label='Join This Game!', style=discord.ButtonStyle.green)
async def queue(self, interaction: discord.Interaction):
current_queue = {}
await interaction.user.id
我收到一条错误消息,提示 ui 模块不存在。我现在不确定该怎么做。
【问题讨论】:
-
您有自己的名为
discord.py的本地文件吗? -
不,我不知道。我需要一个吗?
-
不,事实上你不应该拥有一个。但如果你这样做了,就可以解释这个错误。
-
这对您有帮助吗? Add button components to a message (discord.py)。您要做的是在
v2.0ofdiscord.py -
discord-ui是一个独立于discord的包。
标签: python discord.py