SaveDraft
---functions--- messages.saveDraft#54ae308e no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo peer:InputPeer message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia effect:flags.7?long suggested_post:flags.8?SuggestedPost = Bool
Returns
| Bool |
Parameters
| no_webpage | true | optional |
| invert_media | true | optional |
| reply_to | InputReplyTo | optional |
| peer | InputPeer | required |
| message | string | required |
| entities | Vector<MessageEntity> | optional |
| media | InputMedia | optional |
| effect | long | optional |
| suggested_post | SuggestedPost | optional |
Example
The examples below use placeholder values. Replace them with real data before running the code.
▶ Minimal
import asyncio
from ferogram import Client
app = Client("my_session", api_id=12345, api_hash="0123456789abcdef0123456789abcdef")
async def main():
await app.start()
result = await app.raw.messages.SaveDraft(
peer='username',
message='Hello there!'
)
print(result)
asyncio.run(main())
The minimal example uses Ferogram's raw proxy shorthand. Peers can be passed as strings and required primitives get safe defaults. Expand Full API to see every parameter.
▶ Full API
import asyncio
from ferogram import Client, raw
app = Client("my_session", api_id=12345, api_hash="0123456789abcdef0123456789abcdef")
async def main():
await app.start()
result = await app(raw.functions.messages.SaveDraft(
no_webpage=True,
invert_media=True,
reply_to=raw.types.InputReplyToMessage(reply_to_msg_id=42),
peer=raw.types.InputPeerSelf(),
message='Hello there!',
entities=[raw.types.MessageEntityUnknown(offset=0, length=1)],
media=raw.types.InputMediaEmpty(),
effect=-12398745604826,
suggested_post=raw.types.SuggestedPost(date=0)
))
print(result)
asyncio.run(main())