- Send
/start
or - Tap on START button
Alhamdulillah ramai sukaaa T_T. Ni yg terharu ni thanks my friendsss.
- Create a new Telegram bot from BotFather
- Follow the process and at the end, you'll see your bot token. Copy this token.
- Go to signup/login to Heroku, click New to create new app.
- Enter the name (eg:
my-tele-bot-200
) and choose the region. Then, click Create App. - Remember the bot token we copied earlier in step 2? Great! Since the token is private and sensitive, we don't want to hardcoded in our program. Now, still in the Heroku, go to Settings, and then Config Vars.
- Click Reveal Config Vars
- Fill in the KEY and VALUE
- KEY:
MY_BOT_TOKEN
(This variable is what we are going to use in our app) - TOKEN: paste you Telegram bot token
- KEY:
- Click on Open App (located at upper right corner). Then, copy the link. It will look something like
https://my-tele-bot-200.herokuapp.com/
- Now, fork and clone this repo into your local machine.
- Open
bot.py
file. You'll need to replace value inSERVER_URL
andBOT_TOKEN
.- SERVER_URL: Paste the link you've copied in step 8
- BOT_TOKEN: Replace value inside [''] with your config vars, it will looks like
os.environ['MY_BOT_TOKEN']
Now, we are good to go to deploy to the Heroku, there are generally two ways to deploy it, by using Heroku CLI or GitHub. You can use whatever you like but I'm going to use the latter.
- Push your changes to the GitHub.
- In the Heroku, go to Deploy section, then go to Deployment method
- Choose the second option, connect with your GitHub repository and follow all the process.
- You can setup automatic/manual deployment.
- All set! Go to your Telegram bot, press START, the bot will respond to you in seconds. 😉
- https://technobb.com/100-inspirational-islamic-quotes-with-beautiful-images/
- https://www.daniel-wong.com/2015/10/05/study-motivation-quotes/
- https://mvslim.com/you-can-still-make-the-most-of-ramadan-32-inspirational-and-motivational-islamic-quotes-to-help-you-how/
- https://www.daniel-wong.com/2015/10/05/study-motivation-quotes/
Credit to this page https://towardsdatascience.com/how-to-deploy-a-telegram-bot-using-heroku-for-free-9436f89575d2 for tutorial on deploying to Heroku ... and of course StackOverflow hahaha