简体   繁体   English

Discord.py 如何使我的机器人具有自定义状态

[英]Discord.py How do I make my bot have a custom status

I am new to discord.py, and I am wondering how to give my bot a custom status as I've seen other discord bots have custom status我是 discord.py 的新手,我想知道如何为我的机器人提供自定义状态,因为我已经看到其他 discord 机器人具有自定义状态

This is quite easy with the Client.change_presence method.使用Client.change_presence方法很容易做到这一点。

Bot = commands.Bot(command_prefix=PREFIX, intents=intents, case_insensitive=True)  # initialize the bot

@Bot.event
async def on_ready():
    await Bot.change_presence(status=discord.Status.online,
                                   activity=discord.Activity(name=f"Activity", type=discord.ActivityType.listening))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM