How does one get WtelegramClient to display replies(preview of the original message and reply message) when copying via listening for updates from one channel to another? I am handling the reply by having the original message and the reply under it but I would like to make it like the inbuilt reply display.
How I would like it to be as in default behaviour in the original channel
Current display in destination channel
private async Task<Task> DisplayMessage(MessageBase messageBase,
bool edit = false)
{
if (edit) Console.Write("(Edit): ");
switch (messageBase)
{
case TL.Message m:
if (m.Peer.ID == from.ID)
{
string message = $"{m.message}";
Console.WriteLine(message);
if (messageBase.ReplyTo != null)
{
var chats = await Client.Messages_GetAllChats();
InputPeer peer = chats.chats[from.ID];
Messages_MessagesBase repMessage = await Client.Messages_GetHistory(peer);
TL.Message repliee = (TL.Message)repMessage.Messages[0];
if (repMessage.Messages.Length > 0)
{
foreach (var msg in repMessage.Messages)
{
if (msg.ID == m.reply_to.reply_to_msg_id)
{
repliee = (TL.Message)msg;
}
}
}
TargetLog(repliee.message + Environment.NewLine + Environment.NewLine +
"UPDATE:" + Environment.NewLine + message);
}
else
{
await Client.Messages_ForwardMessages(from, new[] { messageBase.ID }, new[] {
WTelegram.Helpers.RandomLong() }, to, drop_author: true);
}
}
private async Task TargetLog(string txt)
{
await Client.SendMessageAsync(to, txt);
}