-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbots.py
More file actions
54 lines (38 loc) · 1.98 KB
/
bots.py
File metadata and controls
54 lines (38 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from telegram.ext.updater import Updater
from telegram.update import Update
from telegram.ext.callbackcontext import CallbackContext
from telegram.ext.commandhandler import CommandHandler
from telegram.ext.messagehandler import MessageHandler
from telegram.ext.filters import Filters
updater = Updater("5386523840:AAFDd498SkG03PTfsK1ST5DIehWrJJ6Ft4Y",
use_context=True)
def start(update: Update, context: CallbackContext):
update.message.reply_text(
"Welcome!, Kindly drop your full name, Email and a short description of the kind of bot you want and we will get back to you shortly. Please write /help to see the commands available.")
def help(update: Update, context: CallbackContext):
update.message.reply_text("""Available Commands :-
/linkedin - To get the LinkedIn profile URL
/gmail - To get gmail URL""")
def gmail_url(update: Update, context: CallbackContext):
update.message.reply_text(
"pre.chika.22@gmail.com")
def linkedIn_url(update: Update, context: CallbackContext):
update.message.reply_text(
"https://www.linkedin.com/in/precious-chika-14465118b/")
def unknown(update: Update, context: CallbackContext):
update.message.reply_text(
"Sorry '%s' is not a valid command" % update.message.text)
def unknown_text(update: Update, context: CallbackContext):
update.message.reply_text(
"Sorry I can't recognize you , you said '%s'" % update.message.text)
updater.dispatcher.add_handler(CommandHandler('start', start))
updater.dispatcher.add_handler(CommandHandler('Linkedln', linkedIn_url))
updater.dispatcher.add_handler(CommandHandler('help', help))
updater.dispatcher.add_handler(CommandHandler('gmail', gmail_url))
updater.dispatcher.add_handler(MessageHandler(Filters.text, unknown))
updater.dispatcher.add_handler(MessageHandler(
# Filters out unknown commands
Filters.command, unknown))
# Filters out unknown messages.
updater.dispatcher.add_handler(MessageHandler(Filters.text, unknown_text))
updater.start_polling()