Skip to content

Commit

Permalink
new: add remove command
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Jul 28, 2024
1 parent bfa5b15 commit 1bbfca2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions hiddify_support_bot/basebot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ async def def_action():
await bot.set_my_commands(scope=types.BotCommandScopeAllGroupChats(), commands=[
types.BotCommand("/check", "check server info"),
types.BotCommand("/done", "close ssh connection"),
types.BotCommand("/remove", "remove conversation and close ssh connection"),
types.BotCommand("/welcome", "set welcome message for this topic"),
types.BotCommand("/get_link", "get_link to this topic from bot"),
types.BotCommand("/get_ssh_link", "get_all_ssh_link"),
Expand Down
6 changes: 5 additions & 1 deletion hiddify_support_bot/modules/user/reply_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,8 @@ async def remove(msg: HMessage):
{_("chat.removed", target_chat_lang)}"""
await bot.send_message(reply_to_chat_data['chat_id'], caption, reply_parameters=types.ReplyParameters(reply_to_chat_data['msg_id']), parse_mode='markdown')

await bot.delete_message(msg.main_message.chat.id, msg.main_message.id)
orig = msg.main_message.forward_origin
if orig:
await bot.delete_message(orig.chat.id, orig.message_id)

# await bot.delete_message(msg.main_message.chat.id, msg.main_message.id)

0 comments on commit 1bbfca2

Please sign in to comment.