diff --git a/discord_bot.py b/discord_bot.py index f8da974..74910d9 100644 --- a/discord_bot.py +++ b/discord_bot.py @@ -96,6 +96,16 @@ async def deactivate_friend(ctx, steam_id): else: await ctx.respond(content=f'找不到 {steam_id}') +@bot.command(description='启用朋友', name='activate_friend') +async def activate_friend(ctx, steam_id): + logger.info(f'activate_friend {steam_id}') + friend = dota.Friend.get_or_none(steam_id=steam_id) + if friend: + friend.active = True + friend.save() + await ctx.respond(content=f'启用成功 {steam_id}') + else: + await ctx.respond(content=f'找不到 {steam_id}') @tasks.loop(minutes=1) async def heartbeat():