File tree 1 file changed +28
-0
lines changed
AutomationScripts/Telegram Bot
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
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 ()
You can’t perform that action at this time.
0 commit comments