Skip to content

101Loop/beepstarbot-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BeepStarBot (Working Locally for now)

Copy of NaaiveBot, but this time written in Go.

How To Use it Locally

You need Go, ngrok and curl as well installed in your system for this to work

  • Fork/Clone this repo.
  • Run git clone link-to-repo.git to clone this repo locally.
  • Run cd beepstarbot-go - to go to the repo folder.
  • Run go get to install dependencies.
  • Create a new bot using BotFather and get your BOT_TOKEN.
  • Copy .env.example file to .env and add BOT_TOKEN & SENTRY_DSN(this is optional, leave this empty if you want but Sentry is a nice tool to log errors in production.)
  • Run go run main.go (Bot is now running)
  • Run ngrok http 3000 (First cd into the directory where you installed ngrok then run this command)
  • You'll see some public URLs after running the previous command.
  • URLs will look like this https://<some_code>.ngrok.io(notice https), copy the URL which have https.
  • Now run the following command
curl -F "url=https://<some_code>.ngrok.io/"  https://api.telegram.org/bot<your_api_token>/setWebhook

This will let telegram know that our bot has to talk to this url whenever it receives any message.

  • Now your bot ready to kick members.

Note: When you are done testing or if you restart ngrok then run the following command

curl https://api.telegram.org/bot<your_api_token>/deleteWebhook

This will reset the webhook url.

TODO: Add steps for deployment

Acknowledgements

Contributing

  • Please file bugs and send pull requests to the GitHub Repository and issue tracker.
    • Don't be afraid to open half-finished PRs, and ask questions if something is unclear!
    • No contribution is too small! Please submit as many fixes for typos and grammar bloopers as you can!
    • Try to limit each pull request to one change only.
  • For help and support please reach out to us on Slack.

Releases

No releases published

Packages

 
 
 

Contributors