【发布时间】:2021-05-16 08:09:58
【问题描述】:
再次,我的代码没有赶上,我不知道为什么...... 控制台没有显示错误。
这是我的代码:
@bot.event
async def on_member_join(member):
channel = bot.get_channel(792786709350973454)
author = ctx.message.author
ico = author.avatar_url
embed = discord.Embed(
color = discord.Color.red(),
)
embed.set_author(name=(f'• Hello {member} on my server!!'))
embed.add_field(name='Warning,', value='read the regulations!', inline=False)
embed.set_footer(text="dBot created by Diablo#4700", icon_url=ico)
await channel.send(embed=embed)
【问题讨论】:
-
我更正了,但机器人仍然没有向给定频道发送消息,不存在错误。
-
@DiabloStudio 您的机器人是否有权在该特定频道()中发送消息?
-
有权限,还是看不到消息。
-
您确定没有收到任何错误吗?在该 sn-p 的第 7 行末尾有一个逗号,后面没有参数,这应该会引发语法错误。另外,您是否将意图传递给您的 Bot/Client 构造函数?
标签: python-3.x discord discord.py