selfbot.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:discord_selfbot 作者: silentreaper 项目源码 文件源码
def setstatus(ctx, *, status : str = None):
    """Sets status to passed in status; defaults to 'online'"""
    if status is None:
        bot.status = discord.Status.online
    elif status == "online":
        bot.status = discord.Status.online
    elif status == "idle":
        bot.status = discord.Status.idle
    elif status == "offline" or status == "invisible":
        bot.status = discord.Status.invisible
    elif status == "do_not_disturb" or status == "dnd" or status == "do not disturb":
        bot.status = discord.Status.dnd
    else:
        print("Unknown status named \"{}\"\nStatus change cancelled.".format(status))
        await bot.say(embed=discord.Embed(title="Status", type="rich", timestamp=datetime.utcnow(), colour=0xFF0000, description="Unknown status \"{}\"\nStatus change cancelled.".format(status)))
        return

    print("Setting status to \"{}\"".format(bot.status))
    await bot.say(embed=discord.Embed(title="Status", type="rich", timestamp=datetime.utcnow(), colour=get_status_color(), description="Current status set to {}".format(bot.status)))
    await bot.change_presence(game=discord.Game(name=bot.game_name), status=bot.status)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号