Queer European MD passionate about IT
Browse Source

Bugs fixed

Davte 6 years ago
parent
commit
269f167be5
2 changed files with 20 additions and 4 deletions
  1. 1 1
      davtelepot/__init__.py
  2. 19 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.9"
+__version__ = "1.4.10"
 __maintainer__ = "Davide Testa"
 __contact__ = "t.me/davte"
 

+ 19 - 3
davtelepot/admin_tools.py

@@ -311,6 +311,8 @@ async def _talk_button(update, bot):
                 text=bot.get_message(
                     'talk', 'user_warning',
                     update=update
+                ).format(
+                    u=get_user(admin_record)
                 )
             )
             await bot.send_message(
@@ -318,6 +320,8 @@ async def _talk_button(update, bot):
                 text=bot.get_message(
                     'talk', 'admin_warning',
                     update=update
+                ).format(
+                    u=get_user(user_record)
                 ),
                 reply_markup=make_inline_keyboard(
                     [
@@ -335,10 +339,22 @@ async def _talk_button(update, bot):
             bot.set_custom_parser(
                 await async_wrapper(
                     _forward_to,
-                    bot=bot
+                    bot=bot,
+                    sender=user_record['telegram_id'],
+                    addressee=admin_record['telegram_id'],
+                    is_admin=False
                 ),
-                user_telegram_id=user_record['telegram_id'],
-                admin_telegram_id=admin_record['telegram_id'],
+                user_record['telegram_id']
+            )
+            bot.set_custom_parser(
+                await async_wrapper(
+                    _forward_to,
+                    bot=bot,
+                    sender=admin_record['telegram_id'],
+                    addressee=user_record['telegram_id'],
+                    is_admin=True
+                ),
+                admin_record['telegram_id']
             )
     elif command == 'stop':
         with bot.db as db: