Home c# How to attach an attachment to a VK message using the vk.net...

How to attach an attachment to a VK message using the vk.net library?

Author

Date

Category

Message.send (Param) method takes a special type.
One of the objects of the Object (Attachment) is responsible for attachments to the message.
Type of this field Ienumerable & lt; MediaAatTachment & GT; , where MediaAttachment is an abstract class.

How to fill this field?

From the documentation:

Attachment – media investment to a personal message listed through commas. Each attachment is presented in format: & lt; Type & gt; & lt; owner_id & gt; & lt; media_id & gt; .

Reference to function description

messagesshendparams param = new messagesshendparams ();
param.domain = user.domain;
param.attachment =?;
Messages.send (vknet.model.requestparams.messagesshendParams Param);
Ienumerable & lt; mediaattachment & gt;

Answer 1

Get the server for the attachment (methods can be different depending on whether you need where you need an attachment or from the type of attachment – I do not remember already, so I will not say more precisely. Look for documentation.)

Files Himself Attachment to the server After receiving an object of this very class “Mediatric”

and attach to the message.

More precisely, the Vl will be kept, I have been playing it for a long time.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions