我想知道是否可以在coord中使用@ bot.event for discord.py.我试过了
@self.bot.event
async def on_member_join(self, ctx, member):
channel = discord.utils.get(member.guild.channels, name='general')
await channel.send("hello")
Run Code Online (Sandbox Code Playgroud)
在我的cog类中,但是我得到了错误
NameError: name 'self' is not defined
Run Code Online (Sandbox Code Playgroud)
即使我在__init __中定义了self.bot.
在齿轮中做bot.event有不同的方式,还是不可能?