'Via Client.Update how to find out that I sent a message?
Tell me how I can understand what is in the handler Client.Update
is the message coming from me?
For some reason it happens that I look at the From_id
and From.Id
, there is my ID, then for some reason there is not
As I understand it, it shows my ID when I write in a chat, and if in private messages with a friend, it shows his ID
I'm trying to catch the ID through a standard example.
private static void DisplayMessage(MessageBase messageBase, bool edit = false)
{
if (edit) Console.Write("(Edit): ");
switch (messageBase)
{
case Message m: Console.WriteLine($"{Peer(m.from_id) ?? m.post_author} in {Peer(m.peer_id)}> {m.message}"); break;
case MessageService ms: Console.WriteLine($"{Peer(ms.from_id)} in {Peer(ms.peer_id)} [{ms.action.GetType().Name[13..]}]"); break;
}
}
Solution 1:[1]
The message.flags
should contain the flag Flags.out_
for your own outgoing messages
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |