【发布时间】:2021-08-17 22:39:55
【问题描述】:
所以我最近创建了一个新服务器并为它制作了一个自定义机器人,但欢迎消息似乎并没有真正起作用......它也应该为加入的成员赋予特定角色,但我删除了它代码和当前代码仍然不起作用。
遗憾的是,命令提示符没有给出任何错误。我现在不知道该怎么办。
这里是代码-
@commands.Cog.listener()
async def on_member_join(self, member):
#GETTING THE GUILD, CHANNEL AND ROLE
channel = self.client.get_channel(828481599057166356)
name = member.name
#CREATING THE WELCOME EMBED
welcomeem = discord.Embed(title = f"Hey there {member.name}!", description = f"Welcome to {chanenl.guild.name}! Have a fun time here in TigerNinja's server!")
welcomeem.add_field(name="1. Rules", value = f"{name}, before you start having fun here, make sure to check <#752474442650878002> and read all rules as they will come in handy in the server!", inline=False)
welcomeem.add_field(name="2. Self-roles", value = f"{name}, be sure to check out <#776293478594379797> and get all roles you want!", inline=False)
welcomeem.add_field(name="2. Help", value = f"{name}, need help with this bot then type `t.help`. If you need help relating to something else, contact the mods via dms, but don't ping them!!", inline=False)
#SENDING THE PING, EMBDE AND ADDING ROLE
await channel.send(f"Welcome, {member.mention}!")
await channel.send(embed=welcomeem)
(顺便说一句,我正在使用齿轮)
【问题讨论】:
-
你有会员意向吗?
-
是的,我确实启用了所有意图。
标签: python python-3.x discord discord.py