Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

Commit

Permalink
Added command to return command list
Browse files Browse the repository at this point in the history
1. Added a new command (/commands)
2. Fixed variable name
  • Loading branch information
Philotheephilix committed May 5, 2023
1 parent f038cc9 commit f13a81b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ This bot can automate these following tasks
Fire = 101
Police = 100

7. Commands : This command returns all the available commands
## Links
[Releases](https://github.com/Philotheephilix/Multi-funtional-telegram-bot/releases)

Expand Down
13 changes: 12 additions & 1 deletion multi_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
API_KEY = "<TELEGRAM BOT API KEY>"
bot = telebot.TeleBot(API_KEY)
BASE_URL = "http://api.openweathermap.org/data/2.5/weather?"
API = "<OPEN WEATHER API KEY>"
OW_API = "<OPEN WEATHER API KEY>"
tmpdir=os.getcwd()
is_weather="0"
sos_active="0"
Expand Down Expand Up @@ -104,6 +104,17 @@ def tell_joke(message):
@bot.message_handler(commands=["start"])
def greet(message):
bot.reply_to(message,"Hey! Hows it going?")
@bot.message_handler(commands=["commands"])
def message(message):
commands="""/start - greet to check life of the bot
/tell_joke - returns a random joke
/weather - view the weather of the city
/check_email - check email for unread messages
/jpg2pdf - converts images to pdf
/sos - emergency contact number
/commands - return list of commands
"""
bot.reply_to(message,"Here are the list of commands \n"+commands)
@bot.message_handler(commands=["weather","sos"])
def weather(message):
status=str(message.text)
Expand Down

0 comments on commit f13a81b

Please sign in to comment.