Skip to main content

Forward and copy

forward_message() returns the new Message object. copy_message() returns a dictionary such as {'message_id': 123}.

Delete messages

Edit text and captions

edit_message() accepts the same parse mode, entity, and link-preview options as send_message().

Replace or remove an inline keyboard

An empty inline keyboard removes the existing buttons. Pass a new keyboard to replace them.

Pin and unpin

Answer callback queries

Always acknowledge callback queries so the client stops showing a loading state:
Set show_alert = True to show the message as a modal alert. Pass url to open a link, or cache_time to control client-side caching.