Hello! I am attempting to make it so pressing a button will post a tweet to a bot account. I am using this API module script: https://www.roblox.com/library/458958433/Twitter-API
I understand that I need to use something along the lines of module.api_call("post", "somepath/here", {--[[data here]])
, I just don't know how because I'm still kind of new to scripting. The part that is most confusing for me is what path I need for tweeting, and what I need to put for data. All help would be greatly appreciated, thank you!
also, if anyone knows a better way of doing this, please tell me!
The api_call function sends a post request to twitter with a link we specified in the parameters.
If we were to call the link ourselves, this is what the link would look like:
https://api.twitter.com/1.1/statuses/update.json?status=hello
Anyway, since we want to update the status, we'd make the second parameter "statuses/update" like in the link above. The third parameter are the possible parameters.
You can see here for a list of possible parameters, but right now, we just want to send a tweet that says hello world, so we'll only specify the text we want in the tweet for the third parameter.
The code should end up looking like this
api_call("post", "statuses/update", {"hello, this is my first tweet!"})
if that doesn't work, try:
api_call("post", "statuses/update", {status = "hello, this is my first tweet!"})