mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-06 07:50:32 +00:00
Fixed method :code:Message.send_copy for stickers (#1284)
This commit is contained in:
parent
ca4c1b4b95
commit
397f30b58b
2 changed files with 24 additions and 6 deletions
1
CHANGES/1284.bugfix.rst
Normal file
1
CHANGES/1284.bugfix.rst
Normal file
|
|
@ -0,0 +1 @@
|
|||
Fixed method :code:`Message.send_copy` for stickers.
|
||||
|
|
@ -2864,7 +2864,11 @@ class Message(TelegramObject):
|
|||
}
|
||||
|
||||
if self.text:
|
||||
return SendMessage(text=self.text, entities=self.entities, **kwargs).as_(self._bot)
|
||||
return SendMessage(
|
||||
text=self.text,
|
||||
entities=self.entities,
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
if self.audio:
|
||||
return SendAudio(
|
||||
audio=self.audio.file_id,
|
||||
|
|
@ -2897,7 +2901,10 @@ class Message(TelegramObject):
|
|||
**kwargs,
|
||||
).as_(self._bot)
|
||||
if self.sticker:
|
||||
return SendSticker(sticker=self.sticker.file_id, **kwargs)
|
||||
return SendSticker(
|
||||
sticker=self.sticker.file_id,
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
if self.video:
|
||||
return SendVideo(
|
||||
video=self.video.file_id,
|
||||
|
|
@ -2906,9 +2913,15 @@ class Message(TelegramObject):
|
|||
**kwargs,
|
||||
).as_(self._bot)
|
||||
if self.video_note:
|
||||
return SendVideoNote(video_note=self.video_note.file_id, **kwargs).as_(self._bot)
|
||||
return SendVideoNote(
|
||||
video_note=self.video_note.file_id,
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
if self.voice:
|
||||
return SendVoice(voice=self.voice.file_id, **kwargs).as_(self._bot)
|
||||
return SendVoice(
|
||||
voice=self.voice.file_id,
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
if self.contact:
|
||||
return SendContact(
|
||||
phone_number=self.contact.phone_number,
|
||||
|
|
@ -2929,7 +2942,9 @@ class Message(TelegramObject):
|
|||
).as_(self._bot)
|
||||
if self.location:
|
||||
return SendLocation(
|
||||
latitude=self.location.latitude, longitude=self.location.longitude, **kwargs
|
||||
latitude=self.location.latitude,
|
||||
longitude=self.location.longitude,
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
if self.poll:
|
||||
return SendPoll(
|
||||
|
|
@ -2938,7 +2953,9 @@ class Message(TelegramObject):
|
|||
**kwargs,
|
||||
).as_(self._bot)
|
||||
if self.dice: # Dice value can't be controlled
|
||||
return SendDice(**kwargs).as_(self._bot)
|
||||
return SendDice(
|
||||
**kwargs,
|
||||
).as_(self._bot)
|
||||
|
||||
raise TypeError("This type of message can't be copied.")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue