Skip to content

Commit dd6ff67

Browse files
authored
Add files via upload
1 parent da5a99e commit dd6ff67

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Diff for: AutomationScripts/Telegram Bot/telegram_bot.py

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
from telegram import *
3+
from telegram.ext import *
4+
5+
6+
bot= Bot("")#Api key of bot in the bracket
7+
updater = Updater("API Key",use_context=True)
8+
dispatcher =updater.dispatcher
9+
#function for play_music
10+
def test_function(update:Update,context:CallbackContext):
11+
bot.send_message(
12+
chat_id=update.effective_chat.id,
13+
text="tutorial link : https://www.youtube.com/watch?v=ugR8bY4hQ4M",
14+
)
15+
start_value = CommandHandler('play_music',test_function)
16+
dispatcher.add_handler(start_value)
17+
18+
#function for hello
19+
def test_function1(update:Update,context:CallbackContext):
20+
bot.send_message(
21+
chat_id=update.effective_chat.id,
22+
text="Hello JI,how are you??",
23+
)
24+
start_value = CommandHandler('Hello',test_function1)
25+
dispatcher.add_handler(start_value)
26+
27+
28+
updater.start_polling()

0 commit comments

Comments
 (0)