Closed sidntrivedi012 closed 4 years ago
I would like to work on this issue.
Hey @PrimalPimmy, Thanks for showing interest in this. If you have any queries regarding setting up or the issue feel free to ask here 😊
Hey @PrimalPimmy Did you progress with the issue? Feel free to ask if you need any help in implementing it :smile:
Hey @PrimalPimmy Did you progress with the issue? Feel free to ask if you need any help in implementing it :smile:
Slowly getting the grasp of Golang. But still learning about how to implement the twitter API in the bot, if you can provide any useful links for this, that'd be helpful!
Okay, so I have made some progress.. Here's the tweet function that I created this function for the tweet.. Not showing my tokens for obvious reasons..
func tweet(ID int64) { //Initializing twitter API config := oauth1.NewConfig("consumerKey", "consumerSecret") token := oauth1.NewToken("accessToken", "accessSecret") httpClient := config.Client(oauth1.NoContext, token) Tclient := twitter.NewClient(httpClient)
tweets, resp, err := Tclient.Timelines.HomeTimeline(&twitter.HomeTimelineParams{
Count: 1,
})
bot.Send(tbot.NewMessage(ID, tweets.Text))
}
But the error here is..
Now afaik, the type tweet in the twitter-go package does indeed contain a Text method, given here.. https://godoc.org/github.com/dghubble/go-twitter/twitter#Tweet
So this is the progress so far, but if you can check it out a little, that'd be great too, otherwise it's just almost done I guess.
First-time Contributors
If it is the first time that you contribute to the bot, follow these steps:
Hey all, I would like to work on this issue.
/newbot
from the options it provides.TELEGRAM_TOKEN
provided by Botfather.git clone https://github.com/<YOUR_USERNAME>/bots.git && cd bots/telegram-bot
go build .
export TELEGRAM_TOKEN=<botfather_token>
./telegram-bot
. The bot would be running at the user handle provided by you.git push origin master
and then open a PR! 🎉