From c96e95a122b6906d9b4832045a662a261f7cdd8b Mon Sep 17 00:00:00 2001 From: Rio Date: Sat, 17 Aug 2024 12:18:37 +0300 Subject: [PATCH] Fix: Properly handle multiple parameters in command input - Resolved an issue where only the first parameter was being processed, ignoring the rest. - Updated logic to ensure all parameters are correctly parsed and handled. --- tgram/methods/send_animation.py | 2 +- tgram/methods/send_audio.py | 2 +- tgram/methods/send_document.py | 2 +- tgram/methods/send_photo.py | 2 +- tgram/methods/send_sticker.py | 2 +- tgram/methods/send_video.py | 2 +- tgram/methods/send_video_note.py | 2 +- tgram/methods/send_voice.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tgram/methods/send_animation.py b/tgram/methods/send_animation.py index 7a908c8..8909396 100644 --- a/tgram/methods/send_animation.py +++ b/tgram/methods/send_animation.py @@ -121,7 +121,6 @@ async def send_animation( result = await self._send_request( "sendAnimation", chat_id=chat_id, - animation=get_file_path(animation), business_connection_id=business_connection_id, message_thread_id=message_thread_id, duration=duration, @@ -140,5 +139,6 @@ async def send_animation( message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, + animation=get_file_path(animation), ) return Message._parse(me=self, d=result["result"]) diff --git a/tgram/methods/send_audio.py b/tgram/methods/send_audio.py index 1d72032..98ef3ff 100644 --- a/tgram/methods/send_audio.py +++ b/tgram/methods/send_audio.py @@ -116,7 +116,6 @@ async def send_audio( result = await self._send_request( "sendAudio", chat_id=chat_id, - audio=get_file_path(audio), business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, @@ -133,5 +132,6 @@ async def send_audio( message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, + audio=get_file_path(audio), ) return Message._parse(me=self, d=result["result"]) diff --git a/tgram/methods/send_document.py b/tgram/methods/send_document.py index 278fbe0..c1e2e95 100644 --- a/tgram/methods/send_document.py +++ b/tgram/methods/send_document.py @@ -107,7 +107,6 @@ async def send_document( result = await self._send_request( "sendDocument", chat_id=chat_id, - document=get_file_path(document), business_connection_id=business_connection_id, message_thread_id=message_thread_id, thumbnail=get_file_path(thumbnail), @@ -122,5 +121,6 @@ async def send_document( message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, + document=get_file_path(document), ) return Message._parse(me=self, d=result["result"]) diff --git a/tgram/methods/send_photo.py b/tgram/methods/send_photo.py index af52d8d..afc4347 100644 --- a/tgram/methods/send_photo.py +++ b/tgram/methods/send_photo.py @@ -99,7 +99,6 @@ async def send_photo( result = await self._send_request( "sendPhoto", chat_id=chat_id, - photo=get_file_path(photo), business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, @@ -114,5 +113,6 @@ async def send_photo( message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, + photo=get_file_path(photo), ) return Message._parse(me=self, d=result["result"]) diff --git a/tgram/methods/send_sticker.py b/tgram/methods/send_sticker.py index c70b720..dbfc4a4 100644 --- a/tgram/methods/send_sticker.py +++ b/tgram/methods/send_sticker.py @@ -83,7 +83,6 @@ async def send_sticker( result = await self._send_request( "sendSticker", chat_id=chat_id, - sticker=sticker, business_connection_id=business_connection_id, message_thread_id=message_thread_id, emoji=emoji, @@ -94,5 +93,6 @@ async def send_sticker( message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, + sticker=sticker, ) return Message._parse(me=self, d=result["result"]) diff --git a/tgram/methods/send_video.py b/tgram/methods/send_video.py index 36a9a59..0539475 100644 --- a/tgram/methods/send_video.py +++ b/tgram/methods/send_video.py @@ -123,7 +123,6 @@ async def send_video( result = await self._send_request( "sendVideo", chat_id=chat_id, - video=get_file_path(video), business_connection_id=business_connection_id, message_thread_id=message_thread_id, duration=duration, @@ -143,5 +142,6 @@ async def send_video( message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, + video=get_file_path(video), ) return Message._parse(me=self, d=result["result"]) diff --git a/tgram/methods/send_video_note.py b/tgram/methods/send_video_note.py index 42267dd..13b98d8 100644 --- a/tgram/methods/send_video_note.py +++ b/tgram/methods/send_video_note.py @@ -95,7 +95,6 @@ async def send_video_note( result = await self._send_request( "sendVideoNote", chat_id=chat_id, - video_note=get_file_path(video_note), business_connection_id=business_connection_id, message_thread_id=message_thread_id, duration=duration, @@ -108,5 +107,6 @@ async def send_video_note( message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, + video_note=get_file_path(video_note), ) return Message._parse(me=self, d=result["result"]) diff --git a/tgram/methods/send_voice.py b/tgram/methods/send_voice.py index 6c6b8d1..d46c249 100644 --- a/tgram/methods/send_voice.py +++ b/tgram/methods/send_voice.py @@ -93,7 +93,6 @@ async def send_voice( result = await self._send_request( "sendVoice", chat_id=chat_id, - voice=get_file_path(voice), business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, @@ -107,5 +106,6 @@ async def send_voice( message_effect_id=message_effect_id, reply_parameters=reply_parameters, reply_markup=reply_markup, + voice=get_file_path(voice), ) return Message._parse(me=self, d=result["result"])