<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[QUIK -> DDE &mdash; Отправка в Telegram из QUIK]]></title>
		<link>https://quik2dde.ru/viewtopic.php?id=344</link>
		<atom:link href="https://quik2dde.ru/extern.php?action=feed&amp;tid=344&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «Отправка в Telegram из QUIK».]]></description>
		<lastBuildDate>Sat, 06 May 2023 16:32:59 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Отправка в Telegram из QUIK]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=4196#p4196</link>
			<description><![CDATA[<p>WIN10 64<br />Функцию AnsiToUtf8 убрал. Работает штатно без нее<br />Странно конечно, но если у кого будет работать без нее норм, если нет - добавляйте</p><div class="codebox"><pre><code>function telegram(message,num)
-- message = AnsiToUtf8(message)
str = &quot;curl -X GET \&quot;https://api.telegram.org/bot--TOKEN--/sendMessage\&quot; -d \&quot;chat_id=--CHAT_ID--&amp;text=&quot;..message..&quot;\&quot;&quot;
local msg = os.execute(&quot;start /MIN &quot;..str)  
    if msg then 
        return true
    else
        message(&quot;ERROR TELEGRAM&quot;, 3)
        return false
    end 
end</code></pre></div><div class="quotebox"><cite>dima.v.blank пишет:</cite><blockquote><p>и так РЕШЕНИЕ!!! <img src="https://quik2dde.ru/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>функция перекодировки Ansi =&gt; Utf8</p><div class="codebox"><pre><code>local ansi_decode={
[128]=&#039;\208\130&#039;,[129]=&#039;\208\131&#039;,[130]=&#039;\226\128\154&#039;,[131]=&#039;\209\147&#039;,[132]=&#039;\226\128\158&#039;,[133]=&#039;\226\128\166&#039;,
[134]=&#039;\226\128\160&#039;,[135]=&#039;\226\128\161&#039;,[136]=&#039;\226\130\172&#039;,[137]=&#039;\226\128\176&#039;,[138]=&#039;\208\137&#039;,[139]=&#039;\226\128\185&#039;,
[140]=&#039;\208\138&#039;,[141]=&#039;\208\140&#039;,[142]=&#039;\208\139&#039;,[143]=&#039;\208\143&#039;,[144]=&#039;\209\146&#039;,[145]=&#039;\226\128\152&#039;,
[146]=&#039;\226\128\153&#039;,[147]=&#039;\226\128\156&#039;,[148]=&#039;\226\128\157&#039;,[149]=&#039;\226\128\162&#039;,[150]=&#039;\226\128\147&#039;,[151]=&#039;\226\128\148&#039;,
[152]=&#039;\194\152&#039;,[153]=&#039;\226\132\162&#039;,[154]=&#039;\209\153&#039;,[155]=&#039;\226\128\186&#039;,[156]=&#039;\209\154&#039;,[157]=&#039;\209\156&#039;,
[158]=&#039;\209\155&#039;,[159]=&#039;\209\159&#039;,[160]=&#039;\194\160&#039;,[161]=&#039;\209\142&#039;,[162]=&#039;\209\158&#039;,[163]=&#039;\208\136&#039;,
[164]=&#039;\194\164&#039;,[165]=&#039;\210\144&#039;,[166]=&#039;\194\166&#039;,[167]=&#039;\194\167&#039;,[168]=&#039;\208\129&#039;,[169]=&#039;\194\169&#039;,
[170]=&#039;\208\132&#039;,[171]=&#039;\194\171&#039;,[172]=&#039;\194\172&#039;,[173]=&#039;\194\173&#039;,[174]=&#039;\194\174&#039;,[175]=&#039;\208\135&#039;,
[176]=&#039;\194\176&#039;,[177]=&#039;\194\177&#039;,[178]=&#039;\208\134&#039;,[179]=&#039;\209\150&#039;,[180]=&#039;\210\145&#039;,[181]=&#039;\194\181&#039;,
[182]=&#039;\194\182&#039;,[183]=&#039;\194\183&#039;,[184]=&#039;\209\145&#039;,[185]=&#039;\226\132\150&#039;,[186]=&#039;\209\148&#039;,[187]=&#039;\194\187&#039;,
[188]=&#039;\209\152&#039;,[189]=&#039;\208\133&#039;,[190]=&#039;\209\149&#039;,[191]=&#039;\209\151&#039;
}
local utf8_decode={
[128]={[147]=&#039;\150&#039;,[148]=&#039;\151&#039;,[152]=&#039;\145&#039;,[153]=&#039;\146&#039;,[154]=&#039;\130&#039;,[156]=&#039;\147&#039;,[157]=&#039;\148&#039;,[158]=&#039;\132&#039;,[160]=&#039;\134&#039;,[161]=&#039;\135&#039;,[162]=&#039;\149&#039;,[166]=&#039;\133&#039;,[176]=&#039;\137&#039;,[185]=&#039;\139&#039;,[186]=&#039;\155&#039;},
[130]={[172]=&#039;\136&#039;},
[132]={[150]=&#039;\185&#039;,[162]=&#039;\153&#039;},
[194]={[152]=&#039;\152&#039;,[160]=&#039;\160&#039;,[164]=&#039;\164&#039;,[166]=&#039;\166&#039;,[167]=&#039;\167&#039;,[169]=&#039;\169&#039;,[171]=&#039;\171&#039;,[172]=&#039;\172&#039;,[173]=&#039;\173&#039;,[174]=&#039;\174&#039;,[176]=&#039;\176&#039;,[177]=&#039;\177&#039;,[181]=&#039;\181&#039;,[182]=&#039;\182&#039;,[183]=&#039;\183&#039;,[187]=&#039;\187&#039;},
[208]={[129]=&#039;\168&#039;,[130]=&#039;\128&#039;,[131]=&#039;\129&#039;,[132]=&#039;\170&#039;,[133]=&#039;\189&#039;,[134]=&#039;\178&#039;,[135]=&#039;\175&#039;,[136]=&#039;\163&#039;,[137]=&#039;\138&#039;,[138]=&#039;\140&#039;,[139]=&#039;\142&#039;,[140]=&#039;\141&#039;,[143]=&#039;\143&#039;,[144]=&#039;\192&#039;,[145]=&#039;\193&#039;,[146]=&#039;\194&#039;,[147]=&#039;\195&#039;,[148]=&#039;\196&#039;,
[149]=&#039;\197&#039;,[150]=&#039;\198&#039;,[151]=&#039;\199&#039;,[152]=&#039;\200&#039;,[153]=&#039;\201&#039;,[154]=&#039;\202&#039;,[155]=&#039;\203&#039;,[156]=&#039;\204&#039;,[157]=&#039;\205&#039;,[158]=&#039;\206&#039;,[159]=&#039;\207&#039;,[160]=&#039;\208&#039;,[161]=&#039;\209&#039;,[162]=&#039;\210&#039;,[163]=&#039;\211&#039;,[164]=&#039;\212&#039;,[165]=&#039;\213&#039;,[166]=&#039;\214&#039;,
[167]=&#039;\215&#039;,[168]=&#039;\216&#039;,[169]=&#039;\217&#039;,[170]=&#039;\218&#039;,[171]=&#039;\219&#039;,[172]=&#039;\220&#039;,[173]=&#039;\221&#039;,[174]=&#039;\222&#039;,[175]=&#039;\223&#039;,[176]=&#039;\224&#039;,[177]=&#039;\225&#039;,[178]=&#039;\226&#039;,[179]=&#039;\227&#039;,[180]=&#039;\228&#039;,[181]=&#039;\229&#039;,[182]=&#039;\230&#039;,[183]=&#039;\231&#039;,[184]=&#039;\232&#039;,
[185]=&#039;\233&#039;,[186]=&#039;\234&#039;,[187]=&#039;\235&#039;,[188]=&#039;\236&#039;,[189]=&#039;\237&#039;,[190]=&#039;\238&#039;,[191]=&#039;\239&#039;},
[209]={[128]=&#039;\240&#039;,[129]=&#039;\241&#039;,[130]=&#039;\242&#039;,[131]=&#039;\243&#039;,[132]=&#039;\244&#039;,[133]=&#039;\245&#039;,[134]=&#039;\246&#039;,[135]=&#039;\247&#039;,[136]=&#039;\248&#039;,[137]=&#039;\249&#039;,[138]=&#039;\250&#039;,[139]=&#039;\251&#039;,[140]=&#039;\252&#039;,[141]=&#039;\253&#039;,[142]=&#039;\254&#039;,[143]=&#039;\255&#039;,[144]=&#039;\161&#039;,[145]=&#039;\184&#039;,
[146]=&#039;\144&#039;,[147]=&#039;\131&#039;,[148]=&#039;\186&#039;,[149]=&#039;\190&#039;,[150]=&#039;\179&#039;,[151]=&#039;\191&#039;,[152]=&#039;\188&#039;,[153]=&#039;\154&#039;,[154]=&#039;\156&#039;,[155]=&#039;\158&#039;,[156]=&#039;\157&#039;,[158]=&#039;\162&#039;,[159]=&#039;\159&#039;},[210]={[144]=&#039;\165&#039;,[145]=&#039;\180&#039;}
}

local nmdc = {
[36] = &#039;$&#039;,
[124] = &#039;|&#039;
}

function AnsiToUtf8(s)
    local r, b = &#039;&#039;
    for i = 1, s and s:len() or 0 do
        b = s:byte(i)
        if b &lt; 128 then
            r = r..string.char(b)
        else
            if b &gt; 239 then
                r = r..&#039;\209&#039;..string.char(b - 112)
            
            elseif b &gt; 191 then
                r = r..&#039;\208&#039;..string.char(b - 48)
            elseif ansi_decode[b] then
                r = r..ansi_decode[b]
            else
                r = r..&#039;_&#039;
            end
        end
    end
    return r
end</code></pre></div><p>ну и сам Telegram:<br /></p><div class="codebox"><pre><code>function telegram(message,num)
message = AnsiToUtf8(message)
str = &quot;curl -X GET \&quot;https://api.telegram.org/bot--TOKEN--/sendMessage\&quot; -d \&quot;chat_id=--CHAT_ID--&amp;text=&quot;..message..&quot;\&quot;&quot;
local msg = os.execute(&quot;start /MIN &quot;..str)  
    if msg then 
        return true
    else
        message(&quot;ERROR TELEGRAM&quot;, 3)
        return false
    end 
end</code></pre></div></blockquote></div>]]></description>
			<author><![CDATA[null@example.com (dima.v.blank)]]></author>
			<pubDate>Sat, 06 May 2023 16:32:59 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=4196#p4196</guid>
		</item>
		<item>
			<title><![CDATA[Re: Отправка в Telegram из QUIK]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=3896#p3896</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>добавил чутка смайлов</p></blockquote></div><p>смайлики брать тут:<br />[url]https://apps.timwhitlock.info/emoji/tables/unicode[/url]</p><p>символы \х менять на %</p>]]></description>
			<author><![CDATA[null@example.com (dima.v.blank)]]></author>
			<pubDate>Thu, 27 Oct 2022 10:27:24 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=3896#p3896</guid>
		</item>
		<item>
			<title><![CDATA[Re: Отправка в Telegram из QUIK]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=3895#p3895</link>
			<description><![CDATA[<p>добавил чутка смайлов, на основании параметров message</p><div class="codebox"><pre><code>function telegram(message,num)
if num == 1 or num == nil then num = &quot;%F0%9F%98%8F &quot;
elseif num == 2 then num = &quot;%F0%9F%98%9C &quot;
elseif num == 3 then num =&quot;%F0%9F%98%A1 &quot;
end
message = AnsiToUtf8(message)
str = &quot;curl -X GET \&quot;https://api.telegram.org/bot--BOT API--/sendMessage\&quot; -d \&quot;chat_id=--CHAT ID--&amp;text=&quot;..num..message..&quot;\&quot;&quot;
local msg = os.execute(&quot;start /MIN &quot;..str)  
    if msg then 
        return true
    else
        message(&quot;ERROR TELEGRAM&quot;, 3)
        return false
    end 
end</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (dima.v.blank)]]></author>
			<pubDate>Thu, 27 Oct 2022 10:26:01 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=3895#p3895</guid>
		</item>
		<item>
			<title><![CDATA[Re: Отправка в Telegram из QUIK]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=3894#p3894</link>
			<description><![CDATA[<p><strong>dima.v.blank</strong> <span class="postimg"><img src="https://smailik.top/gif/funi01018.gif" alt="https://smailik.top/gif/funi01018.gif" /></span></p>]]></description>
			<author><![CDATA[null@example.com (swerg)]]></author>
			<pubDate>Thu, 27 Oct 2022 09:57:25 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=3894#p3894</guid>
		</item>
		<item>
			<title><![CDATA[Re: Отправка в Telegram из QUIK]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=3893#p3893</link>
			<description><![CDATA[<p>и так РЕШЕНИЕ!!! <img src="https://quik2dde.ru/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>функция перекодировки Ansi =&gt; Utf8</p><div class="codebox"><pre><code>local ansi_decode={
[128]=&#039;\208\130&#039;,[129]=&#039;\208\131&#039;,[130]=&#039;\226\128\154&#039;,[131]=&#039;\209\147&#039;,[132]=&#039;\226\128\158&#039;,[133]=&#039;\226\128\166&#039;,
[134]=&#039;\226\128\160&#039;,[135]=&#039;\226\128\161&#039;,[136]=&#039;\226\130\172&#039;,[137]=&#039;\226\128\176&#039;,[138]=&#039;\208\137&#039;,[139]=&#039;\226\128\185&#039;,
[140]=&#039;\208\138&#039;,[141]=&#039;\208\140&#039;,[142]=&#039;\208\139&#039;,[143]=&#039;\208\143&#039;,[144]=&#039;\209\146&#039;,[145]=&#039;\226\128\152&#039;,
[146]=&#039;\226\128\153&#039;,[147]=&#039;\226\128\156&#039;,[148]=&#039;\226\128\157&#039;,[149]=&#039;\226\128\162&#039;,[150]=&#039;\226\128\147&#039;,[151]=&#039;\226\128\148&#039;,
[152]=&#039;\194\152&#039;,[153]=&#039;\226\132\162&#039;,[154]=&#039;\209\153&#039;,[155]=&#039;\226\128\186&#039;,[156]=&#039;\209\154&#039;,[157]=&#039;\209\156&#039;,
[158]=&#039;\209\155&#039;,[159]=&#039;\209\159&#039;,[160]=&#039;\194\160&#039;,[161]=&#039;\209\142&#039;,[162]=&#039;\209\158&#039;,[163]=&#039;\208\136&#039;,
[164]=&#039;\194\164&#039;,[165]=&#039;\210\144&#039;,[166]=&#039;\194\166&#039;,[167]=&#039;\194\167&#039;,[168]=&#039;\208\129&#039;,[169]=&#039;\194\169&#039;,
[170]=&#039;\208\132&#039;,[171]=&#039;\194\171&#039;,[172]=&#039;\194\172&#039;,[173]=&#039;\194\173&#039;,[174]=&#039;\194\174&#039;,[175]=&#039;\208\135&#039;,
[176]=&#039;\194\176&#039;,[177]=&#039;\194\177&#039;,[178]=&#039;\208\134&#039;,[179]=&#039;\209\150&#039;,[180]=&#039;\210\145&#039;,[181]=&#039;\194\181&#039;,
[182]=&#039;\194\182&#039;,[183]=&#039;\194\183&#039;,[184]=&#039;\209\145&#039;,[185]=&#039;\226\132\150&#039;,[186]=&#039;\209\148&#039;,[187]=&#039;\194\187&#039;,
[188]=&#039;\209\152&#039;,[189]=&#039;\208\133&#039;,[190]=&#039;\209\149&#039;,[191]=&#039;\209\151&#039;
}
local utf8_decode={
[128]={[147]=&#039;\150&#039;,[148]=&#039;\151&#039;,[152]=&#039;\145&#039;,[153]=&#039;\146&#039;,[154]=&#039;\130&#039;,[156]=&#039;\147&#039;,[157]=&#039;\148&#039;,[158]=&#039;\132&#039;,[160]=&#039;\134&#039;,[161]=&#039;\135&#039;,[162]=&#039;\149&#039;,[166]=&#039;\133&#039;,[176]=&#039;\137&#039;,[185]=&#039;\139&#039;,[186]=&#039;\155&#039;},
[130]={[172]=&#039;\136&#039;},
[132]={[150]=&#039;\185&#039;,[162]=&#039;\153&#039;},
[194]={[152]=&#039;\152&#039;,[160]=&#039;\160&#039;,[164]=&#039;\164&#039;,[166]=&#039;\166&#039;,[167]=&#039;\167&#039;,[169]=&#039;\169&#039;,[171]=&#039;\171&#039;,[172]=&#039;\172&#039;,[173]=&#039;\173&#039;,[174]=&#039;\174&#039;,[176]=&#039;\176&#039;,[177]=&#039;\177&#039;,[181]=&#039;\181&#039;,[182]=&#039;\182&#039;,[183]=&#039;\183&#039;,[187]=&#039;\187&#039;},
[208]={[129]=&#039;\168&#039;,[130]=&#039;\128&#039;,[131]=&#039;\129&#039;,[132]=&#039;\170&#039;,[133]=&#039;\189&#039;,[134]=&#039;\178&#039;,[135]=&#039;\175&#039;,[136]=&#039;\163&#039;,[137]=&#039;\138&#039;,[138]=&#039;\140&#039;,[139]=&#039;\142&#039;,[140]=&#039;\141&#039;,[143]=&#039;\143&#039;,[144]=&#039;\192&#039;,[145]=&#039;\193&#039;,[146]=&#039;\194&#039;,[147]=&#039;\195&#039;,[148]=&#039;\196&#039;,
[149]=&#039;\197&#039;,[150]=&#039;\198&#039;,[151]=&#039;\199&#039;,[152]=&#039;\200&#039;,[153]=&#039;\201&#039;,[154]=&#039;\202&#039;,[155]=&#039;\203&#039;,[156]=&#039;\204&#039;,[157]=&#039;\205&#039;,[158]=&#039;\206&#039;,[159]=&#039;\207&#039;,[160]=&#039;\208&#039;,[161]=&#039;\209&#039;,[162]=&#039;\210&#039;,[163]=&#039;\211&#039;,[164]=&#039;\212&#039;,[165]=&#039;\213&#039;,[166]=&#039;\214&#039;,
[167]=&#039;\215&#039;,[168]=&#039;\216&#039;,[169]=&#039;\217&#039;,[170]=&#039;\218&#039;,[171]=&#039;\219&#039;,[172]=&#039;\220&#039;,[173]=&#039;\221&#039;,[174]=&#039;\222&#039;,[175]=&#039;\223&#039;,[176]=&#039;\224&#039;,[177]=&#039;\225&#039;,[178]=&#039;\226&#039;,[179]=&#039;\227&#039;,[180]=&#039;\228&#039;,[181]=&#039;\229&#039;,[182]=&#039;\230&#039;,[183]=&#039;\231&#039;,[184]=&#039;\232&#039;,
[185]=&#039;\233&#039;,[186]=&#039;\234&#039;,[187]=&#039;\235&#039;,[188]=&#039;\236&#039;,[189]=&#039;\237&#039;,[190]=&#039;\238&#039;,[191]=&#039;\239&#039;},
[209]={[128]=&#039;\240&#039;,[129]=&#039;\241&#039;,[130]=&#039;\242&#039;,[131]=&#039;\243&#039;,[132]=&#039;\244&#039;,[133]=&#039;\245&#039;,[134]=&#039;\246&#039;,[135]=&#039;\247&#039;,[136]=&#039;\248&#039;,[137]=&#039;\249&#039;,[138]=&#039;\250&#039;,[139]=&#039;\251&#039;,[140]=&#039;\252&#039;,[141]=&#039;\253&#039;,[142]=&#039;\254&#039;,[143]=&#039;\255&#039;,[144]=&#039;\161&#039;,[145]=&#039;\184&#039;,
[146]=&#039;\144&#039;,[147]=&#039;\131&#039;,[148]=&#039;\186&#039;,[149]=&#039;\190&#039;,[150]=&#039;\179&#039;,[151]=&#039;\191&#039;,[152]=&#039;\188&#039;,[153]=&#039;\154&#039;,[154]=&#039;\156&#039;,[155]=&#039;\158&#039;,[156]=&#039;\157&#039;,[158]=&#039;\162&#039;,[159]=&#039;\159&#039;},[210]={[144]=&#039;\165&#039;,[145]=&#039;\180&#039;}
}

local nmdc = {
[36] = &#039;$&#039;,
[124] = &#039;|&#039;
}

function AnsiToUtf8(s)
    local r, b = &#039;&#039;
    for i = 1, s and s:len() or 0 do
        b = s:byte(i)
        if b &lt; 128 then
            r = r..string.char(b)
        else
            if b &gt; 239 then
                r = r..&#039;\209&#039;..string.char(b - 112)
            
            elseif b &gt; 191 then
                r = r..&#039;\208&#039;..string.char(b - 48)
            elseif ansi_decode[b] then
                r = r..ansi_decode[b]
            else
                r = r..&#039;_&#039;
            end
        end
    end
    return r
end</code></pre></div><p>ну и сам Telegram:<br /></p><div class="codebox"><pre><code>function telegram(message,num)
message = AnsiToUtf8(message)
str = &quot;curl -X GET \&quot;https://api.telegram.org/bot--TOKEN--/sendMessage\&quot; -d \&quot;chat_id=--CHAT_ID--&amp;text=&quot;..message..&quot;\&quot;&quot;
local msg = os.execute(&quot;start /MIN &quot;..str)  
    if msg then 
        return true
    else
        message(&quot;ERROR TELEGRAM&quot;, 3)
        return false
    end 
end</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (dima.v.blank)]]></author>
			<pubDate>Thu, 27 Oct 2022 09:29:17 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=3893#p3893</guid>
		</item>
		<item>
			<title><![CDATA[Re: Отправка в Telegram из QUIK]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=3892#p3892</link>
			<description><![CDATA[<p>Значит такое требование интерфейса телеграмма.<br />Осталось найти чем конвертировать CP1251 -&gt; UTF-8<br />Похоже есть смысл добавить в w32 библиотеку, например, такую функцию.</p>]]></description>
			<author><![CDATA[null@example.com (swerg)]]></author>
			<pubDate>Thu, 27 Oct 2022 09:25:04 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=3892#p3892</guid>
		</item>
		<item>
			<title><![CDATA[Re: Отправка в Telegram из QUIK]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=3891#p3891</link>
			<description><![CDATA[<p>это очень странно... но оказывается не отправляются сообщения на кирилице!<br />Как только я &quot;перевел&quot; все сообщения - все отлично работает.</p><p>нашел код ошибки:<br /></p><div class="codebox"><pre><code>&quot;{&quot;ok&quot;:false,&quot;error_code&quot;:400,&quot;description&quot;:&quot;Bad Request: strings must be encoded in UTF-8&quot;}&quot;</code></pre></div><p>а все скрипты же у меня на CP1251</p><p>Буду капать в этом направлении.</p>]]></description>
			<author><![CDATA[null@example.com (dima.v.blank)]]></author>
			<pubDate>Thu, 27 Oct 2022 09:09:40 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=3891#p3891</guid>
		</item>
		<item>
			<title><![CDATA[Re: Отправка в Telegram из QUIK]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=3890#p3890</link>
			<description><![CDATA[<p>доброго дня.<br />немного темку UPну</p><p>и так рабочий вариант работает <img src="https://quik2dde.ru/img/smilies/smile.png" width="15" height="15" alt="smile" /> (WIN7 32 &amp; WIN10 64)</p><div class="codebox"><pre><code>function telegram(message,num)
str = &quot;curl -X POST \&quot;https://api.telegram.org/bot--TOKEN--/sendMessage\&quot; -d \&quot;chat_id=--CHAT--&amp;text=&quot;..message..&quot;\&quot;&quot;
local msg = os.execute(&quot;start /MIN &quot;..str)  
    if msg then 
        return true
    else
        message(&quot;ERROR TELEGRAM&quot;, 3)
        return false
    end 
end</code></pre></div><p> </p><p>но работает невсегда! Я что-то прям зависаю уже.</p><p>РАБОТАЕТ:<br /></p><div class="codebox"><pre><code>STRATEGY = INSTRUMENT..TF

function OnInit()
    telegram(STRATEGY..&quot; Loading ...&quot;, 2)</code></pre></div><p>дальше в main() НЕ РАБОТАЕТ (но работает если выводить например LAST по инструменту. прям спамит в чат нормально )<br /></p><div class="codebox"><pre><code>function main()
    while IsRun do
...
    --=== CONNECTED ?
    if isConnected() == 0 then
        telegram(STRATEGY..&quot; нет соединения&quot;, 3)
        slp = 5000
    end</code></pre></div><p>дальше РАБОТАЕТ (только &amp; нужно экранировать - все что после - не видно в сообщении)<br /></p><div class="codebox"><pre><code>            
--== ПОЛУЧАЕМ ДАННЫЕ по ИНСТРУМЕНТУ
PRICEMAX = math.floor(getParamEx(CLASSCODE, INSTRUMENT, &quot;PRICEMAX&quot;).param_value + 0)    -- максимально возможная цена
PRICEMIN = math.floor(getParamEx(CLASSCODE, INSTRUMENT, &quot;PRICEMIN&quot;).param_value + 0)    -- минимально возможная цена
LAST = math.floor(getParamEx(CLASSCODE, INSTRUMENT, &quot;LAST&quot;).param_value + 0)              -- последняя цена
--== КОНТРОЛЬ ДАННЫХ ПО ИНСТРУМЕНТУ (PRICEMAX / PRICEMIN)
    if PRICEMAX == 0 or PRICEMIN == 0 or LAST == 0 then
        telegram(STRATEGY..&quot; ... loading PRICEMAX &amp; PRICEMIN &amp; LAST&quot;, 2)
        slp = 5000
        break
    end</code></pre></div><p>в функции OnStop - отказывается работать<br /></p><div class="codebox"><pre><code>function OnStop()
    IsRun = false
    telegram(STRATEGY..&quot; Остановили торговлю. Закрыли таблицу.&quot;, 2)</code></pre></div><p>собственно&nbsp; если поменять с функции telegram на просто message() - никаких нареканий, или рядом поставить дублирующую строку message()</p><p>и да, окно cmd выходит (появляется) когда нужно, но сообщений нет. Как бы посмотреть какая ошибка?</p><p>если есть мысли куда копать, буду признателен</p>]]></description>
			<author><![CDATA[null@example.com (dima.v.blank)]]></author>
			<pubDate>Thu, 27 Oct 2022 08:17:43 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=3890#p3890</guid>
		</item>
		<item>
			<title><![CDATA[Re: Отправка в Telegram из QUIK]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=3423#p3423</link>
			<description><![CDATA[<div class="quotebox"><cite>iforts пишет:</cite><blockquote><p>Вот рабочий вариант отправки в телеграм через cmd curl</p><p>Установит curl если нет, создать бота и группу или канал узнать id<br />[url]https://betacode.net/11617/install-curl-on-windows[/url]<br /></p><div class="codebox"><pre><code>function tel_group()
  str = &quot;curl --connect-timeout 10 -k -s &quot;
  str = str .. &quot;\&quot;https://api.telegram.org/bot1665286370:AAEEVkD-_VRQtUanptwjn4TlkWdn8xMSu0sc/sendMessage?chat_id=-460430831&amp;text=&quot;
  str = str .. &quot;Hello Lua&quot; 
  local msg = os.execute(&quot;start /MIN &quot;..str)  
  if msg then 
    return true
  else 
    message(&quot;error telegram&quot;)
    return false
  end 
end</code></pre></div></blockquote></div><p>Что то непонятно ? У меня win7 все уходит нормально.</p>]]></description>
			<author><![CDATA[null@example.com (iforts)]]></author>
			<pubDate>Sat, 29 Jan 2022 05:37:53 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=3423#p3423</guid>
		</item>
		<item>
			<title><![CDATA[Re: Отправка в Telegram из QUIK]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=3422#p3422</link>
			<description><![CDATA[<div class="quotebox"><cite>iforts пишет:</cite><blockquote><p>Вот рабочий вариант отправки в телеграм <br />[url]https://betacode.net/11617/install-curl-on-windows[/url]</p></blockquote></div><p>Ммм, не выдает ничего для Windows64...((<br />Ну, и в целом вопрос, как отправить себе сообщение из скрипта?</p>]]></description>
			<author><![CDATA[null@example.com (Xantrax)]]></author>
			<pubDate>Fri, 28 Jan 2022 17:37:00 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=3422#p3422</guid>
		</item>
		<item>
			<title><![CDATA[Re: Отправка в Telegram из QUIK]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=3081#p3081</link>
			<description><![CDATA[<p>Правда есть одна неприятная особенность, мелькает окно cmd и кажеться основной поток занимает пока висит, а может и зависнуть</p>]]></description>
			<author><![CDATA[null@example.com (iforts)]]></author>
			<pubDate>Wed, 21 Apr 2021 12:30:49 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=3081#p3081</guid>
		</item>
		<item>
			<title><![CDATA[Re: Отправка в Telegram из QUIK]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=3078#p3078</link>
			<description><![CDATA[<p>Спасибо, что делитесь готовыми решениями!! <img src="https://quik2dde.ru/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></description>
			<author><![CDATA[null@example.com (swerg)]]></author>
			<pubDate>Wed, 21 Apr 2021 06:18:16 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=3078#p3078</guid>
		</item>
		<item>
			<title><![CDATA[Re: Отправка в Telegram из QUIK]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=3072#p3072</link>
			<description><![CDATA[<p>Вот рабочий вариант отправки в телеграм через cmd curl</p><p>Установит curl если нет, создать бота и группу или канал узнать id<br />[url]https://betacode.net/11617/install-curl-on-windows[/url]<br /></p><div class="codebox"><pre><code>function tel_group()
  str = &quot;curl --connect-timeout 10 -k -s &quot;
  str = str .. &quot;\&quot;https://api.telegram.org/bot1665286370:AAEEVkD-_VRQtUanptwjn4TlkWdn8xMSu0sc/sendMessage?chat_id=-460430831&amp;text=&quot;
  str = str .. &quot;Hello Lua&quot; 
  local msg = os.execute(&quot;start /MIN &quot;..str)  
  if msg then 
    return true
  else 
    message(&quot;error telegram&quot;)
    return false
  end 
end</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (iforts)]]></author>
			<pubDate>Mon, 19 Apr 2021 17:55:04 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=3072#p3072</guid>
		</item>
		<item>
			<title><![CDATA[Re: Отправка в Telegram из QUIK]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=3068#p3068</link>
			<description><![CDATA[<p>Отбой использую метод от сюда [url]https://quik2dde.ru/viewtopic.php?pid=3066#p3066[/url]</p>]]></description>
			<author><![CDATA[null@example.com (iforts)]]></author>
			<pubDate>Sun, 18 Apr 2021 18:13:32 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=3068#p3068</guid>
		</item>
		<item>
			<title><![CDATA[Отправка в Telegram из QUIK]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=3064#p3064</link>
			<description><![CDATA[<p>Подскажите кто знает что не так почему не уходит сообщение<br /></p><div class="codebox"><pre><code>function telegram_group2(token,chat_id,message)
  local chat_id = &quot;-460430831&quot;
       local token = &quot;1665286310:AAGa6lViJ8NDjybSvMIPGYYCDDcmTIAUdhU&quot;
       local message1 = &quot;Hello Lua&quot; 
  if token and chat_id and message then 
     str=&#039;C:\\curl-7.60.0-win64-mingw-master\\bin\\curl.exe --connect-timeout 10 -k -s &#039;
    str=str..&quot;https://api.telegram.org/bot&quot;..token..&quot;/sendMessage?chat_id=&quot;..chat_id..&quot;&amp;text=&quot;..message1

    
    local msg = os.execute(str)
        if msg then 
            return true
         else 
            message(&quot;error telegram&quot;)
           return false
         end 
    end 
end</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (iforts)]]></author>
			<pubDate>Sun, 18 Apr 2021 07:09:02 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=3064#p3064</guid>
		</item>
	</channel>
</rss>
