Tweet via cBot

Created at 05 Jul 2020, 09:42
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!
TR

trend_meanreversion

Joined 31.07.2014

Tweet via cBot
05 Jul 2020, 09:42


Can someone please show me how to send text from cBot to twitter ? I tried TweetInvi as per instructions in below forum conversation but it doesn't seem to work. 

I have already got all DLLs via nuget in TweetInvi 4.0 and added them via Manage references in cAutomate. There is no error while building/compiling cBot but it doest work / post tweets (doesn't give any error) as required.

 

Can someone please help ?

 

-TRMR


@trend_meanreversion
Replies

trend_meanreversion
05 Jul 2020, 14:23

RE:

trend_meanreversion said:

Can someone please show me how to send text from cBot to twitter ? I tried TweetInvi as per instructions in below forum conversation but it doesn't seem to work. 

I have already got all DLLs via nuget in TweetInvi 4.0 and added them via Manage references in cAutomate. There is no error while building/compiling cBot but it doest work / post tweets (doesn't give any error) as required.

 

Can someone please help ?

 

-TRMR

 

To provide more information on my issue:

1) Downloaded https://www.nuget.org/packages/TweetinviAPI/    v4.0.3 . Unzipped it and got dll files .

2) Used dll files inside "\lib\netstandard2.0" folder and added them via 'Manage References' in cAutomate.

3) Added using Tweetinvi ;   ( at top of my code ) and tried to compile

3) Got error Error CS0012: The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

   ** To remove above error: Manually edited the .csproj file and adding the reference. <Reference Include="netstandard" />

3) The I had below lines essentially in my code 

     using Tweetinvi ;   ( at top of my code )

     Auth.SetUserCredentials("Access_Token", "Access_Token_Secret", "Consumer_Key", "Consumer_Secret");     // In onStart() function

    // I have checked access token/secret, consumer token/secret and provided read, write and direct message permissions via  https://developer.twitter.com/

4) Got below error:

     Crashed in OnStart with TypeInitializationException: The type initializer for 'Tweetinvi.Auth' threw an exception.

 

Can't resolve it any further..Pls can someone help ? This is supposed to be very simple to just tweet a text via cBot !! 

 

-TRMR


@trend_meanreversion

ctrader.guru
07 Jul 2020, 10:16

 This project work fine 

 


@ctrader.guru

trend_meanreversion
07 Jul 2020, 10:58

RE:

ctrader.guru said:

 This project work fine 

 

Thanks. Can you please provide me dll file to be added ? I don't know how to add .cs file to a project in cAutomate. I don't use visual studio.


@trend_meanreversion

ctrader.guru
17 May 2022, 14:56

RE: RE:

trend_meanreversion said:

trend_meanreversion said:

Can someone please show me how to send text from cBot to twitter ? I tried TweetInvi as per instructions in below forum conversation but it doesn't seem to work. 

I have already got all DLLs via nuget in TweetInvi 4.0 and added them via Manage references in cAutomate. There is no error while building/compiling cBot but it doest work / post tweets (doesn't give any error) as required.

 

Can someone please help ?

 

-TRMR

 

To provide more information on my issue:

1) Downloaded https://www.nuget.org/packages/TweetinviAPI/    v4.0.3 . Unzipped it and got dll files .

2) Used dll files inside "\lib\netstandard2.0" folder and added them via 'Manage References' in cAutomate.

3) Added using Tweetinvi ;   ( at top of my code ) and tried to compile

3) Got error Error CS0012: The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

   ** To remove above error: Manually edited the .csproj file and adding the reference. <Reference Include="netstandard" />

3) The I had below lines essentially in my code 

     using Tweetinvi ;   ( at top of my code )

     Auth.SetUserCredentials("Access_Token", "Access_Token_Secret", "Consumer_Key", "Consumer_Secret");     // In onStart() function

    // I have checked access token/secret, consumer token/secret and provided read, write and direct message permissions via  https://developer.twitter.com/

4) Got below error:

     Crashed in OnStart with TypeInitializationException: The type initializer for 'Tweetinvi.Auth' threw an exception.

 

Can't resolve it any further..Pls can someone help ? This is supposed to be very simple to just tweet a text via cBot !! 

 

-TRMR

 

You have to insert a reference to the netstandard.dll, e.g. I use the 4.8 framework and find the reference in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\Facades\netstandard.dll or try finding the library in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.0.6\netstandard.dll

 


@ctrader.guru