【发布时间】:2021-09-27 00:50:01
【问题描述】:
我正在使用我的机器人创建一个命令,该命令使机器人创建一个频道,我希望它在新创建的频道上发送消息,但我还没有找到任何方法让它在没有频道的情况下发送消息身份证。
假设我第一条消息应该在命令开始的通道上,但第二条消息应该在机器人创建的通道上,这不会发生,我不能给它一个 id 因为它创建通道。提前致谢。
我从命令中得到的是这样的:
async def avengers(ctx):
guild = ctx.message.guild
embed = discord.Embed(title='¿Listos?', color=discord.Color.purple())
await ctx.send(embed=embed)
await guild.create_text_channel('『????』chat-anticristiano')
for channel in ctx.guild.channels:
if str(channel) == '『????』chat-anticristiano':
channel = '『????』chat-anticristiano'
for channel in ctx.guild.channels:
await ctx.channel.send('Ready!')
【问题讨论】:
标签: python visual-studio-code discord discord.py