Skip to content

Bot.parse_mode is ignored by Message.copy_to #876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tappress opened this issue Apr 4, 2022 · 1 comment · Fixed by #877
Closed

Bot.parse_mode is ignored by Message.copy_to #876

tappress opened this issue Apr 4, 2022 · 1 comment · Fixed by #877
Assignees
Labels
3.x Issue or PR for stable 3.x version bug Something is wrong with the framework confirmed This issue is confirmed and requires action
Milestone

Comments

@tappress
Copy link

tappress commented Apr 4, 2022

Context

aiogram 3.x

Expected Behavior

image

Current Behavior

image

Failure Information (for bugs)

Steps to Reproduce

from aiogram import Bot, Dispatcher
from aiogram.types import Message, ContentType

BOT_TOKEN = ""

bot = Bot(BOT_TOKEN, parse_mode='HTML')
dp = Dispatcher()


@dp.message()
async def copy_with_custom_caption(m: Message):
    if m.content_type in (
        ContentType.PHOTO, ContentType.VIDEO, ContentType.DOCUMENT, ContentType.AUDIO,
        ContentType.VOICE, ContentType.ANIMATION
    ):
        await m.copy_to(m.chat.id, caption="<b>BOLD TEXT</b>")  # Bot.parse_mode is ignored
        await m.copy_to(m.chat.id, caption="<b>BOLD TEXT</b>", parse_mode='HTML')  # OK
        await bot.copy_message(m.chat.id, m.chat.id, m.message_id, caption="<b>BOLD TEXT</b>")  # OK

if __name__ == '__main__':
    dp.run_polling(bot)
@Olegt0rr Olegt0rr added bug Something is wrong with the framework 3.x Issue or PR for stable 3.x version confirmed This issue is confirmed and requires action labels Apr 5, 2022
@Olegt0rr Olegt0rr self-assigned this Apr 5, 2022
@Olegt0rr Olegt0rr added this to the 3.0 milestone Apr 5, 2022
@Olegt0rr
Copy link
Contributor

Olegt0rr commented Apr 5, 2022

@PrepWork, thanks for the issue and detailed description of reproducing! :)

JrooTJunior pushed a commit that referenced this issue Apr 6, 2022
* fix: parse_mode should be UNSET instead of None

#876

* docs: add changelog

* docs: fixed changelog name

* fix: changelog typo fix
@JrooTJunior JrooTJunior linked a pull request Apr 11, 2022 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Issue or PR for stable 3.x version bug Something is wrong with the framework confirmed This issue is confirmed and requires action
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants