Skip to content

Commit 73dad2e

Browse files
committed
docs: update documentation according to latest virtuals_tweepy
1 parent 642b268 commit 73dad2e

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

plugins/twitter/README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ The Twitter plugin can be initialized in one of two ways:
4848
# Define your options with the necessary credentials
4949
options = {
5050
"credentials": {
51-
"gameTwitterAccessToken": os.environ.get("GAME_TWITTER_ACCESS_TOKEN")
51+
"game_twitter_access_token": os.environ.get("GAME_TWITTER_ACCESS_TOKEN")
5252
},
5353
}
5454
# Initialize the TwitterPlugin with your options
5555
twitter_plugin = TwitterPlugin(options)
56+
client = twitter_plugin.twitter_client
5657
5758
# Post a tweet
58-
post_tweet_fn = twitter_plugin.get_function('post_tweet')
59-
post_tweet_fn("Hello world!")
59+
client.create_tweet(text="Hello world! This is a test tweet from the Twitter Plugin with GAME Access Token!")
6060
```
6161
6262
2. Using your own X API credentials
@@ -77,19 +77,18 @@ The Twitter plugin can be initialized in one of two ways:
7777
# Define your options with the necessary credentials
7878
options = {
7979
"credentials": {
80-
"bearerToken": os.environ.get("TWITTER_BEARER_TOKEN"),
81-
"apiKey": os.environ.get("TWITTER_API_KEY"),
82-
"apiSecretKey": os.environ.get("TWITTER_API_SECRET_KEY"),
83-
"accessToken": os.environ.get("TWITTER_ACCESS_TOKEN"),
84-
"accessTokenSecret": os.environ.get("TWITTER_ACCESS_TOKEN_SECRET"),
80+
"api_key": os.environ.get("TWITTER_API_KEY"),
81+
"api_key_secret": os.environ.get("TWITTER_API_KEY_SECRET"),
82+
"access_token": os.environ.get("TWITTER_ACCESS_TOKEN"),
83+
"access_token_secret": os.environ.get("TWITTER_ACCESS_TOKEN_SECRET"),
8584
},
8685
}
8786
# Initialize the TwitterPlugin with your options
8887
twitter_plugin = TwitterPlugin(options)
88+
client = twitter_plugin.twitter_client
8989

9090
# Post a tweet
91-
post_tweet_fn = twitter_plugin.twitter_client.create_tweet
92-
post_tweet_fn(text="Hello world! This is a test tweet from the Twitter Plugin!")
91+
client.create_tweet(text="Hello world! This is a test tweet from the Twitter Plugin with X API credentials!")
9392
```
9493

9594
For detailed documentation on each function's parameters and usage, please refer to the [Tweepy Client Documentation](https://docs.tweepy.org/en/stable/client.html).

0 commit comments

Comments
 (0)