Skip to content

Commit

Permalink
Bug Fix "error receiving messages"
Browse files Browse the repository at this point in the history
Removed Update field in accordance with the latest API updates
  • Loading branch information
dieletro committed Mar 20, 2024
1 parent 75d2572 commit 945d2ae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions v1.4.7/TInjectTelegram/Source/TinjectTelegram.Types.Impl.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1727,6 +1727,8 @@ function TtdMessage.Text: string;
end;
function TtdMessage.&Type: TtdMessageType;
begin
if not Text.IsEmpty then
Exit(TtdMessageType.TextMessage);
if Audio <> nil then
Exit(TtdMessageType.AudioMessage);
if Contact <> nil then
Expand All @@ -1737,8 +1739,8 @@ function TtdMessage.&Type: TtdMessageType;
Exit(TtdMessageType.GameMessage);
if (Location <> nil) then
Exit(TtdMessageType.LocationMessage);
if (NewChatMember <> nil) or (LeftChatMember <> nil) or ((NewChatPhoto <> nil) and (Length(NewChatPhoto) > 0)) or ((NewChatMembers <> nil) and (Length(NewChatMembers) > 0)) or (not NewChatTitle.IsEmpty) or DeleteChatPhoto or GroupChatCreated or SupergroupChatCreated or ChannelChatCreated or (MigrateToChatId <> 0) or (MigrateFromChatId <> 0) or (PinnedMessage <> nil) then
Exit(TtdMessageType.ServiceMessage);
// if (NewChatMember <> nil) or (LeftChatMember <> nil) or ((NewChatPhoto <> nil) and (Length(NewChatPhoto) > 0)) or ((NewChatMembers <> nil) and (Length(NewChatMembers) > 0)) or (not NewChatTitle.IsEmpty) or DeleteChatPhoto or GroupChatCreated or SupergroupChatCreated or ChannelChatCreated or (MigrateToChatId <> 0) or (MigrateFromChatId <> 0) or (PinnedMessage <> nil) then
// Exit(TtdMessageType.ServiceMessage);
if (Photo <> nil) and (Length(Photo) > 0) then
Exit(TtdMessageType.PhotoMessage);
if (Sticker <> nil) then
Expand All @@ -1761,8 +1763,6 @@ function TtdMessage.&Type: TtdMessageType;
Exit(TtdMessageType.InvoiceMessage);
if (PassportData <> nil) then
Exit(TtdMessageType.PassportDataMessage);
if not Text.IsEmpty then
Exit(TtdMessageType.TextMessage);
Result := TtdMessageType.UnknownMessage;
end;
function TtdMessage.UserShared: ItdUserShared;
Expand Down

0 comments on commit 945d2ae

Please sign in to comment.