feat(discord_bot): Add active flag to friend creation

This commit is contained in:
Ching 2024-02-08 16:31:37 +08:00
parent 30403d02c0
commit 74eec18240
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
{ {
"conventionalCommits.scopes": [ "conventionalCommits.scopes": [
"models" "models",
"discord_bot"
] ]
} }

View File

@ -82,7 +82,7 @@ async def add_friend(ctx, steam_id, name):
if friend: if friend:
await ctx.respond(content=f'已经存在 {steam_id} {name}') await ctx.respond(content=f'已经存在 {steam_id} {name}')
else: else:
friend = dota.Friend.create(steam_id=steam_id, name=name) friend = dota.Friend.create(steam_id=steam_id, name=name, active=True)
await ctx.respond(content=f'添加成功 {steam_id} {name}') await ctx.respond(content=f'添加成功 {steam_id} {name}')
@bot.command(description='禁用朋友', name='deactivate_friend') @bot.command(description='禁用朋友', name='deactivate_friend')