[英]how can I get current guild ID in on_member_join
I'm making bot that will be on 3~4 servers,我正在制作将在 3~4 台服务器上的机器人,
and I was working on welcome messages.我正在处理欢迎信息。
I saw this post: Discord.py welcome message for multiple servers and doing that way but there were some errors, I'm doing my way.我看到了这篇文章: Discord.py 欢迎消息,用于多台服务器并这样做,但有一些错误,我正在做我的方式。
but eventually i stuck to a problem that I can't get guild id in on_member_joined.但最终我遇到了一个问题,我无法在 on_member_joined 中获得公会 ID。
using discord.py 1.4.2使用 discord.py 1.4.2
please help me.请帮我。
any suggestion appreciated.任何建议表示赞赏。
The Member
object has a guild
attribute use that to get the `id. Member
object 有一个guild
属性,用于获取`id。
@bot.event
async def on_member_join(member):
print(member.guild.id)
print(member.guild.name)
Docs:文件:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.