Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an alert for every new tweet from OSDC twitter account. #5

Closed
sidntrivedi012 opened this issue Nov 18, 2019 · 5 comments · Fixed by #52
Closed

Add an alert for every new tweet from OSDC twitter account. #5

sidntrivedi012 opened this issue Nov 18, 2019 · 5 comments · Fixed by #52
Assignees
Labels
enhancement New feature or request telegram bot

Comments

@sidntrivedi012
Copy link
Member

sidntrivedi012 commented Nov 18, 2019

First-time Contributors

If it is the first time that you contribute to the bot, follow these steps:

  1. You need to have git & golang available on your machine.
  2. Write a comment in this issue thread to let other possible contributors know that you are working on this bug. For eg : Hey all, I would like to work on this issue.
  3. Ping Botfather on Telegram and make your instance of OSDC-Bot bot by selecting /newbot from the options it provides.
  4. Copy the TELEGRAM_TOKEN provided by Botfather.
  5. Fork this repo.
  6. Run git clone https://github.com/<YOUR_USERNAME>/bots.git && cd bots/telegram-bot
  7. If you have installed golang, run go build .
  8. Wait ⏳
  9. Run export TELEGRAM_TOKEN=<botfather_token>
  10. Now, run ./telegram-bot. The bot would be running at the user handle provided by you.
  11. Make changes according to the issue. Test the working of the changes.
  12. Commit the changes and then run git push origin master and then open a PR! 🎉
@sidntrivedi012 sidntrivedi012 added the enhancement New feature or request label Nov 20, 2019
@PrimalPimmy
Copy link
Member

I would like to work on this issue.

@daemon1024
Copy link
Member

daemon1024 commented Oct 4, 2020

Hey @PrimalPimmy, Thanks for showing interest in this. If you have any queries regarding setting up or the issue feel free to ask here 😊

@daemon1024
Copy link
Member

Hey @PrimalPimmy Did you progress with the issue? Feel free to ask if you need any help in implementing it 😄

@PrimalPimmy
Copy link
Member

Hey @PrimalPimmy Did you progress with the issue? Feel free to ask if you need any help in implementing it 😄

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!

@PrimalPimmy
Copy link
Member

PrimalPimmy commented Nov 2, 2020

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..
Screenshot from 2020-11-02 18-30-57

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request telegram bot
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants