Weather based on Konya Technical University with data from The Weather Channel; You can learn instantly, daily and hourly, and you can send warning notifications to people or groups in case of weather events that develop above normal.
KTUN WEATHER BOT |
---|
Command | Explanation |
---|---|
/start |
Starts the bot |
/anlik |
Instant weather |
/bugun |
Today's weather |
/yarin |
Tomorrow's weather |
/ongunluk |
10 days weather |
/saatlik |
24 hour weather |
/konumhava |
Your location's weather |
/komutlar |
Bot commands |
/hakkinda |
Project GitHub link and developer communication |
- Create bot and get API TOKEN via official Telegram bot @BotFather
- Send your own message with the group name to the bot @userinfobot and copy the IDs
- Go to the bot you created, click the "Start" button and add your bot to your group and give it admin
Note: This step was done with "Visual Studio Code".
- Clone or download and unzip the repo
https://github.com/ahmethkablama/ktun-weather-bot
- You can use the following command for cloning
git clone https://github.com/ahmethkablama/ktun-weather-bot
- install
npm
from terminalnpm install
- Create
.env
file based on.env-example
file 4.ReplaceYOUR_API
,YOUR_ID
andGROUP_ID
in the.env
file with @BotFather and @userinfobot Fill according to API and IDs found in bots - install
npm
from terminal - Run it with the command
npm run start
ornode bot.js
Note: This step requires a dedicated IP address or a domain-named server (hosting).
- Download the repo
https://github.com/ahmethkablama/ktun-weather-bot
- Create an empty folder with your bot's name in your server's home directory
- Upload bot files to the folder you created
- Create
.env
file based on.env-example
file - Replace
YOUR_API
,YOUR_ID
andGROUP_ID
in the.env
file with @BotFather and @userinfobot Fill according to API and IDs found in bots - From your server panel (described as Cpanel) go to the
Setup Node.js App
tab - Go to the step of creating a new application by clicking the
CREATE APPLICATION
button - Select the appropriate Node.js version and mode. Type your bot's path and startup file (designated as
bot.js
) - Install NPM with
Run NPM Install
command and run your bot withRun JS script
command
Note: This step is to restart the bot in case the button running on the server is disabled due to software and server errors.
- Go to the free service @Cron-Job and complete the registration process.
- Go to the
Cronjobs
page from the relevant menu and click theCREAT CRONJOB
button - On the page that opens, you can write your bot's name in the 'Title' section.
- In the 'URL' section, fill in 'http://SİTENİZ.com/BOTuzun_SUNUCU_YOLU/BOTuzun_ADI.js' according to you. (Fill in the part that says YOUR SITE with your domain name or IP address)
- In the
Execution schedule
section, enter the time frequency you want - Tick
Treat redirects with HTTP 3xx status code as success
in theADVANCED
section above - Click the
SAVE
button and save your settings.
Note: Every time the Cron Job runs, it will throw a
Cronjob execution: Failed (timeout)
error. Don't mind this, your bot will run automatically whenever you want.