import discord
from discord.ext import commands
intents = discord.Intents.all()
bot = commands.Bot(command_prefix=config.prefix,intents = intents)
# You can find Intents in Bot entries on the discord developer site.
# change someone's nickname when a user joins the server
@commands.Cog.listener()
async def on_member_join(self, member):
await member.edit(nick="nickname here")
如果你用的是齿轮
机器人可以检测到新成员何时加入带有^{} event reference 的公会。然后,您可以使用^{} 获取成员的昵称,您可以使用^{} 更改成员的昵称,并传递
nick=
关键字参数如果成员的原始昵称是昵称,则他们的新昵称将是[TAG]昵称
相关问题 更多 >
编程相关推荐