feat(models): Add activate_friend command to enable friends
This commit is contained in:
parent
309b4989e7
commit
30403d02c0
@ -96,6 +96,16 @@ async def deactivate_friend(ctx, steam_id):
|
|||||||
else:
|
else:
|
||||||
await ctx.respond(content=f'找不到 {steam_id}')
|
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)
|
@tasks.loop(minutes=1)
|
||||||
async def heartbeat():
|
async def heartbeat():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user