我又是第七次了. 我在做一个建议命令.当有人发送他们的建议时,它应该转到另一个渠道.我有一个日志(log)通道ID设置(log_channel_id),建议应该转到该通道.
代码:
class View(discord.ui.View):
def __init__(self):
super().__init__()
@discord.ui.button(label='Confirm', style=discord.ButtonStyle.green)
async def asdf(self, interaction: discord.Interaction, button: discord.ui.Button):
await interaction.response.edit_message(content="Your suggestion has been sent successfully.",embed=None,view=None)
# the suggestion should be sent to another channel, i already have a channel ID set for it (log_channel_id)
@bot.tree.command(name="suggest", description="Make a suggestion with this command.")
async def hello(interaction: discord.Interaction, title: str, description: str):
if interaction.user.id in blacklist:
embed = discord.Embed(title=f"Unable to execute command.\nReason: blacklisted", color=discord.Color.red())
await interaction.response.send_message(embed=embed, ephemeral=True)
else:
embed = discord.Embed(title=f"Is this information correct?", description=f"sdfsdfsdfsd", color=discord.Colour.random())
embed.set_thumbnail(url=f"{interaction.user.avatar.url}")
embed.add_field(name=f"Title", value=f"{title}", inline=False)
embed.add_field(name="Description", value=f"{description}")
embed.set_footer(text=f"USER ID: {interaction.user.id}")
await interaction.response.send_message(embed=embed, view=View(), ephemeral=True)
有没有人有办法得到用户设置为日志(log)ID的建议?谢谢:)