So I am using the below code to post a status update to X (formerly Twitter). It is using the LinqToTwitter library created by Joe Mayo in C#. Note that I have verified 4 times that all of the tokens/keys/secrets are correct on the X Developer Portal. When I call the "tweet" method and pass a string, the code runs with no errors, but the status update is never posted to my X feed. I think the code is stuck and never actually runs when it calls await twitterCtx.TweetAsync(message); Any ideas what I am doing wrong or missing? Any help or suggestions are greatly appreciated, as I have been trying to get this to work for a week now.
public void tweet(string message)
{
sendTweet(message);
}
static async void sendTweet(string message)
{
var auth = new SingleUserAuthorizer
{
CredentialStore = new SingleUserInMemoryCredentialStore
{
ConsumerKey = "####################",
ConsumerSecret = "####################",
AccessToken = "####################",
AccessTokenSecret = "####################",
OAuthToken = "####################",
OAuthTokenSecret = "####################"
}
};
var twitterCtx = new TwitterContext(auth);
await twitterCtx.TweetAsync(message);
}