Skip to content

Commit

Permalink
Create telegrambot.py
Browse files Browse the repository at this point in the history
hello
this is my first PULLREQUEST hope it would merged successfully

thank you
ossamamehmood
  • Loading branch information
bevnign authored Oct 15, 2023
1 parent 6df9dc6 commit da63b08
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Add Code Here/PYTHON/telegrambot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
import telebot

bot = telebot.TeleBot("830686394:AAEhR8rx4YHxhQfh7L7msuhyK7-FiRu1gU4")

@bot.message_handler(content_types=["text"])
def handle_text(message):
if message.text == "Hi":
bot.send_message(message.from_user.id, "Hello! I'm in test mode. What' up?")

elif message.text == "How are you?" or message.text == "How are u?":
bot.send_message(message.from_user.id, "I'm fine, thanks. And you?")

else:
bot.send_message(message.from_user.id, "Sorry, i dont understand you.")

bot.polling(none_stop=True, interval=0)

# Обработчик команд '/start' и '/help'.
@bot.message_handler(commands=['start', 'help'])
def handle_start_help(message):
pass

# Обработчик для документов и аудиофайлов
@bot.message_handler(content_types=['document', 'audio'])
def handle_document_audio(message):
pass

bot.polling(none_stop=True, interval=0)

0 comments on commit da63b08

Please sign in to comment.