Queer European MD passionate about IT
浏览代码

Talk panel arguments sorted differently

Davte 5 年之前
父节点
当前提交
5aa51f7e8a
共有 2 个文件被更改,包括 7 次插入4 次删除
  1. 1 1
      davtelepot/__init__.py
  2. 6 3
      davtelepot/admin_tools.py

+ 1 - 1
davtelepot/__init__.py

@@ -7,7 +7,7 @@ __author__ = "Davide Testa"
 __email__ = "davte@libero.it"
 __credits__ = "Marco Origlia"
 __license__ = "GNU General Public License v3.0"
-__version__ = "1.4.21"
+__version__ = "1.4.22"
 __maintainer__ = "Davide Testa"
 __contact__ = "t.me/davte"
 

+ 6 - 3
davtelepot/admin_tools.py

@@ -156,10 +156,13 @@ async def _forward_to(update, bot, sender, addressee, is_admin=False):
     return
 
 
-def get_talk_panel(text, bot, update):
+def get_talk_panel(update, bot, text=''):
     """Return text and reply markup of talk panel.
 
-    Get 'user_id' as string, username as string or void string for main menu.
+    `text` may be:
+    - `user_id` as string
+    - `username` as string
+    - `''` (empty string) for main menu (default)
     """
     users = []
     if len(text):
@@ -300,7 +303,7 @@ async def _talk_command(update, bot):
         bot,
         ['talk']
     )
-    text, reply_markup = get_talk_panel(text, bot, update)
+    text, reply_markup = get_talk_panel(update, bot, text)
     return dict(
         text=text,
         parse_mode='HTML',