Skip to content

Commit

Permalink
send notify to waifu when divorce, close #28
Browse files Browse the repository at this point in the history
  • Loading branch information
krau committed Oct 16, 2024
1 parent 353e144 commit 1602453
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion kmua/callbacks/userdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ async def _divorce_ask(update: Update, context: ContextTypes.DEFAULT_TYPE):
)


async def _divorce_confirm(update: Update, _: ContextTypes.DEFAULT_TYPE):
async def _divorce_confirm(update: Update, context: ContextTypes.DEFAULT_TYPE):
db_user = dao.add_user(update.effective_user)
query = update.callback_query
married_waifu = dao.get_user_by_id(db_user.married_waifu_id)
Expand All @@ -270,6 +270,10 @@ async def _divorce_confirm(update: Update, _: ContextTypes.DEFAULT_TYPE):
f"{db_user.full_name}<{db_user.id}> divorced "
+ f"{married_waifu.full_name}<{married_waifu.id}>"
)
await context.bot.send_message(
chat_id=married_waifu.id,
text=f"{db_user.full_name} 和你解除了关系 QAQ...",
)


async def delete_user_quote(update: Update, context: ContextTypes.DEFAULT_TYPE):
Expand Down
2 changes: 1 addition & 1 deletion kmua/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __str__(self):
头像(小尺寸): {True if self.avatar_small_blob else None}
已结婚: {self.is_married}
已结婚的老婆id: {self.married_waifu_id}
是否允许被老婆提及: {self.waifu_mention}
是否允许被提及: {self.waifu_mention}
是否为bot: {self.is_bot}
是否为真实用户: {self.is_real_user}
是否为bot全局管理: {self.is_bot_global_admin}
Expand Down

0 comments on commit 1602453

Please sign in to comment.