Telegram 17.0.0 is terminated on cTrader 4.2

Created at 04 Apr 2022, 11:54
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
NO

noppanon

Joined 17.05.2017

Telegram 17.0.0 is terminated on cTrader 4.2
04 Apr 2022, 11:54


Hi sir,

   I am having a problem when using Telegram 17.0.0 (.net core 3.1) on cTrader 4.2 (beta). The Telegram simple code works on console but does not cTrader 4.2. When I run, the cTrader will be terminated. See below. 

 

 

using System;
using cAlgo.API;
using Telegram.Bot;

namespace Ttt42
{
    [Robot(AccessRights = AccessRights.None)]
    public class Ttt42 : Robot
    {
        public TelegramBotClient TG;

        protected override void OnStart()
        {
            TG = new Telegram.Bot.TelegramBotClient("token");
        }
        protected override void OnBar()
        {
            try
            {
                SendTG();
            }
            catch (Exception ex)
            {
                    Print("Telegrame send error {0}", ex.Message);
            }
        }
        protected async void SendTG()
        {
            await TG.SendTextMessageAsync("channelID", "TG from cTrader");
        }
    }
}

cTrader error. 

Telegram error

Please advice,

Noppanon

 


@noppanon
Replies

amusleh
04 Apr 2022, 11:58

Hi,

Can you try it with Robot AccessRights set to FullAccess?


@amusleh

noppanon
04 Apr 2022, 12:27

RE:

amusleh said:

Hi,

Can you try it with Robot AccessRights set to FullAccess?

When I changed to full access, the problem still persist. 

 

Noppanon


@noppanon

noppanon
04 Apr 2022, 13:00

Hi,

   I'm so sorry. My stupid mistake. When I change to FullAccess. Now it works.

Thanks Amusleh.
 

Noppanon


@noppanon