-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
85 lines (54 loc) · 2.57 KB
/
main.py
File metadata and controls
85 lines (54 loc) · 2.57 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import telegram
from telegram.ext import Updater, MessageHandler, Filters, CommandHandler
import logging
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)
updater = Updater(token=<TOKEN>, use_context=True)
dispatcher = updater.dispatcher
def start(update, context):
context.bot.send_message(chat_id=update.effective_chat.id, text="Hello there MIDZY!")
start_handler = CommandHandler('start', start)
dispatcher.add_handler(start_handler)
updater.start_polling()
def echo(update, context):
context.bot.send_message(chat_id=update.effective_chat.id, text=update.message.text)
echo_handler = MessageHandler(Filters.text & (~Filters.command), echo)
dispatcher.add_handler(echo_handler)
# says goodbye
def bye(update, context):
context.bot.send_message(chat_id=update.effective_chat.id, text="goodbye MIDZY")
bye_handler = CommandHandler('bye', bye)
dispatcher.add_handler(bye_handler)
# whoismybias
def whoismybias(update, context):
context.bot.send_message(chat_id=update.effective_chat.id, text="Yuna is your bias")
bias_handler = CommandHandler('whoismybias', whoismybias)
dispatcher.add_handler(bias_handler)
# sendPhoto
def sendPhoto(update, context):
context.bot.send_photo(chat_id=update.effective_chat.id,
photo=open("chaeshook.jpg", 'rb'),
caption=None)
photo_handler = CommandHandler('sendPhoto', sendPhoto)
dispatcher.add_handler(photo_handler)
#YejiPhoto
def YejiPhoto(update, context):
context.bot.send_photo(chat_id=update.effective_chat.id,
photo=(
"https://64.media.tumblr.com/8e6f9942ac07524588405407b4a2c8d6"
"/tumblr_plvc6hVD4i1w7pgvx_540.jpg"),
caption=None)
yejiphoto_handler = CommandHandler('YejiPhoto', YejiPhoto)
dispatcher.add_handler(yejiphoto_handler)
#sends a gif of Yuna
def YunaGIF(update, context):
context.bot.send_animation(chat_id=update.effective_chat.id,
animation=open("yuna_gif.gif", 'rb')).animation
yunagif_handler = CommandHandler('YunaGIF', YunaGIF)
dispatcher.add_handler(yunagif_handler)
#mimics the GIF you send
#echoGIF
def echoGIF(update, context):
context.bot.send_animation(chat_id=update.effective_chat.id, animation=update.message.animation)
echoGIF_handler = MessageHandler(Filters.animation & (~Filters.command), echoGIF)
dispatcher.add_handler(echoGIF_handler)