Fixed method :code:Message.send_copy for stickers (#1284)

This commit is contained in:
Alex Root Junior 2023-08-26 23:24:51 +03:00 committed by GitHub
parent ca4c1b4b95
commit 397f30b58b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 6 deletions

1
CHANGES/1284.bugfix.rst Normal file
View file

@ -0,0 +1 @@
Fixed method :code:`Message.send_copy` for stickers.

View file

@ -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.")