Delphi-Quellcode:
if (Ljtr.TokenType = TJsonToken.String) then
begin
if (LowerCase(Ljtr.Path) = 'groupoptions.chatid') then LBotOptions.chatid:= Ljtr.Value.ToString
else
if (LowerCase(Ljtr.Path) = 'groupoptions.antispammessage') then LBotOptions.AntiSpamMessage:= Ljtr.Value.ToString
else
if (LowerCase(Ljtr.Path) = 'groupoptions.creator') then LBotOptions.Creator:= Ljtr.Value.ToString
else
if (LowerCase(Ljtr.Path) = 'groupoptions.blacklist') then LBotOptions.blacklist:= Ljtr.Value.ToString
else
if (LowerCase(Ljtr.Path) = 'groupoptions.whitelist') then LBotOptions.whitelist:= Ljtr.Value.ToString
else
if (LowerCase(Ljtr.Path) = 'groupoptions.welcomemessage') then LBotOptions.welcomemessage:= Ljtr.Value.ToString
end
........
Wir sind ja fast da wo ich hin will! Also müsste doch der Part oben durch diesen ersetzbar sein oder? ( ja ich habe den Code seit dem Erstellpost aufgrund der Antwort schon begonnen umzustellen)
Delphi-Quellcode:
if (Ljtr.TokenType = TJsonToken.String) then
begin
SetStrProp(LBotOptions,LowerCase(Ljtr.Path),Ljtr.Value.ToString)
end;